Guest User

Untitled

a guest
May 1st, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. breed [agents agent]
  2.  
  3. agents-own [num-volta visivel]
  4.  
  5. to setup
  6.  
  7. clear-all
  8. reset-ticks
  9.  
  10. create-agents 250 [
  11. set color green
  12. setxy random-xcor random-ycor
  13. ]
  14. end
  15.  
  16. to go
  17. if ticks >= 500 [
  18. stop
  19. ]
  20.  
  21. ask agents [
  22. contar-a-volta
  23. contar-visivel
  24.  
  25. ifelse num-volta > 10 [
  26. face heading max-one-of visivel [num-volta] + 180
  27. ]
  28. [
  29. face heading max-one-of visivel [num-volta]
  30. ]
  31.  
  32. fd random 10
  33. ]
  34. tick
  35. end
  36.  
  37. to contar-a-volta
  38. set num-volta agent count agents with [myself != self] in-radius 8
  39. end
  40.  
  41. to contar-visivel
  42. set visivel agents with [myself != self] in-radius 16
  43. end
Advertisement
Add Comment
Please, Sign In to add comment