gpt4 book ai didi

netlogo - 世界环绕和追逐角度

转载 作者:行者123 更新时间:2023-12-02 13:11:53 24 4
gpt4 key购买 nike

我试图让一只海龟追赶一小群其他海龟,被追赶的海龟以这个角度转离追赶者:

atan (xcor - [xcor] of pursuer) (ycor - [ycor] of pursuer)

当世界被包裹时,减去坐标显然不起作用,所以我想知道是否有人以前遇到过这个问题或者可以找到解决方案?

最佳答案

尝试使用报告器,因为它考虑了世界拓扑:http://ccl.northwestern.edu/netlogo/docs/dictionary.html#towards

例如,如果您想直接远离目标,您可以执行以下操作:

ask hunted [ set heading (towards hunter - 180) ]

关于netlogo - 世界环绕和追逐角度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24412909/

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