如何在“过程调用”海龟的半径中处理其他海龟的属性以及它们在那里停留的时间?在网络标志中

问题描述

我正在 Netlogo 中构建模型,在其中模拟病毒的传播。我查看了其他病毒模型,但到目前为止还没有找到解决我的问题的方法

我希望每个代理交互具有特定的传播概率,基于易感代理的易感性(代理属性)、受感染代理(可以是多个)传播病毒的概率(代理属性),以及因为在附近度过的时间。基本上 P(被感染)= 传染性 * 接近时间 * 易感性。因此,对于易感海龟接近受感染海龟的每一次蜱,被感染的概率应该会增加。到目前为止,我仅在创建以易感代理作为调用者的过程时使用了易感性。

到目前为止,这是我为此过程的代码

to transmit; procedure for transmitting the disease to nearby people,inspired by epiDEM
  let caller self ; adress the susceptible turtle by the name caller
  if susceptible? = TRUE
  [
  let nearby-infected turtles in-radius 2 with [infected? = TRUE]
  if nearby-infected != nobody
    [      
      let transmission-risk age-susceptibility ;here I want to include protective-measures (attribute of the possibly several infected turtles) and time-exposed
    if random-float 1 < transmission-risk[
      set infected? TRUE set susceptible? FALSE]
    ]
  ]
end

我真的很难解决这个问题,我不确定如何解决半径内海龟的属性以及如何测量曝光时间。我正在考虑创建将暴露时间作为属性链接,当感染者不再在半径内时,该链接就会死亡。但是我不确定当海龟彼此之间的距离超过 2 个补丁半径时如何让链接死亡。此外,我不希望使用链接来保持模型运行得更快,所以如果有其他解决方案,我会很高兴听到它:)

对于带有链接的选项,我想尝试这样的操作:

to transmit; procedure for transmitting the disease to nearby people
ifelse link-neighbors (in-radius 2 = FALSE)
[ask link [die]]
[set link-age link-age + 1]
  
  let caller self ; adress the susceptible turtle by the name caller
  if susceptible? = TRUE
  [
  let nearby-infected turtles in-radius 2 with [infected? = TRUE]
  if nearby-infected != nobody
    [create-links-with nearby-infected
      let transmission-risk age-susceptibility ;include protective-measures and time-exposed using links to address the turtles
      if random-float 1 < transmission-risk[
      set infected? TRUE set susceptible? FALSE]
    ] 
  ]

但是,对于初学者来说,我只是不明白如何解决更远的海龟链接以要求它们死,我在收到错误消息后对其进行了更改,但似乎无法解决工作。

甚至可以在 Netlogo 中做我想做的事吗?

非常感谢您的任何提示

解决方法

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

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

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