【发布时间】:2016-07-07 13:47:17
【问题描述】:
我很难找到解决这个问题的方法...我让海龟创建了一个社交网络(我使用无向链接)。
代理有很多变量,其中“y”和“ro”。我想知道的是与 [y
在实践中......在以下公式中
mean [ro] of turtles with [link-neighbor? turtle n]
我想代替turtle n 一个代理集turtles with [y < 1]...有什么办法吗?
谢谢!
【问题讨论】:
我很难找到解决这个问题的方法...我让海龟创建了一个社交网络(我使用无向链接)。
代理有很多变量,其中“y”和“ro”。我想知道的是与 [y
在实践中......在以下公式中
mean [ro] of turtles with [link-neighbor? turtle n]
我想代替turtle n 一个代理集turtles with [y < 1]...有什么办法吗?
谢谢!
【问题讨论】:
turtles-own [y ro]
to test
ca
crt 50 [
set y random-float 2
set ro one-of [1 2]
]
ask turtles [
create-links-with n-of 5 other turtles
]
show mean [ro] of (turtles with [has-poor-neighbor])
end
to-report has-poor-neighbor ;turtle proc
report any? link-neighbors with [y < 1]
end
【讨论】: