2014-11-25 Netlogo Lab

posted Nov 25, 2014, 5:12 AM by Samuel Konstantinovich   [ updated Nov 25, 2014, 4:25 PM ]
Pair up with your neighbor and make a model as follows: (you can work on your own copy, but 

You should break your code  into functions. I do not want to see a really long set of if statements with tons of code in it in the go command.
You should have a setup button and a go button.

Buttons:
-Setup : call the setup procedure
-Go : call the go procedure (forever button)

Sliders
-Turtles regular speed that is determined by a slider turtle-speed from 0.01 to 1.0 with increment of .01
-Turtles have a regular max turn angle slider max-turn-angle from 1 to 180 degrees based on a slider
-The number of turtles spawned is based on the slider num-turtles between 1 and 100 .

Setup:
-Reset the world, spawn a number of turtles based on the num-turtles slider. The x and y positions should be set randomly based on your world size. 

Go:
-Turtles move in a wiggle like manner using the speed and angle sliders. You can make the turn equal probability or biased
-The world has 4 quadrants like in math, and in each quadrant the turtles behave differently as follows, so you have to write different code for each of their behaviors.

Quadrant 1 Turtles: 
move forward at turtle-speed
do not turn. 
grow by 0.1 size per frame every frame up to a maximum size of 5. 
change color to red.

Quadrant 2 turtles: 
move double turtle-speed
turn randomly up to max-turn-angle
color increases by 0.1 every frame. 
size decreases by 0.2 every frame but cannot shrink below size 1.

Quadrant 3 turtles:
Move at half turtle-speed and 
turn randomly up to double max-turn-angle
Their size decreases by 0.1 every frame but cannot shrink below size 1.

Quadrant 4 turtles 
move and turn normally. 
They set colors to random multiples of 10 + 5 like 15 25 35 etc.range is 5 to 135.
Their size decreases by 0.1 every frame but cannot shrink below size 1.

Comments