Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

8
Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University

Transcript of Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

Page 1: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

Q4 Day 19

COLQ 201Multiagent modeling

Harry HowardTulane University

Page 2: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

2

Course organization

http://www.tulane.edu/~howard/Multiagent/

Page 3: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

Black hole bounce

Page 4: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

4

Create the black hole

to draw-black-hole ask patches with [abs pxcor < 5 and abs pycor < 5] [set pcolor yellow]

;; i created a yellow box in the center of the billiard table (black hole)

end

Page 5: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

5

Bounce

to bounceif abs [pxcor] of patch-ahead 0.1 < 5 and abs [pycor] of patch-ahead 0.1 < 5

[ set heading (random(145)) ] ;; the procedure was changed, and if a ball enters the box in the center (black hole), the balls heading changes to a new number between 1 and 145

end

Page 6: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

6

Variations

Go through everyone's.

Page 7: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

7

Q5 In Tutorial #3: Procedures, right before "What's next?" at the end there

are the following questions: Finally, what other slider could you add to vary how often grass grows

back? Are there rules you can add to the movement of the turtles or to the newly

hatched turtles that happen only at certain times? Q5: Add code to answer both questions. Document your additions by

comments alongside the code, AS WELL AS in the Information tab. (so you have to figure out how it works.)

The best way to do this is to follow the instructions step by step, so you understand everything!

Name your program: Q5-YourLastName-Tut3. Drop it into the dropbox by class on Wednesday, March 3.

Page 8: Q4 Day 19 COLQ 201 Multiagent modeling Harry Howard Tulane University.

26-Feb-2010 COLQ 201, Prof. Howard, Tulane University

8

Next time

Q5 due by class on Wed.Evolutionary biology: social factors