I create a slider controlling the duration of an infection.

Begin micro-behaviour

CREATE-RATE-OF-RECOVERY-SLIDER

Begin NetLogo code:
substitute-text-area-for slider-variable-name the-average-duration-of-infection               
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.1   
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 value
End NetLogo code

Variants

You can change the location, minimum and maximum values, increment, and initial value. The units are in weeks.

Related Micro-behaviours

POSSIBLY-RECOVER uses the parameter defined by this slider. CREATE-INFECTION-ODDS-SLIDER, CREATE-FRACTION-VACCINATED-AT-BIRTH-SLIDER and CREATE-RATE-OF-LOSS-OF-IMMUNITY-SLIDER create related sliders.

History

This was implemented by Ken Kahn.