POSSIBLE-INFECTIONBegin NetLogo code:
do-if my-state = "susceptible" ; if I'm susceptible [do-with-probability the-infection-odds ; and the infection occurs [add-behaviours list-of-micro-behaviours "Behaviours when infected" [SET-STATE-INFECTED.html]]]End NetLogo code
This uses SET-STATE-INFECTED to conditionally set my state to infected. RANDOM-ENCOUNTER uses this micro-behaviour. CREATE-INFECTION-ODDS-SLIDER sets the the-infection-odds variable.
When my-state is "susceptible" then the odds of getting the infection are used to determine if I'm infected.
This was implemented by Ken Kahn.