Netlogo 更新SIR模型中的出生率和死亡率
我想使用NetLogo软件,使用基于代理的模型来模拟疾病的传播。Netlogo 更新SIR模型中的出生率和死亡率,netlogo,Netlogo,我想使用NetLogo软件,使用基于代理的模型来模拟疾病的传播。 如何更新SIR模型中的出生率和死亡率。作为起点,您可以尝试 这有一种方法可以调整不同群体的生育能力 to reproduce ask turtles [ ifelse color = red [ set fertility floor red-fertility set fertility-remainder red-fertility - (floor red-fertility)
如何更新SIR模型中的出生率和死亡率。作为起点,您可以尝试 这有一种方法可以调整不同群体的生育能力
to reproduce
ask turtles
[
ifelse color = red
[
set fertility floor red-fertility
set fertility-remainder red-fertility - (floor red-fertility)
]
[
set fertility floor blue-fertility
set fertility-remainder blue-fertility - (floor blue-fertility)
]
ifelse (random-float 100) < (100 * fertility-remainder)
[ hatch fertility + 1 [ wander ]]
[ hatch fertility [ wander ]]
]
end
红色变成绿色
ifelse color = red
[
if (random-float 100) < (nu * red-count ) / 10000
[set color green]
]
ifelse color = red
[
if (random-float 100) < (nu * red-count ) / 10000
[set color green]
]
globals
[
red-count ; population of red turtles
blue-count ; population of blue turtles
green-count ; population of green turtles
]
turtles-own
[
]
to setup
clear-output
setup-experiment
end
to setup-experiment
cp ct
clear-all-plots
reset-ticks
crt carrying-capacity
[
setxy random-xcor random-ycor ; randomize turtle locations
ifelse who < (carrying-capacity / 10) ; start out with equal numbers of reds and blues
[ set color red ]
[
ifelse who < (2 * carrying-capacity / 10) ; start out with equal numbers of reds and blues
[ set color green ]
[ set color blue ]
]
set size 2 ; easier to see
]
reset-ticks
end
to go
reproduce
tick
end
to reproduce
ask turtles
[
ifelse color = blue
[
if (random-float 100) < (beta * red-count * blue-count ) / 1000000
[set color red]
]
[
ifelse color = red
[
if (random-float 100) < (nu * red-count ) / 10000
[set color green]
]
[
]
]
]
end