soldiers

No preview image

1 collaborator

Default-person laila zaher (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 4.1.2 • Viewed 189 times • Downloaded 19 times • Run 2 times
Download the 'soldiers' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

Agentsets in NetLogo are always in random order. This code example demonstrates that visually. It also shows how to make the turtles execute in a particular order if you want.

NETLOGO FEATURES

SORT and SORT-BY are used to specify ordering.

View updates are set to "continuous", so when you slow the model down far enough you can see the turtles moving one at a time.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

to setup
  clear-all
  create-turtles floor (world-width / 2) [
    set xcor 1 + who * 2  ;; space out the turtles in order by who number
    set color color - 3   ;; darker
    set size 1 + random-float 2
    set heading 0
    set label who
  ]
end 

;;; three different version of GO

to go-random
  ask turtles
    [ fd 1 ]
  tick
end 

There is only one version of this model, created almost 13 years ago by laila zaher.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.