Cholera Simulation

Cholera Simulation preview image

1 collaborator

Default-person Jesse PANTIN (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.4 • Viewed 189 times • Downloaded 12 times • Run 0 times
Download the 'Cholera Simulation' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

patches-own [infected?]
turtles-own [cholera gender age]

to setup
  ca
  reset-ticks
  setup-patches
  setup-turtles
  colors
end 

to go
  colors
  infect-water
  infect-people
  birth
  ask turtles [
    wiggle
    set age (age + 1) ; their age is in weeks
    if (age > 3910) [die] ; since ticks are weeks and 3910 are the average weeks a person lives in their life, they will die after 3910 weeks
  ]
  tick
  if (count turtles > 5000 or count turtles < 1) [stop]
end 

to wiggle ; moving of the people
  fd 1
  lt random 61 - 30
end 

to infect-water ; determines whether or not the water is infected
  ask patches with [infected? = 0] [ ; infecting water
    if (any? turtles-here with [cholera = 1]) [set infected? 1]
  ]
  ask patches with [infected? = 1] [
    if (random 100 < Disinfect) [set infected? 0] ; disinfecting water
  ]
end 

to infect-people ; determines whether or not someone is infected
  ask turtles with [cholera = 0] [
    if (pcolor = violet) [
      set cholera 1 ; infecting people from water
    ]
    if (any? turtles-here with [cholera = 1]) [set cholera 1] ; infecting people from other people
  ]
    ask turtles with [cholera = 1] [ ; rate of survival, death or continuing with the disease
      if (random 100 < 10) [die]
    if (random 100 < 10) [set cholera 0]
    ]
end 

to colors ; shows who and which patches are infected
  ask patches [
    if (infected? = 1) [set pcolor violet]
    if (infected? = 0) [set pcolor blue]
    if (infected? = -1) [set pcolor black]
  ]
  ask turtles [
    if (cholera = 1) [set color red]
    if (cholera = 0) [set color green]
    if (cholera = -1) [set color grey]
  ]
end 

to birth ; reproducing population
  ask turtles with [gender = 1] [
    if (any? turtles-here with [gender = -1] and random 100 >= 90) [hatch 1
      [set cholera 0
       set age 0
        ifelse (random 2 = 0) [set gender 1] [set gender -1]
      ]
    ]
  ]
end 

to setup-patches
    ask patches [set infected? -1]
  ask patches with [pxcor > -5 and pxcor < 5 and pycor > -5 and pycor < 5]
  [set infected? 0] ; creates water
end 

to setup-turtles
  ask turtles [set gender 0]
  set-default-shape turtles "person"
  crt 100 [ ; creates people
    setxy random-xcor random-ycor
    set age random 3910
    set cholera 0
  ]
  ask turtles ; creates vaccinated and infected people
  [if (random 100 < numVaccinated) [set cholera -1]
    if (cholera = 0 and random 100 < numInfected) [set cholera 1]
  ]
  ask n-of 50 turtles [set gender 1] ; creating genders
  ask turtles with [gender = 0] [set gender -1]
end 

There is only one version of this model, created about 5 years ago by Jesse PANTIN.

Attached files

File Type Description Last updated
Cholera Simulation.png preview Preview for 'Cholera Simulation' about 5 years ago, by Jesse PANTIN Download

This model does not have any ancestors.

This model does not have any descendants.