OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-generate commits / ee2bdee

Start work on a proper transmission model.
ee2bdee40c834bde669d66aba40c3c78f4ffd4c4
by Linas Vepstas <linasvepstas@gmail.com> · 2020-04-22T15:42:19.000Z

Changed files (1) +23 -6

demo/seir.scm +23 -6
……@@ -123,12 +123,23 @@
123123(Define
124124 (DefinedSchema "transmission")
125125 (Lambda
126 (VariableList (Variable "$A") (Variable "$B"))
126 (VariableList (Variable "$A") (Variable "$B") (Variable "$REL"))
127127 (Cond
128 ; If A is susceptible and B is infected, then A is exposed.
128 ; If A is susceptible and B is infected, then maybe
129 ; A is exposed, if A gets close enough/spends enough
130 ; time with B. A passing stranger is unlikely to
131 ; lead to exposure; but friends are harder to avoid
132 ; and are thus more likely to lead to exposure.
129133 (And
130134 (Equal (ValueOf (Variable "$A") seir-state) susceptible)
131 (Equal (ValueOf (Variable "$B") seir-state) infected))
135 (Equal (ValueOf (Variable "$B") seir-state) infected)
136 (Or
137 (And
138 (Equal (Variable "$REL") (Concept "friend"))
139 (GreaterThan (RandomNumber (Number 0) (Number 1)) 0.3))
140 (And
141 (Equal (Variable "$REL") (Concept "stranger"))
142 (GreaterThan (RandomNumber (Number 0) (Number 1)) 0.7))))
132143 (SetValue (Variable "$A") seir-state exposed)
133144 )))
134145
……@@ -584,11 +595,17 @@
584595 (Bind
585596 (VariableList
586597 (TypedVariable (Variable "$pers-a") (Type "ConceptNode"))
587 (TypedVariable (Variable "$pers-b") (Type "ConceptNode")))
598 (TypedVariable (Variable "$pers-b") (Type "ConceptNode"))
599 (TypedVariable (Variable "$relation") (Type "ConceptNode")))
588600 (Present
589 (Set (Variable "$pers-a") (Variable "$pers-b")))
601 (Evaluation
602 (Variable "$relation")
603 (Set (Variable "$pers-a") (Variable "$pers-b"))))
590604 (Put (DefinedSchema "transmission")
591 (List (Variable "$pers-a") (Variable "$pers-b")))))
605 (List
606 (Variable "$pers-a")
607 (Variable "$pers-b")
608 (Variable "$relation")))))
592609 *unspecified*)
593610
594611; Search for individuals, and apply the state transition rule.