gpt4 book ai didi

netlogo - 如何使一个补丁中的两只海龟都可见?

转载 作者:行者123 更新时间:2023-12-04 23:00:19 24 4
gpt4 key购买 nike

我有两只乌龟——卖家和买家在一块,它们的形状"face happy" .
但是在我运行安装程序时的界面上,如果一个补丁中有两只海龟,我只能看到其中的一只。
我的问题是,我该如何编码才能看到它们。如果它不可能至少在某些补丁中看到另一个代理中的一个代理。

这是我的代码:

ask sellers
[move-to one-of patches with [not any? turtles-here]]

ask buyers
[move-to one-of patches with [not any? buyers-here]]
ask buyers [if any? sellers-here [set shape "face happy"]]
ask buyers [if not any? sellers-here [set shape "face sad"]]
ask buyers [if any? sellers-here [set color 67]]
ask sellers [if any? buyers-here [set shape "face happy"]]
ask sellers [if not any? buyers-here [set shape "face sad"]]
ask sellers [if any? buyers-here [set color 137]]

最佳答案

假设在瓦片中心有两只海龟的瓦片:

 to spread-out   
ask patches with [count turtles-here = 2]
[ask one-of turtles-here [
fd .25
ask one-of other turtles-here [face myself fd -0.25]]]
end

关于netlogo - 如何使一个补丁中的两只海龟都可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27458304/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com