Child of CoVid19-abm

No preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Child of model CoVid19-abm preview imageCoVid19-abm
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 224 times • Downloaded 16 times • Run 0 times
Download the 'Child of 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 [ fd 0]][if strategy = 3 [ask n-of (0.8 * (count personas)) personas [fd 0] ]]]
  ]
  [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 is only one version of this model, created over 4 years ago by Augusto Cabrera-Becerril.

Attached files

No files

Parent: CoVid19-abm

This model does not have any descendants.

Graph of models related to 'Child of CoVid19-abm'