CoriolisEffect
CoriolisEffect

Reputation: 11

Turtles moving into a circular formation

I have two breeds of turtle(A) & turtle(B):

Any help/hints?

Upvotes: 1

Views: 435

Answers (1)

Alan
Alan

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

Related Questions