在 netlogo 中数海龟

Count turtles in netlogo

我想用下面的代码在 Netlogo 中制作一个按钮,但是计数问题在观察者中显示为 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

您告诉 sprout 补丁,但并不是说您希望行星成为发芽的海龟品种。这将创建通用海龟。请尝试 sprout-planets