| … | … | @@ -123,12 +123,23 @@ |
| 123 | 123 | (Define |
| 124 | 124 | (DefinedSchema "transmission") |
| 125 | 125 | (Lambda |
| 126 | | (VariableList (Variable "$A") (Variable "$B")) |
| 126 | (VariableList (Variable "$A") (Variable "$B") (Variable "$REL")) |
| 127 | 127 | (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. |
| 129 | 133 | (And |
| 130 | 134 | (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)))) |
| 132 | 143 | (SetValue (Variable "$A") seir-state exposed) |
| 133 | 144 | ))) |
| 134 | 145 | |
| … | … | @@ -584,11 +595,17 @@ |
| 584 | 595 | (Bind |
| 585 | 596 | (VariableList |
| 586 | 597 | (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"))) |
| 588 | 600 | (Present |
| 589 | | (Set (Variable "$pers-a") (Variable "$pers-b"))) |
| 601 | (Evaluation |
| 602 | (Variable "$relation") |
| 603 | (Set (Variable "$pers-a") (Variable "$pers-b")))) |
| 590 | 604 | (Put (DefinedSchema "transmission") |
| 591 | | (List (Variable "$pers-a") (Variable "$pers-b"))))) |
| 605 | (List |
| 606 | (Variable "$pers-a") |
| 607 | (Variable "$pers-b") |
| 608 | (Variable "$relation"))))) |
| 592 | 609 | *unspecified*) |
| 593 | 610 | |
| 594 | 611 | ; Search for individuals, and apply the state transition rule. |