70 likes | 166 Views
Getting Started with Computer Simulations using NetLogo. Teaching Contemporary Mathematics Conference January 25, 2013 Christine Belledin NC School of Science and Mathematics. Patches. The Basics – Three Types Agents. Turtles. Links. Variable Definitions Global variables
E N D
Getting Started with Computer Simulations using NetLogo Teaching Contemporary Mathematics Conference January 25, 2013 Christine Belledin NC School of Science and Mathematics
Patches The Basics – Three Types Agents Turtles Links
Variable Definitions • Global variables • Agentset-specific variables • Setup Procedures • Clear variables • Use patches and turtles to create environment • Reset tick counter • Go Procedures • Define steps that are carries out on the agents at each tick • Use subroutines to add structure and clarity The Basics – Program Structure
NetLogo tutorials • My students work independently through the tutorials from the NetLogo website. • Tutorial 1: Students learn to use and explore existing models • Tutorial 2: Students learn to write command and modify existing models • Tutorial 3: Students build a simple NetLogo model • For less experiences students, you may want to complete Tutorial 3 together as a class. • Write a program as a class • Show students the Fire model from the NetLogo library. • Introduce modified problem (see next slide) and develop model • First homework: students make one addition/modification to our class model How I start NetLogo in my classroom
Suppose 30% of the wooded areas along the western edge of a region catch fire. There are 5 houses scattered throughout the area. In each step, if a neighbor of a patch is on fire, then the patch has a 50% chance of catching fire. Which house is most likely to burn? Modeling the Spread of a Fire
Step 1: Create the environment. • Turn patches green and brown • Randomly place houses • Set fires along western edge Step 2: Spread the fire. • Spread the fire through the green patches • Show a house burns by turning grey Step 3: Make improvements. • Identify problems in the simulation and address them • Try to have a stopping point for the simulation Step 4: Add in extras. • Allow user to input forest density, number of houses, etc. • Report the impact of the fire numerically or graphically Break the problem into steps
Start with the NetLogo tutorials from the NetLogo User Manual • Explore existing models from the Models Library • Look through the code of a few models and try to understand the logic • Try making modifications to existing models • Search the “Code Examples” section for simple examples of particular behaviors • Use the NetLogo dictionary to search for relevant commands • Check out the NetLogo Resources page for collections of models • Recommended book: Agent-Based and Individual-Based Modeling: A Practical Introduction (2011) by Steven F. Railsback and Volker Grimm Recommendations for learning more about NetLogoand ABM