报告行为空间netlogo中所有修补程序中的变量

报告行为空间netlogo中所有修补程序中的变量,netlogo,behaviorspace,Netlogo,Behaviorspace,我在NetLogo中有一个模型,它模拟昆虫(海龟)在植物(斑块)上吃草。每个补丁都有一个称为资源的变量,每当海龟访问它时,它就会耗尽资源。在行为空间中运行模型时,我想报告每个补丁的资源和补丁的坐标 到目前为止,我已经: to-report damageToPatches foreach sort patches [ ask patches [ report resources ]] end 这显然不起作用,这可能很简单,但我正在努力想出一个解决方案。它可能涉及在每个时间步将每个修

我在NetLogo中有一个模型,它模拟昆虫(海龟)在植物(斑块)上吃草。每个补丁都有一个称为资源的变量,每当海龟访问它时,它就会耗尽资源。在行为空间中运行模型时,我想报告每个补丁的资源和补丁的坐标

到目前为止,我已经:

to-report damageToPatches
  foreach sort patches [ ask patches [
    report resources ]]
end 

这显然不起作用,这可能很简单,但我正在努力想出一个解决方案。它可能涉及在每个时间步将每个修补程序的资源值添加到列表中吗

如果我只是对您的代码进行最小的修改以使其可操作,我们会得到:

to-report damage-to-patches
  report [resources] of patches
end
但是你说你也要包括面片坐标,那就是:

to-report damage-to-patches
  report [(list pxcor pycor resources)] of patches
end
但的
以随机顺序给出结果。如果希望列表按从左到右、从上到下的顺序排列,则为:

to-report damage-to-patches
  report map [[(list pxcor pycor resources)] of ?] sort patches
end

如果我只是对您的代码进行最小的修改以使其可操作,我们将得到:

to-report damage-to-patches
  report [resources] of patches
end
但是你说你也要包括面片坐标,那就是:

to-report damage-to-patches
  report [(list pxcor pycor resources)] of patches
end
以随机顺序给出结果。如果希望列表按从左到右、从上到下的顺序排列,则为:

to-report damage-to-patches
  report map [[(list pxcor pycor resources)] of ?] sort patches
end

谢谢,这帮了大忙!对不起,这是新的谢谢,帮了大忙!对不起,这是新来的