Browse Micro-Behaviours Needed in Building Disease Models

Disease Micro-Behaviours

These micro-behaviours were designed to explore the SVIR model as presented in "Mathematical models of vaccination", Almut Scherer and Angela McLean, British Medical Bulletin 2002;62 187-199.

These micro-behaviours can also be used to explore models of epidemics that spread via a network of social acquaintances. You may wish to use this step-by-step guide for modelling epidemics. Additional micro-behaviours can be found in the full library.

For creating an initial population:

CREATE-INITIAL-SUSCEPTIBLE-POPULATION -- I create an initial population of susceptible individuals.

CREATE-INITIAL-SUSCEPTIBLE-COUNT-SLIDER -- I create a slider for initial number of susceptible individuals.

CREATE-INITIAL-INFECTED-POPULATION -- I create an initial population of infected individuals.

CREATE-INITIAL-INFECTED-COUNT-SLIDER -- I create a slider for initial number of infected individuals.

CREATE-INITIAL-VACCINATED-POPULATION -- I create an initial population of vaccinated individuals.

CREATE-INITIAL-VACCINATED-COUNT-SLIDER -- I create a slider for initial number of vaccinated individuals.

To initialise the state of individuals:

SET-STATE-SUSCEPTIBLE -- I set my state to susceptible (to infection).

SET-STATE-INFECTED -- I set my state to infected.

SET-STATE-RECOVERED -- I set my state to recovered (from infection).

SET-STATE-VACCINATED -- I set my state of vaccinated.

To see how the current slider settings translate to the mathematical model:

MONITOR-FORCE-OF-INFECTION -- I add a monitor that displays β or the force of infection.

To model the spread of infections:

RANDOM-ENCOUNTER -- I possibly infect anyone in the population.

RANDOM-SOCIAL-ENCOUNTER -- I possibly infect someone in my social network.

RANDOM-SPATIAL-ENCOUNTER -- I possibly infect anyone in the population but with a greater probability for those nearby.

RANDOM-PHYSICAL-ENCOUNTER -- I possibly infect anyone I came into contact with.

POSSIBLE-INFECTION -- I may infect the other individual.

LOG-INFECTION-ONSET -- I add to the log every infection event.

To model recovery:

RECOVERY-POSSIBLE-AFTER-INFECTION -- I add a behaviour so that I recover with some probability.

One way modelling death and birth (using probabilities of dying or giving birth):

BIRTH-RATE -- I give birth with some probability.

DEATH-RATE -- I die with some probability.

To initialise newborns:

POSSIBLY-VACCINATE-NEW-BORN -- A new born is possibly successfully vaccinated.

NEW-BORN-INITIAL-STATE -- I set my attributes to correspond to a new born.

To model the loss of immunity:

POSSIBLY-LOSE-IMMUNITY -- I remove immunity with some probability.

To create plots as it runs:

CREATE-POPULATIONS-PLOT -- I create a plot to which other micro-behaviours can add.

ADD-SUSCEPTIBLE-TO-POPULATIONS-PLOT -- I add a plot of the number of susceptible individuals to the Populations Plot.

ADD-VACCINATED-TO-POPULATIONS-PLOT -- I add a plot of the number of vaccinate individuals to the Populations Plot.

ADD-INFECTED-TO-POPULATIONS-PLOT -- I add a plot of the number of infected individuals to the Populations Plot.

ADD-RECOVERED-TO-POPULATIONS-PLOT -- I add a plot of the number of recovered individuals to the Populations Plot.

ADD-TOTAL-TO-POPULATIONS-PLOT -- I add a plot of the total number of individuals to the Populations Plot.

ADD-CHANGE-IN-NUMBER-INFECTED-BEHAVIOURS -- I add a collection of behaviours to maintain a record and to plot the changes in the number of people infected.

To control intrinsic parameters:

CREATE-INFECTION-ODDS-SLIDER -- I create a slider for the odds of an infection spreading per encounter.

CREATE-ENCOUNTER-RATE-SLIDER -- I create a slider for the number of encounters per week by infected individuals.

CREATE-ENCOUNTER-FRACTION-SLIDER -- I create a slider for the number of encounters as a fraction of the number of acquaintances.

CREATE-DEATH-RATE-SLIDER -- I create a slider for life expectancy.

CREATE-RATE-OF-RECOVERY-SLIDER -- I create a slider for the duration of an infection.

CREATE-FRACTION-OF-VACCINATIONS-THAT-TAKE -- I create a slider for the odds that a vaccination takes.

CREATE-RATE-OF-LOSS-OF-IMMUNITY-SLIDER -- I create a slider for the duration of a vaccination.

To control policy parameters:

CREATE-FRACTION-VACCINATED-AT-BIRTH-SLIDER -- I create a slider for the proportion vaccinated at birth.

To add all the above at once:

CREATE-SLIDERS-AND-INITIAL-POPULATION -- I do all of the above.

Social Network

The following should be associated with a prototype that isn't copied, e.g. the world or observer.

INITIALISE-SOCIAL-NETWORK-CONSTANT-SYMMETRIC -- Initialises the subset of other agents that I "know" (everyone knows the same number of people). Everyone I know knows me.

