CREATE-ENCOUNTER-RATE-SLIDERBegin NetLogo code:
substitute-text-area-for slider-variable-name the-encounter-rate substitute-text-area-for slider-upper-left-corner-x 625 substitute-text-area-for slider-upper-left-corner-y 10 substitute-text-area-for slider-lower-right-corner-x 875 substitute-text-area-for slider-lower-right-corner-y 50 substitute-text-area-for slider-minimum-value 0 substitute-text-area-for slider-maximum-value 10 substitute-text-area-for slider-increment .1 substitute-text-area-for slider-initial-value 2 create-slider "slider-variable-name" ; the name of the parameter (a global variable) "slider-upper-left-corner-x" "slider-upper-left-corner-y" ; upper left corner (from the upper left corner of the applet) "slider-lower-right-corner-x" "slider-lower-right-corner-y" ; lower right corner "slider-minimum-value" "slider-maximum-value" ; minimum and maximum value "slider-increment" ; increment "slider-initial-value" ; initial valueEnd NetLogo code
You can change the location, minimum and maximum values, increment, and initial value.
RANDOM-ENCOUNTER uses the parameter the-encounter-rate defined by this slider. Together with CREATE-INFECTION-ODDS-SLIDER this specifies β or the force of infection in . CREATE-DEATH-RATE-SLIDER, CREATE-RATE-OF-RECOVERY-SLIDER, CREATE-FRACTION-VACCINATED-AT-BIRTH-SLIDER and CREATE-RATE-OF-LOSS-OF-IMMUNITY-SLIDER create related sliders.
The change in the number of infected is given in  as the product of the force of infection times the number of infected times the number of susceptible:
In this model the expected change is
the-encounter-rate ∙ the-infection-odds ∙ I ∙ S/N
S/N is the odds that an encounter is with a susceptible individual.
If N (the total population) is constant then
β = the-encounter-rate ∙ weeks-in-a-year ∙ the-infection-odds / N
where weeks-in-a-year is introduced since the-encounter-rate is given in encounters per week while β is per year. This calculation can be performed by MONITOR-FORCE-OF-INFECTION.
This was implemented by Ken Kahn.
 "Mathematical models of vaccination", Almut Scherer and Angela McLean, British Medical Bulletin 2002;62 187-199.