OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-generate commits / 4e675ac

Get rid of the delete-link nonsense
4e675acd6c913c2c7780251f8a943a2b46ed0354
by Linas Vepstas <linasvepstas@gmail.com> · 2020-04-22T16:58:08.000Z

Changed files (1) +10 -15

demo/seir.scm +10 -15
……@@ -430,27 +430,22 @@
430430;
431431; The initialization is done with a graph-query and graph-rewrite
432432; run over the AtomSpace. The query is simple: find all individuals
433; attached with a `MemberLink` to an anchor node. The rewrite is
434; trickier: its a `DeleteLink` whose contents are executed first.
435; The contents perform the intialization of each individual that is
436; found. The DeleteLink then just discards the wrapper ListLink.
437; We didn't actually need to discard it, but it seems nice to not
438; leave ponitless garbage lying round in the AtomSpace.
433; attached with a `MemberLink` to an anchor node. The rewrite
434; consists of the 3rd and subsequent clauses: all of the SetValues.
439435
440436(define (initialize-state)
441437 (exec-unwrap
442438 (Bind
443439 (TypedVariable (Variable "$person") (Type "ConceptNode"))
444440 (Present (Member (Variable "$person") anchor))
445 (Delete (List
446 (SetValue (Variable "$person") seir-state susceptible)
447 (SetValue (Variable "$person") susceptibility
448 (RandomNumber (Number 0.2) (Number 0.8)))
449 (SetValue (Variable "$person") infirmity
450 (RandomNumber (Number 0.01) (Number 0.55)))
451 (SetValue (Variable "$person") recovery
452 (RandomNumber (Number 0.6) (Number 0.95)))
453 ))))
441 (SetValue (Variable "$person") seir-state susceptible)
442 (SetValue (Variable "$person") susceptibility
443 (RandomNumber (Number 0.2) (Number 0.8)))
444 (SetValue (Variable "$person") infirmity
445 (RandomNumber (Number 0.01) (Number 0.55)))
446 (SetValue (Variable "$person") recovery
447 (RandomNumber (Number 0.6) (Number 0.95)))
448 ))
454449 *unspecified*)
455450
456451; Run the above.