为什么海龟的mean [nw:clustering-coefficient]显示为零?



我设置了以下网络:

extensions [nw]
breed [agents agent]
agents-own [status         

]
to setup
clear-all
ask patches [
set pcolor white
]
nw:generate-preferential-attachment agents links 100 1 [  set shape "person"

setxy random-xcor random-ycor
set status random 2
ifelse status = 0 [set status -1][set status 1]
ifelse status = 1 [set color green] [set color red] ]

display
output-print nw:mean-path-length
output-print mean [ nw:clustering-coefficient ] of agents
output-print mean [nw:betweenness-centrality ] of agents
output-print mean [ count my-links ] of agents
output-print count links
reset-ticks
end

聚类系数的平均值总是显示为零(其他报告显示的数字有意义)。如果我试着画一只海龟的c-c,我也得到0。在建立网络时,我是否需要使用链接品种而不仅仅是"链接"?我试着用一个非定向链接品种运行这个,没有什么不同。

我错过了什么吗?c-c应该是>0,对吧?

凯文

我不太熟悉网络,所以我可能在这里错了。聚类系数衡量的是有多少链路邻居也是彼此的链路邻居。然而,您构建网络的方式(带有单个链接的优先连接)根本不会生成一个邻居之间永远是邻居的网络,因此每只海龟的聚类系数为0。例如,nw:generate-preferential-attachment agents links 100 2确实会生成一些实例其中你会得到三只海龟彼此连接在一起所以这里你会得到更高的聚类系数

最新更新