INITIALISE-SOCIAL-NETWORK-NORMAL-DISTRIBUTION-SYMMETRIC -- Initialises the subset of other agents that I "know" (the number of people each person knows is normally distributed). Everyone I know knows me.

INITIALISE-SOCIAL-NETWORK-POWER-LAW-DISTRIBUTION-SYMMETRIC -- Initialises the subset of other agents that I "know" (the number of people each person knows follows a power law). Everyone I know knows me.

The following should be associated with the prototype of the population. These are only appropriate when a link from a to b does not entail there should be a corresponding link from b to a.

INITIALISE-SOCIAL-NETWORK-CONSTANT-ASYMMETRIC -- Initialises the subset of other agents that I "know" (everyone knows the same number of people). Not everyone I know knows me.

INITIALISE-SOCIAL-NETWORK-NORMAL-DISTRIBUTION-ASYMMETRIC -- Initialises the subset of other agents that I "know" (the number of people each person knows is normally distributed). Not everyone I know knows me.

REMOVE-SUPER-NODES -- Removes individuals with the greatest number of acquaintances.

CREATE-NUMBER-OF-SUPER-NODES-REMOVED-SLIDER -- Creates a slider to control the number of nodes removed by REMOVE-SUPER-NODES.

To view social networks:

DISPLAY-LINE-TO-EACH-OF-MY-ACQUAINTANCES -- I draw a line to all my acquaintances.

SET-SIZE-PROPORTIONAL-TO-NUMBER-OF-MY-ACQUAINTANCES -- I change my size to reflect the number of individuals in my-acquaintances.

Interventions

VACCINATE-N-RANDOM-INDIVIDUALS -- After a delay I vaccinate some number of susceptible individuals.

VACCINATE-N-RANDOM-SUSCEPTIBLE-ACQUAINTANCES-OF-THE-INFECTED -- After a delay I vaccinate some number of susceptible individuals who have an acquaintance who is infected.

Appearance micro-behaviours

SET-SHAPE -- Sets my appearance to be a fish (easily changed to another shape)

SET-COLOR -- Sets my colour to red (easily changed to other colours)

SET-SIZE -- Sets my size so I appear bigger or smaller

HIDE -- I become invisible

SHOW -- I become visible again

DISPLAY-LINE-OF-INFECTION -- I draw a line between the infector and infectee.

DISPLAY-LINE-TO-EACH-OF-MY-ACQUAINTANCES -- I draw a line to all my acquaintances.

SET-SIZE-PROPORTIONAL-TO-NUMBER-OF-MY-ACQUAINTANCES -- I change my size to reflect the number of individuals in my-acquaintances.

Movement micro-behaviours

MOVE-FORWARD -- I move forward at a speed.

WANDER-RANDOMLY-IN-COMPASS-DIRECTIONS -- I repeatedly move up, down, left, or right one step.

World or Environment

Micro-behaviours for controlling the "world" the individuals "live" in.

SET-WORLD-SIZE -- I set the size of the world

SET-PATCH-SIZE -- I set the size of each patch

SET-WORLD-TO-TORUS -- I set the geometry of the world to a torus (coordinates wrap both horizontally and vertically)

SET-WORLD-TO-PLANE -- I set the geometry of the world to a plane (coordinates do not wrap)

SET-WORLD-TO-PLANE-WITH-CAMERA-FOLLOWING-CENTROID -- I set the geometry of the world to a plane (coordinates do not wrap) but the display of the world is constantly updated so the centre is the average position of all individuals

SET-WORLD-TO-VERTICAL-CYLINDER -- I set the geometry of the world to a vertical cylinder (coordinates wrap only horizontally)

SET-WORLD-TO-HORIZONTAL-CYLINDER -- I set the geometry of the world to a horizontal cylinder (coordinates wrap only vertically)

SET-WORLD-LOCATION -- I set where the display of the world is placed

PAUSE-EVERYTHING-WHEN -- Pauses the simulation when some condition is true

SET-FRAME-DURATION -- Sets the value of frame-duration which controls how often the display is updated.

MAKE-A-MOVIE-OF-A-MODEL -- Records a movie of a model running

Automatically stopping the simulation

PAUSE-EVERYTHING-WHEN-NONE-INFECTED -- I pause the simulation when no one is infected.

PAUSE-WHEN-TIME-EXCEEDS-50 -- I pause the simulation when the time is greater than 50.

NetLogo procedures

To more easily access sub-populations:

REPORT-ALL-LIVING -- I report all the individuals that are alive.

REPORT-ALL-INFECTED -- I report all the individuals that are infected.

REPORT-ENCOUNTER-RATE -- I report the encounter rate.

REPORT-ALL-SUSCEPTIBLES -- I calculate the set of individuals who are susceptible to infection.

REPORT-ALL-SUSCEPTIBLES-WHO-HAVE-AN-INFECTED-ACQUAINTANCE -- I compute the set of individuals who are susceptible to infection who have an acquaintance that is already infected.

Here are some suggestions for exploring vaccination models.