Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- links-own [counter]
- to setup
- clear-all
- create-turtles NumberOfTurtles
- ;make-circle
- ;ask turtles [ create-links-with other turtles ]
- ask turtles [ setxy random-xcor random-ycor
- set label 0
- set label-color red]
- ask links [ set thickness 0 set label 0]
- reset-ticks
- end
- to go
- if ticks > 4998 [stop]
- ask turtles [set heading random 360 fd 1
- create-links-with other turtles-here
- [
- set counter 0
- set color green
- ]
- ]
- ; ask links-to other turtles-here set label (label + 1)
- ask links [
- if [patch-here] of end1 = [patch-here] of end2
- [
- set counter counter + 1
- show counter
- set label ""
- ]
- ]
- tick
- end
- to go-once
- if ticks > 4999 [stop]
- ask turtles [set heading random 360 fd 1 ]
- ; ask links-to other turtles-here set label (label + 1)
- ;create-network
- tick
- make-circle
- end
- to create-network
- ask links [
- if [patch-here] of end1 = [patch-here] of end2
- [
- set label counter + 1
- show label
- ]
- ]
- end
- to make-circle
- if show-circle? [layout-circle sort turtles (world-width / 2 - 2)]
- ask links[show counter]
- end
Advertisement
Add Comment
Please, Sign In to add comment