
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.67 KB | hits: 12 | expires: Never
breed [agents agent]
agents-own [num-volta visivel]
to setup
clear-all
reset-ticks
create-agents 250 [
set color green
setxy random-xcor random-ycor
]
end
to go
if ticks >= 500 [
stop
]
ask agents [
contar-a-volta
contar-visivel
ifelse num-volta > 10 [
face heading max-one-of visivel [num-volta] + 180
]
[
face heading max-one-of visivel [num-volta]
]
fd random 10
]
tick
end
to contar-a-volta
set num-volta agent count agents with [myself != self] in-radius 8
end
to contar-visivel
set visivel agents with [myself != self] in-radius 16
end