Netlogo中的分隔度

问题描述 投票:0回答:1

我想知道如何计算网络内节点之间的分隔程度。我创建了一个具有两个可以随时间传播病毒的品种的网络。

to setup
create-people_inf 5 [set label "Infected"]
create-people_well 20 [set label "Good health"]
end

然后,我将新节点添加到现有节点中,如下所示:

  ask people_inf
  [ create-links-to other people_inf
    [set color red ]
    let this_turtle self
    ask people_well
    [
     if random-float 1 < 0.5
     [
        create-link-to this_turtle [set color green]
    ]
    ]
  ]

这只是默认网络。我的问题是如何计算一个选定节点与另一个随机选定节点之间的分离度。我曾考虑添加一个标记并考虑一个逻辑条件(if connected?=true),但是我不知道考虑它们之间的节点。我的方法只会给我一个节点及其定向连接的信息。

任何建议都值得欢迎。谢谢。

netlogo
1个回答
0
投票

您需要使用网络(nw)扩展名,请参阅https://ccl.northwestern.edu/netlogo/docs/nw.html中的文档。由此,您可以使用nw:distance-to来查找任何乌龟的跳数

© www.soinside.com 2019 - 2024. All rights reserved.