我正在尝试生成一个小世界类型的网络(https://en.wikipedia.org/wiki/Small-world_network https://en.wikipedia.org/wiki/Small-world_network)在我创建的 Netlogo 模型中自始至终模型本身;人们在模型运行时会相互了解。
我知道如何在 Netlogo 中生成小世界模型setup。但是如何生成一个小世界网络在旅途中?
我在设置过程中生成小世界的代码如下。
breed [interlinks interlink] ;links between different breeds
breed [intralinks intralink] ; links between same breeds
to set_sw_network
ask turtles[
let max-who 1 + max [who] of turtles
let sorted sort ([who] of turtles)
foreach sorted [ x ->
ask turtle x [
let i 1
repeat same_degree + dif_degree [
ifelse [breed] of self = [breed] of turtle (( x + i ) mod max-who)
[create-intralink-with turtle (( x + i ) mod max-who)]
[create-interlink-with turtle (( x + i) mod max-who)]
set i i + 1
]
]
]
repeat round (rewire_prop * number_of_members) [ ;rewire_prop is a slider 0 - 1 with steps of 0.1
ask one-of turtles [
ask one-of my-links [die]
create-intralink-with one-of other turtles with [link-with self = nobody]
]
]
]
end
但是,我一开始就对创造一个小世界不感兴趣。我有兴趣在整个模型中创建一个具有小世界属性的网络。目前,我的模型中确实有这个 on the go create-link 功能,但我不知道如何调整它,因此它会产生一个小世界类型的网络:
to select_interaction:
ommitted code: sorts pre-existing links and interacts with them
if count my-links < my_degree
[
repeat number_of_interactions_per_meeting
[
let a select_turtle ;delivers a turtle with link to self = nobody
if a != nobody
[
ifelse [breed] of a = [breed] of myself
[
create-intralink-with a
[
set color cyan
interact
]
]
[
create-interlink-with a
[
set color orange + 2
interact
]
]
]
]
]
end
目前,我的策略是为每只海龟提供一个基于给定社交网络的分布的 my_ Degree 变量。但问题仍然存在,如果这是一个好的策略,那么小世界网络的正确分布是什么?
该策略的伪代码:
to setup-turtles
If preferential attachment: set my_degree random-poisson 'mean'
If small world: set my_degree ????? 'mean'
end
任何见解都会很棒。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)