2016-08-05 3 views

答えて

2
globals [ref-patch av-dist] 

to setup 
    ca 
    set av-dist mean [distance patch 3 -3] of patches 
    demo 
end 

to demo 
    ask patches [ 
    if distance patch 3 -3 < av-dist [ 
     set pcolor red 
    ] 
    ] 
end 
+0

'ref-patch'グローバルは未使用です。 –

0

は、私は私はこのようなパッチレポーターにすべてをかけると思います。そして、

to-report closer-than-average? report distance patch 3 -3 < mean [distance patch -3] of patches end

することができます

ask one-of patches [show closer-than-average?]

または

ask patches with [closer-than-average?] [set pcolor blue]

など

関連する問題