netlogo - Netlogo中病毒传播过程中将“自我”从易感染者更改为错误
问题描述
我正在尝试改变我的病毒模型中 Covid-19 传播的传播程序,以便受感染的海龟会调用该程序并感染易感海龟,而不是易感海龟寻找受感染的海龟。
我之前的代码如下所示:
to transmit; procedure for transmitting the desease to nearby people, inspired by epiDEM
let caller self ; adress the susceptible turtle by the name caller
if susceptible? = TRUE
[
let nearby-infected turtles-here with [infected? = TRUE] ;replaced turtles in-radius with turtles-here to make the radius as small as possible
if nearby-infected != nobody
[ ask nearby-infected [set c-count c-count + 1 set p-count p-count + [age-susceptibility] of caller]
let transmission-risk 0.1 * age-susceptibility ;would benefit from inclusion of protective-measures, right now 0.1 times ag-susc as the radius might be too big resulting ín too fast spread
if random-float 1 < transmission-risk [
set infected? TRUE set susceptible? FALSE
set nb-infected (nb-infected + 1)]
]
]
end
我当前的代码如下所示:
to transmit
if infected? = true
[
let caller self ; adress infectious turtle by name caller
let nearby-susceptible turtles-here with [susceptible? = TRUE] ;replaced turtles in-radius with turtles-here to make the radius as small as possible
if nearby-susceptible != nobody
[
set c-count c-count + count nearby-susceptible
set p-count p-count + sum [age-susceptibility] of nearby-susceptible
ask nearby-susceptible
[
let transmission-risk 0.1 * age-susceptibility ;would benefit from inclusion of protective-measures, right now 0.1 times ag-susc as the radius might be too big resulting ín too fast spread
if random-float 1 < transmission-risk [
set infected? TRUE set susceptible? FALSE
ask caller [set nb-infected (nb-infected + 1)]
]]
]]
end
奇怪的是,后一种程序的感染率几乎没有那么高,在前一种程序中,病毒传播得非常快,但在这个新代码中,它的传播率非常低。
我不确定代码有什么问题,是不是当我要求附近的易感人群设置传播率和感染状态时,它会为所有这些人设置一次而不是单独计算?
当模型使用我之前的代码运行时,c-count、p-count 和尤其是 nb 感染的数字也高得多(nb-infected 在与早期代码的同一时间步长上高出 20 倍以上)
直觉上,我认为当对每只受感染的乌龟重复该过程时,所有数字都应该更高,而不是易感乌龟只调用一次该过程,无论半径内有多少受感染的乌龟。
将不胜感激任何帮助!
解决方案
推荐阅读
- php - 带有语言环境的 laravel 功能测试
- c - 使用 Visual Studio 2019 中的 microsoft cl.exe 具有 64 位目标的 sigset_t
- javascript - 函数声明参数Javascript中的方括号和空格
- jquery - 如何在 Razor 页面中获取 jquery 返回值到模型对象的属性
- html - 如何根据浏览器仅预加载所需的类型(woff vs woff2)?
- python - How to extract C code portion using regex in python
- python - 如何将 form_class 数据传递到在 Django 中创建的模型对象中?
- docker - 无法连接到使用 docker 创建的 redis 实例
- sql - Oracle SQL - 仅在下个月 1 日之前最后一次阅读
- ios - 在元组数组中查找最长长度的字符串