Covid_19_Intervention_Timing_Effects
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
globals [ lista %_infected %_recovered activated] turtles-own [ marker mover] to setup ca set lista [] ask patches [ set pcolor white] ask patches with [ pycor = -50] [ set pcolor black] ask patches with [ pycor = -49] [ set pcolor black] ask patches with [ pycor = 50] [ set pcolor black] ask patches with [ pycor = 49] [ set pcolor black] ask patches with [ pxcor = -80] [ set pcolor black] ask patches with [ pxcor = -79] [ set pcolor black] ask patches with [ pxcor = 79] [ set pcolor black] ask patches with [ pxcor = 80] [ set pcolor black] ask n-of Population patches with [ pcolor = white ] [ sprout 1 [ set shape "circle" set color blue fd 0.5]] ask one-of turtles [ set color red set marker Recovery_time] ask turtles [ set mover 1] ; all can move set activated 1 reset-ticks end to go if (ticks = 500) [ stop ] move2 spread_virus updatemaker %_infec which_action tick end to which_action if (intervention = "nothing" ) [] if (intervention = "focalized_quarantine_hard" ) [if (%_infected > Intervention_Timing and activated = 1) [ intervene_quarantine_hard] ] if (intervention = "focalized_quarantine_soft" ) [if (%_infected > Intervention_Timing and activated = 1) [ intervene_quarantine_soft] ] if (intervention = "social_distance_hard" ) [if (%_infected > Intervention_Timing and activated = 1) [social_distance_hard] ] if (intervention = "social_distance_soft" ) [if (%_infected > Intervention_Timing and activated = 1) [social_distance_soft] ] if (intervention = "close_borders_soft" ) [if (%_infected > Intervention_Timing and activated = 1) [close_b_soft] ] if (intervention = "close_borders_hard" ) [if (%_infected > Intervention_Timing and activated = 1) [close_b_hard] ] end to %_infec set %_infected ((count turtles with [ color = red]) / (count turtles)) * 100 set %_recovered ((count turtles with [ color = green]) / (count turtles)) * 100 end to updatemaker ask turtles with [ color = red ] [ set marker marker - 1 ] ask turtles with [ ( color = red OR color = yellow ) and marker < 0 ] [ set color green ] end to spread_virus ask turtles with [ (color = red OR color = yellow) and marker > 0] [ if any? other turtles-here [ let otro one-of turtles-here let colorotro [color] of otro ifelse (colorotro = green) [ ] [ let dado random-float 1 ifelse(dado < Probability_of_being_asymptomatic) [ ask otro [ set color yellow set marker Recovery_time] ] [ ask otro [ set color red set marker Recovery_time] ] ] ] ] end to move2 ask turtles with [mover = 1] [ let patcha [pcolor] of patch-ahead 1 ifelse (patcha = black) [ set heading heading + random 360 ] [ fd 1 ] ] end to intervene_quarantine_hard let aa (count (turtles-on patches with [ pxcor > 0 and pycor > 0 ]) with [ color = red ]) set lista lput aa lista let bb (count (turtles-on patches with [ pxcor < 0 and pycor > 0 ]) with [ color = red ]) set lista lput bb lista let cc (count (turtles-on patches with [ pxcor < 0 and pycor < 0 ]) with [ color = red ]) set lista lput cc lista let dd (count (turtles-on patches with [ pxcor > 0 and pycor < 0 ]) with [ color = red ]) set lista lput dd lista let maximo max lista let posicion position maximo lista ;print posicion if (posicion = 0) [ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 1) [ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 2) [ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 3) [ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ]] set activated 0 end to intervene_quarantine_soft let aa (count (turtles-on patches with [ pxcor > 0 and pycor > 0 ]) with [ color = red ]) set lista lput aa lista let bb (count (turtles-on patches with [ pxcor < 0 and pycor > 0 ]) with [ color = red ]) set lista lput bb lista let cc (count (turtles-on patches with [ pxcor < 0 and pycor < 0 ]) with [ color = red ]) set lista lput cc lista let dd (count (turtles-on patches with [ pxcor > 0 and pycor < 0 ]) with [ color = red ]) set lista lput dd lista let maximo max lista let posicion position maximo lista if (posicion = 0) [ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 0) [ask n-of 3 patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor white ]] if (posicion = 1) [ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 1) [ask n-of 3 patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor white ]] if (posicion = 2) [ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 2) [ask n-of 3 patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor white ]] if (posicion = 3) [ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ]] if (posicion = 3) [ask n-of 3 patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor white ]] set activated 0 end to social_distance_hard ask n-of ((95 * Population) / 100 ) turtles [ set mover 0 ] set activated 0 end to social_distance_soft ask n-of ((80 * Population) / 100 ) turtles [ set mover 0 ] set activated 0 end to close_b_hard ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ] ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ] ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ] ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ] set activated 0 end to close_b_soft ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ] ask n-of 3 patches with [ (pxcor >= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor white ] ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor black ] ask n-of 3 patches with [ (pxcor <= 0 and pycor = 0) OR (pycor > 0 and pxcor = 0) ] [ set pcolor white ] ask patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ] ask n-of 3 patches with [ (pxcor <= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor white ] ask patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor black ] ask n-of 3 patches with [ (pxcor >= 0 and pycor = 0) OR (pycor < 0 and pxcor = 0) ] [ set pcolor white ] set activated 0 end
There is only one version of this model, created over 5 years ago by Eduardo Tapia.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Covid_19_Intervention_Timing_Effects.png | preview | Preview for 'Covid_19_Intervention_Timing_Effects' | over 5 years ago, by Eduardo Tapia | Download |
This model does not have any ancestors.
This model does not have any descendants.