我试图计算 netlogo 中受感染海龟的累积平均值我不知道我应该使用什么代码以及将它放在 netlogo 代码中的什么位置我做了一些测试并尝试计算节点的平均值,但那是不正确的。我也尝试创建一个列表,但我也没有成功。我应该在代码中的哪个位置放置这些行?
这里有一些代码:
observer> show mean [num-infected] of turtles
observer: 198
observer> show mean [num-infected] of turtles / length num-infected
observer> show mean [num-infected] of turtles / length [num-infected] of turtles
observer: 0.99
observer> show sum [num-infected] of turtles / length [num-infected] of turtles
observer: 197
observer> show count [num-infected] of turtles / length [num-infected] of turtles
observer> show mean [num-infected] of turtles / length [num-infected] of turtles
observer: 0.955
observer> show sum [num-infected] of turtles / length [num-infected] of turtles
observer: 191
observer> show sum [mean num-infected] of turtles
observer> show mean [ num-infected] of turtles
observer: 191
observer> show mean [ num-infected] of turtles
observer: 1
observer> show mean [ num-infected] of turtles
observer: 198
observer> show mean [ num-infected] of turtles
observer: 198
observer> show mean [ num-infected] of turtles
observer: 198
observer> show [ num-infected] of turtles
observer> show count turtles with [infected? = true]
observer: 198
observer> show count turtles with [infected? = true] / length [num-infected] of turtles
observer: 0.99
observer> show count num-infected / count turtles with [infected? = true]
ERROR: Expected an agentset here, rather than a list or block.
谢谢。