2016-07-07 7 views
0

この問題を克服する方法を見つけるのが難しいです...私はソーシャルネットワークを作成しています(私は無向リンクを使用しています)。Netlogo - ネットワークの問題

エージェントには多くの変数があり、その中に "y"と "ro"があります。私が知りたいのは、カメと亀とつながっている雌牛の平均[ro]が[y <]です...方法はありますか?次の式

mean [ro] of turtles with [link-neighbor? turtle n]

私が代わりにturtle nの希望エージェント設定turtles with [y < 1] ...方法があるで実際に

...?

ありがとうございました!

答えて

3
turtles-own [y ro] 

to test 
    ca 
    crt 50 [ 
    set y random-float 2 
    set ro one-of [1 2] 
    ] 
    ask turtles [ 
    create-links-with n-of 5 other turtles 
    ] 
    show mean [ro] of (turtles with [has-poor-neighbor]) 
end 

to-report has-poor-neighbor ;turtle proc 
    report any? link-neighbors with [y < 1] 
end 
関連する問題