我有两个品种的龟(A)& 龟(B):
海龟(A)随意移动世界。
当turtle(A)
遇到turtle(B)
时,我希望turtle(B)
移动到围绕坐标的半径,因此希望制作一个圆圈。
任何帮助/提示?
答案 0 :(得分:1)
该规范有点不完整,但这可能会让你开始:
globals [lst]
breed [taggers tagger]
breed [taggeds tagged]
taggeds-own [caught?]
to setup
ca
set lst []
ask n-of 50 patches [sprout-taggeds 1 [set caught? false]]
ask n-of 5 patches [sprout-taggers 1]
end
to move ;;turtle proc
ask taggeds [
if not caught? [
move-to one-of neighbors
]
]
end
to tag ;;tagger proc
let candidates taggeds-on neighbors
if any? candidates [
let captured one-of candidates
ask captured [set caught? true]
set lst lput captured lst
]
end
to go
ask turtles [move]
ask taggers [tag]
layout-circle lst 5 ;;aribtary radius of 5
end