这是猛禽和人类的捕食者猎物模拟。我希望猛禽在射程内能直接移动到最近的人。如何在netlogo中实现呢?有什么建议么?
假设您想要的范围是5,并且假设猛禽每跳一次就向最近的人类迈进了一步。然后:
ask raptors [
let candidates humans in-radius 5
if any? candidates [
let target min-one-of candidates [distance myself]
face target
fd 1
]
]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
572 次 |
| 最近记录: |