Reputation: 11
I have two breeds of turtle(A) & turtle(B):
Turtle(A) move about the world randomly.
When turtle(A)
runs into a turtle(B)
I would like the turtle(B)
to move into a radius around a coordinate, thus hopefully making a circle.
Any help/hints?
Upvotes: 1
Views: 435
Reputation: 9620
That specification is a bit incomplete, but this may get you started:
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
Upvotes: 1