01 January 1970 1 7K Report

I have a set of positive COVID-19 cases by district in a state. I want to use agent based modelling to make the infected cases move around the state and count the number of infected, number of healthy and number of immune. I have a set of code which the number of population is random and not based on the location. Tried to watch youtube for the tutorial but could not find one which really helps. the code is as below. I want to insert the map of the state, number of population for each district and number of infected in Netlogo.

urtles-own [illness]

to setup

clear-all

reset-ticks

create-turtles 200 [

setxy random-xcor random-ycor

set shape "person"

set color pink

set size 1.0

set illness 0

]

ask n-of starting-number-infected turtles [

set color yellow

set shape "X"

set size 1.0

]

end

to go

tick

move

infect

recover

lose-immunity

end

to move

ask turtles [

rt random 360

fd movement

]

end

to infect

ask turtles [

if color = yellow [

ask turtles in-radius infect-distance [

if random-float 200 < infect-chance [

if color = pink [

set color yellow

set shape "X"

]

]

]

]

]

end

to recover

ask turtles [

if color = yellow [

set illness illness + 1

if illness > infectious-period [

set color white

set shape "circle"

set size 1.0

set illness 0

]

]

]

end

to lose-immunity

ask turtles [

if color = white and waning-immunity < random-float 100 [

set color pink

set shape "person"

]

]

end

More Sarah Isnan's questions See All
Similar questions and discussions