我有一个模型,其中每个代理都有一个到所有其他代理的无定向链接。我想要做的是,当两个代理共享相同的补丁时,增加一个计数,存储在每个链接中。换句话说,就是保持社交互动的记录。谢谢你的帮助。
发布于 2013-11-18 21:13:19
假设:
links-own [counter]下面是我能想到的最短的解决方案:
ask links [
if [patch-here] of end1 = [patch-here] of end2 [
set counter counter + 1
]
]另一种方法是:
ask turtles [
ask turtles-here with [self > myself] [
ask link-with myself [
set counter counter + 1
]
]
]https://stackoverflow.com/questions/20034486
复制相似问题