12-02-2013

posted Dec 2, 2013, 5:39 AM by Samuel Konstantinovich   [ updated Dec 2, 2013, 6:38 AM ]
Goal:
Write a simple model on paper    

Do now /  Classwork :  (On Paper )
Write the following 4 netlogo functions: You may discuss this with neighbors. 

( DO NOT TYPE ANY OF THIS INTO NETLOGO! ) 

1. An observer context function setup:
1a. clears the world
1b. makes 5 red car shape turtles 
1c. the cars should face any of these four directions randomly: 0 90 180 or 270; 
1d. make 10 blue person shaped turtles. 
1e. place the cars on the left half of the screen at random, and the people on the right side of the screen at random. 

2. A turtle context functions carMotion : a turtle that runs this command moves forward 1. 

3. A turtle context function peopleMotion : a turtle that runs this command wiggles randomly going forward .3 and then turning at most 30 degrees in either direction.

4. An observer context function go.
4a. asks the turtles to run either carMotion or peopleMotion depending on their shape. (Use 
an ifelse) 
4b. There should be a brief wait at the end of the go to make the program run at a reasonable speed. 


Comments