Try out the 3 different choices. The even turtles (BLUE ARROW HEAD shapes) are who numbers 0, 2, 4 and 6. They have heading 0, 90, 180 and 270 or up, right, down, and left or north, east, south and west.
The ODD turtles move either 7 units or 7 divided by cosine of heading units or 7 multiplied by cosine of heading units. Since COSINE is negative (between 0.0 and -1.0) half the time, the ABSolute value of 7 / COS heading or ABSsolute value of 7 * COS heading was used.
May 2nd, 2011
See QUIZ TWO - show the output of 8 turtles. It was NOT a rectangle!!!
COSINE ranges from -1.0 to 1.0 in value.
The ABS absolute value of COSINE ranges from 0.0 to 1.0 in value.
If you divide by a number that is 1 or smaller, what happens?
If you multiply by a number that is 1 or smaller, what happens?
powered by NetLogo
view/download model file: COSINE.nlogo
This section could give a general understanding of what the model is trying to show or explain.
This section could explain what rules the agents use to create the overall behavior of the model.
This section could explain how to use the model, including a description of each of the items in the interface tab.
This section could give some ideas of things for the user to notice while running the model.
This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.
This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.
This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.
This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.
This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.
breed [ planes aPlane ] TO moveWithOrWithoutCosine ca checkerBoard cro 8 ask turtles [ set size 2 set color blue pd ifelse remainder who 2 = 0 [ moveEven ] [ moveOdd ] ] wait 2 showCircleOfPlanes END TO moveEven fd 7 END TO moveOdd if typeOfMoveForOdd = "NoCosine" [ fd 7 ] if typeOfMoveForOdd = "DivideByCosine" [ fd abs (7 / cos heading) ] if typeOfMoveForOdd = "MultByCosine" [ fd abs (7 * cos heading) ] END TO checkerBoard ask patches [ ifelse remainder (pxcor + pycor) 2 = 0 [ set pcolor white ] [ set pcolor yellow ] ] END TO showCircleOfPlanes set-default-shape planes "airplane" create-ordered-planes 16 ask planes [ set size 2.2 set color black fd 7 ] END