首页 > 解决方案 > 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 倍以上)

直觉上,我认为当对每只受感染的乌龟重复该过程时,所有数字都应该更高,而不是易感乌龟只调用一次该过程,无论半径内有多少受感染的乌龟。

将不胜感激任何帮助!

标签: netlogovirusagent-based-modeling

解决方案


推荐阅读