Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment