netlogo中的海龟数

问题描述 投票:2回答:1

我想使用下面的代码在Netlogo中创建一个按钮,但是计数问题在观察者0中显示为0,而在观察者中应该为10,为什么知道?

    breed [ planets planet ] 

planets-own [ distance-to-earth diameter heading ] 


to create_planets
 ca 
  ask n-of 10 patches [ sprout 1 ]
  show count planets
end
netlogo
1个回答
2
投票

[您告诉sprout的补丁,但您不想让行星成为发芽的海龟品种。这将创建通用的乌龟。尝试使用sprout-planets

© www.soinside.com 2019 - 2024. All rights reserved.