【发布时间】:2016-01-07 13:06:38
【问题描述】:
在我建立创新扩散模型期间,我在 NetLogo 中遇到了另一个小的编程问题。我想模拟人们更有可能向相似的人学习。因此模型考虑了分配给每个智能体的能力值:
[set ability random 20 ]
然后,在围棋程序中,我希望他们将自己的能力值与关联邻居的值进行比较。 例如:乌龟1的能力= 5,邻居1的能力= 10,邻居2的能力= 4。因此(绝对)差异为[ 5, 1]。因此,他从邻居 2 那里学到的东西比从邻居 1 那里学到的更多。
但我不知道如何解决向每个邻居询问差异的问题。作为第一个想法,我想通过像 [difference1, ..., difference(n)] 这样的列表变量来实现。
到目前为止,我只得到了一种使用平均值的聚合方法,但这与最近的社会学习理论并不完全一致,并且可能会覆盖代理有许多不同邻居但与他非常相似的情况:
ask turtles
[
set ability random 20
set ability-of-neighbor (sum [ability] of link-neighbors / count link-neighbors)
set neighbor-coefficient (abs (ability - ability-of-neighbor))
;;the smaller the coefficient the more similar are the neighbors and the more the turtle learns from his neighbor(s)
]
再次感谢您的帮助和建议,我非常感谢任何 cmets。
亲切的问候,
莫里茨
【问题讨论】:
标签: social-networking netlogo agent-based-modeling