预期输入为列表 - NetLogo 中的 Foreach 错误
Expected Input to be a List - Errors with Foreach in NetLogo
我正在尝试使用 Foreach 命令迭代代理集。我要求每只乌龟将变量的值设置为某个值。但是,我尝试了很多语法。我得到的最接近的是:
Set all-turtles (turtle-set turtles)
foreach all-turtles [set infoneed one-of infotypes]
但是,我不断收到以下错误:"FOREACH expected input to be a list but got the agentset (agentset, 81 turtles) instead."
我该如何解决这个问题?
谢谢,
布兰登
Windows 10//NetLogo 6.0.2
ask turtles [set infoneed one-of infotypes]
我正在尝试使用 Foreach 命令迭代代理集。我要求每只乌龟将变量的值设置为某个值。但是,我尝试了很多语法。我得到的最接近的是:
Set all-turtles (turtle-set turtles)
foreach all-turtles [set infoneed one-of infotypes]
但是,我不断收到以下错误:"FOREACH expected input to be a list but got the agentset (agentset, 81 turtles) instead."
我该如何解决这个问题?
谢谢,
布兰登
Windows 10//NetLogo 6.0.2
ask turtles [set infoneed one-of infotypes]