RANDOM-ENCOUNTER
Begin NetLogo code:do-every 1
[do-if my-state = "infected"
[do-for-n the-encounter-rate
all-individuals with [my-state != "dead"]
[set my-last-encounter the-other
add-behaviour POSSIBLE-INFECTION]]]
End NetLogo code
This models individuals that have the-encounter-rate encounters per time period (a week). The time period can be changed by replacing the 1 in do-every 1.
This relies upon the POSSIBLE-INFECTION micro-behaviour to possibly infect the other. CREATE-ENCOUNTER-RATE-SLIDER defines the the-encounter-rate variable used here.
RANDOM-SPATIAL-ENCOUNTER differs from this micro-behaviour in biasing the selection of the other individual to those close by.
RANDOM-SOCIAL-ENCOUNTER selects among my acquaintances.
RANDOM-PHYSICAL-ENCOUNTER selects among those at my location.
Every elapsed second or simulated week, if I'm still infected (i.e., my-state = "infected") then I pick the-encounter-rate other individuals (who are not dead) and give them the micro-behaviour POSSIBLE-INFECTION. If the-encounter-rate is a non-integer then the remainder is compared with a random number to probabilistically to possibly include one additional individual. I also sets the my-last-encounter variable of the other individuals to me in order to keep track of how many infections I cause.
This was implemented by Ken Kahn.