首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >脸和脸之间有什么区别?

问脸和脸之间有什么区别?
EN

Stack Overflow用户
提问于 2013-04-14 02:41:47
回答 1查看 181关注 0票数 1

我使用face在NetLogo中没有任何问题,但是不是也是这样吗?(面向补丁/代理方向的代理)

代码语言:javascript
复制
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更好的场景?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-14 15:36:50

在什么情况下,你想知道某件事情的走向,而不想真正面对它?我相信你能想到很多。一个例子是根据某些标准在两个可能的标题中进行选择。

假设您想要面对两种代理中的一种,无论哪一种要求您使用最少的金额:

代码语言:javascript
复制
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 ]

(在现实生活中,你可能会做一些不同的事情,但我希望这能说明问题。)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15995190

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档