CoVid19-abm

CoVid19-abm preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 244 times • Downloaded 32 times • Run 0 times
Download the 'CoVid19-abm' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

globals[]
turtles-own[edad is-healthy? is-sick? ti tc is_symptomatic?]
breed[personas persona ]

to setup
  clear-all
  setup-personas
  setup-patches
  reset-ticks
end 

to setup-patches
   ask patches [let k count personas-here set pcolor cyan + 0.1 * k]
end 

to setup-personas
  create-personas N [set xcor random-poisson random 40 set ycor random-poisson random 40  ]
  create-personas N [set xcor -40 - random-poisson random 40 set ycor -40 - random-poisson  random  40 ]
  create-personas N [set xcor -40 - random-poisson random 40 set ycor random-poisson random 40 ]
  create-personas N [set xcor  random-poisson random 40 set ycor -40 - random-poisson  random  40 ]
  ask personas[set shape "person" set color green set edad random-poisson 36 set tc precision (36 + random-float 3) 2 set is-sick? false set is-healthy? true set is_symptomatic? false  set ti 0]
  ask up-to-n-of (0.1 * N) personas [set is-sick? true set is-healthy? false  set ti ti + 1 ifelse random 100 <= 8 [set is_symptomatic? true set color red][set is_symptomatic? false set color pink]]
end 

to go
  ask personas [
    move
    if is-sick?[infect set ti ti + 1  muere clear-out]
    colorear-personas
   ]

  ask patches [colorear-parche]
  tick
end 

to move
  ifelse quarantine [ifelse strategy = 1 [ifelse is-sick? and is_symptomatic? [ ][rt random 180 lt random 180 fd random-gamma 80 80]]
    [ifelse strategy = 2 [ask n-of (0.3 * ( count personas )) personas [stop]][rt random 180 lt random 180 fd random-gamma 80 80]]]
    ;[if strategy = 3 []]]
  [rt random 180 lt random 180 fd random-gamma 80 80]
;  rt random 180 lt random 180 fd random-gamma 80 80
end 

to colorear-personas
  ifelse is-healthy? [set color green][ ifelse is-sick? [ifelse is_symptomatic? [set color red][set color pink]][set color black]]
end 

to colorear-parche
  let k count personas-here set pcolor pcolor + 0.1 * k
end 

to infect
  let s count personas-on neighbors
  ask up-to-n-of 2.5  personas-on neighbors [if random 100 < 25 [set is-sick? true set is-healthy? false set ti ti + 1]]
end 

to show_symptoms
  if ti >= 3 [ifelse random 100 < 20 [set is_symptomatic? true set tc 38 + random-float 1][set is_symptomatic? false] ]
end 

to clear-out
  if ti >= 20 and random 100 <= 80[set is-healthy? false set is-sick? false set ti 0]
end 

to muere
  if ti > 15 and random 100 <= 1 [die]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Augusto Cabrera-Becerril over 4 years ago Version 0.1 social restriction strategies Download this version
Augusto Cabrera-Becerril over 4 years ago V0.0 Download this version
Augusto Cabrera-Becerril over 4 years ago Initial upload Download this version

Attached files

File Type Description Last updated
CoVid19-abm.png preview Preview for 'CoVid19-abm' over 4 years ago, by Augusto Cabrera-Becerril Download

This model does not have any ancestors.

Children:

Graph of models related to 'CoVid19-abm'