我使用face在NetLogo中没有任何问题,但是不是也是这样吗?(面向补丁/代理方向的代理)
towards
towards agent
Reports the heading from this agent to the given agent.
If wrapping is allowed by the topology and the wrapped distance (around the edges of the world) is shorter, towards will use the wrapped path.
Note: asking for the heading from an agent to itself, or an agent on the same location, will cause a runtime error.
set heading towards turtle 1
;; same as "face turtle 1"
See also face.是否有使用设置为标题比使用face更好的场景?
发布于 2013-04-14 15:36:50
towards只报告标题face就像towards和set heading结合在一起一样。在什么情况下,你想知道某件事情的走向,而不想真正面对它?我相信你能想到很多。一个例子是根据某些标准在两个可能的标题中进行选择。
假设您想要面对两种代理中的一种,无论哪一种要求您使用最少的金额:
let first-heading towards first-agent
let second-heading towards second-agent
; compare my current heading to the two calculated headings:
let first-angle subtract-headings heading first-heading
let second-angle subtract-headings heading second-heading
if-else abs first-angle < abs second-angle
[ rt first-angle ]
[ rt second-angle ](在现实生活中,你可能会做一些不同的事情,但我希望这能说明问题。)
https://stackoverflow.com/questions/15995190
复制相似问题