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-infected 的数字也更高(nb-infected 在使用早期代码的同一时间步高 20 倍以上)

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

非常感谢您的帮助!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)