Ask Ordering Example

Ask Ordering Example preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

code example 

Tagged by Reuven M. Lerner over 6 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 941 times • Downloaded 42 times • Run 0 times
Download the 'Ask Ordering Example' modelDownload this modelEmbed this model

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


Comments and Questions

Click to Run Model

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

;;; three different version of GO

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

to go-by-who-number
  foreach sort turtles
    [ ask ?
        [ fd 1 ] ]
  tick
end 

to go-by-size
  foreach sort-by [[size] of ?1 > [size] of ?2] turtles
    [ ask ?
        [ fd 1 ] ]
end 


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky about 6 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky over 6 years ago Updated version tag Download this version
Uri Wilensky over 7 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Model from NetLogo distribution Download this version
Uri Wilensky almost 9 years ago Ask Ordering Example Download this version
Uri Wilensky almost 9 years ago Ask Ordering Example Download this version

Attached files

File Type Description Last updated
Ask Ordering Example.png preview Preview for 'Ask Ordering Example' about 6 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.