WEEK 2 PROGRESS MONITOR - Climate Change & Agriculture model

Step 1- Open your Week 1 model and remix, and add in the code on the solar energy page

❏  Remix and name “week 2 agriculture model”, in the title add your name and your partner’s name

❏  Add the project to your public gallery and add your partner as a collaborator

OR, if you did not complete your work last week, open SLNOVA, log in to your account, and open the Week 2 agriculture model: http://www.slnova.org/GUTS/projects/117939/

Step 2- Decode the week 2 model:

•  What does the code on the solar energy page do — what color terrain will create the most heat? What color will create the most reflected energy? What do you think the colors are meant to represent in this model?

Step 3- Put blocks together to make the following happen:

1.  On the interface, click “edit breeds” and create 2 new breeds: a truck, and CO2 (carbon dioxide).

2.  On the interface, create a new toggle button and name it “Drive truck”

3.  On the world page: In the setup, create 1 truck and set its x coordinate and y coordinate to -32. Set its heading to 45, set its shape to Truck, and set its size to 4.

Don’t forget to save, run code, and test your model after each step to be sure the code is working! Your truck should be ready to leave the farm and drive to the city!

3. On the truck page:

•  Create a procedure named “emit CO2”. In that procedure, make a 10% chance that a CO2 agent will be created. Make that CO2 agent size 2, shape Pyramid, and color gray.

•  Get a toggle button from the interface drawer, and choose “Drive truck” Inside that code, use an “if/else” logic block to make the truck turn around then move forward 1 if the absolute value of its x coordinate is greater than 45 degrees. (hint: math drawer, abs block). In the “else” portion of the block, have the truck move forward 1 and call the “emit CO2” procedure.

4. On the CO2 page, make the CO2 go up 0.5 steps at a time until it reaches an altitude of 12 (hint: look at the heat or reflected energy pages to see how to make the agent rise to a certain altitude). Once it reaches a Z of 12, have it move forward slowly (0.2) steps and wiggle 60 degrees.

5. On the heat page, write code so that when the heat agent collides with a CO2 agent, the heat agent bounces back to the ground and then creates another heat agent. Give the new heat agent a random 360 degree heading and have it move forward 2 steps (so it moves away from the “parent” agent and you can see it).

Don’t forget to save, run code, and test your model. You should see a sun, the solar energy agents falling to the ground and becoming heat or reflected energy, those agents rising up to 20 and then being deleted, the truck running back and forth between the farm and the city and emitting CO2, and the CO2 and heat sometimes colliding and creating another heat.

EXTENSIONS:

Add a data box to count the number of heat agents and a data box to count the number of CO2 agents.(hint: create data box on interface, set it to zero on setup, and set it to count the agents within 150 steps in a forever block on the world page).

Save, run code, and test your project (without running the truck). Where does the level of heat seem to stabilize? How does that level change when you run the truck?

Add a line graph that uses the data boxes to plot the number of heat and CO2 agents. How does the graph help you see the relationship between the heat and the CO2?

Add a push button named “hide graph” and one named “show graph” on the interface. Then, use that code on the world page to hide and show your graph (hint: interface drawer).