我正在尝试让雌性动物特工选择在一定半径内没有雌性的所有斑块。然后,从这些斑块中,我希望雌性移到在相同半径内具有最高平均猎物的那个。我目前有:
let potential-sites patches with [not any? patches in-radius 2 with [owner-fem != nobody]]
let pot-site-areas [patches in-radius 2] of potential-sites
let pot-site-prey map [mean [prey] of ?] pot-site-areas
let ideal-site max pot-site-prey
但是后来我意识到我没有办法告诉雌性去哪一个斑块,因为理想位点只是一个没有与其相关联的斑块坐标的值。关于如何将值链接到实际补丁的任何建议?非常感谢!
使用max-one-of
,也许像这样:
let ideal-site max-one-of potential-sites [mean [prey] of patches in-radius 2]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句