Modify the flocking model so that a button click randomly sends a predator across the screen. If a predator is near, then a boid scatters:
to flock
find-flockmates
if any? flockmates
[
find-nearest-neighbor
ifelse
distance nearest-neighbor < minimum-separation
[
separate
]
[
align
cohere
]
]
let nearby-predator one-of turtles with
[predator] in-radius vision
if nearby-predator != nobody [scatter nearby-predator]
end
to scatter [predator]
; quickly move safe distance away from predator
end