2013-04-14 3 views
1

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. 

(패치/제제의 방향으로 향하는 제의 컨텍스트)가얼굴를 사용하는 것보다 더 향하는 방향 설정 을 사용하는 어떤 시나리오가 있는가?

답변

2

실제로 향하게하지 않고 무언가로 향하고있는 것을 알고 싶습니까? 네가 많은 것을 생각할 수있을거야. 하나의 예시적인 상황은 몇 가지 기준에 따라 두 가지 가능한 표제 사이에서 선택하는 것입니다.

의 당신이 하나가 최소 금액 설정하도록 요구 중 두 에이전트 중 하나, 상대하고 싶지 가정 해 봅시다 :

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 ] 

(실제 생활에서, 당신이 아마 것 일 약간 다르게,하지만이 희망 그 점을 지니고있다.)

+0

나는 본다. 나는 "향한"방향으로 "향하여"사용하는 것에 고정되어 있었기 때문에 나는 그것을 "얼굴"과 계속 비교하고있다. 이제 이해가된다. 고맙습니다! – Gannicus