2017-04-21 7 views
0

次のステートメントでネイバータートルを参照するにはどうすればよいですか?近隣の属性を確認する

if count(turtles-on patch-ahead -1) with [(target-speed) > (target-speed)] > 0 

隣人のカメの速度を自分のものと比較したいと思います。

+0

チェックアウト[この回答](http://stackoverflow.com/questions/14086966/comparing-two-agent-variables)または[この回答](http://stackoverflow.com/questions/28770317/netlogo-differences-turtle-variables) –

答えて

1

代わりのcount agentset > 0any? agentset

あなたはそれを一緒に入れて、だから、[target-speed] of myself

を使用したい場合は、試してみてください。

if any? turtles-on patch-ahead -1 with [target-speed > [target-speed] of myself] 
+0

ありがとう、それは私が探していたものです –

関連する問題