Netlogo-计算每只乌龟的海龟数量
我有一个遵循SEI动力学的疾病模型(易感性暴露感染)。我想计算我模型中每只乌龟的乌龟数量(总共有16只乌龟,每个乌龟都有一个柜台)。我还希望它一旦乌龟再次变得容易重置每只乌龟(该模型中没有死亡或免疫力,因此一旦乌龟恢复,它们再次变得容易受到敏感)。我的代码中有一个乌龟拥有的变量,称为感染 - 爆炸,但这似乎产生了成功的传输事件的数量,而不是每只乌龟感染的乌龟数量。我该怎么做?
这是我的病程序:
to spread
let prob random-float 1.0
ask turtles [
ifelse infected? [] [
if any? other turtles in-radius 1 with [ infected? ] and prob <= transmission-probability
[ become-latent
set latent-period-length random-exponential average-latent-period * ticks-per-day
set latent-period-time 0
set infection-counter infection-counter + 1
]
]
]
ask turtles [
if latent-period-time > latent-period-length ;if latent period counter is greater than exponentially derived latent period with avg of 30 days, become infected
[
become-infected
set infectious-period-length random-exponential average-infectious-period * ticks-per-day
set infectious-period-time 0
set latent-period-time 0
]
]
ask turtles [
if infectious-period-time > infectious-period-length ;infectious-period is a slider variable set to 100
[
become-susceptible
set infectious-period-time 0
set infection-counter 0
]
]
ask turtles [
if latent?
[
set latent-period-time latent-period-time + 1 ]
if infected?
[
set infectious-period-time infectious-period-time + 1]
]
end
谢谢!
I have a disease model that follows SEI dynamics (Susceptible-Exposed-Infected). I would like to count the number of turtles each turtle infects in my model (16 turtles in total with a counter for each). I would also like it to reset for each turtle once the turtle becomes susceptible again (there is no death or immunity in this model so once turtles recover they become susceptible again). I have a turtle-owned variable called infection-counter in my code, but this seems to produce the number of successful transmission events rather than the number of turtles each turtle infects. How would I go about this?
Here is my disease procedure:
to spread
let prob random-float 1.0
ask turtles [
ifelse infected? [] [
if any? other turtles in-radius 1 with [ infected? ] and prob <= transmission-probability
[ become-latent
set latent-period-length random-exponential average-latent-period * ticks-per-day
set latent-period-time 0
set infection-counter infection-counter + 1
]
]
]
ask turtles [
if latent-period-time > latent-period-length ;if latent period counter is greater than exponentially derived latent period with avg of 30 days, become infected
[
become-infected
set infectious-period-length random-exponential average-infectious-period * ticks-per-day
set infectious-period-time 0
set latent-period-time 0
]
]
ask turtles [
if infectious-period-time > infectious-period-length ;infectious-period is a slider variable set to 100
[
become-susceptible
set infectious-period-time 0
set infection-counter 0
]
]
ask turtles [
if latent?
[
set latent-period-time latent-period-time + 1 ]
if infected?
[
set infectious-period-time infectious-period-time + 1]
]
end
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论