Download presentation
Presentation is loading. Please wait.
1
Introduction to Agent Modeling
Bunnies, Butterflies and Bimolecular Reactions Module 2B
2
Goals BIG IDEA: A system usually has some properties that are different from those of its parts, but appear because of the interaction of those parts (AAAS Benchmarks) Describe the attributes of agent models Identify sources of ready-made models Evaluate a model for possible use in the classroom Modify a pre-built model Build a simple agent model This module will identify some agent modeling software and some samples of models which are available. By the end of the module, participants will be able to …
3
Agenda Introduction to agent modeling Introduction to NetLogo
Modifying a model Build a simple model Reflection and closure
4
What is an agent model? Define the “rules” for each agent
The system behavior is the “sum” of the individual behaviors Some aspects of the behavior are built on probability Even with the same “initial conditions”, different runs of the model will produce different results. Reference the fire model used in the introduction module – if it has been sometime since participants have completed Module 1, you might want to bring up the fire model and run it quickly. Ask participants to state how that was different from other models they have seen. Look for responses that match those above. Write them on a chart or have them “fly-in” when they are mentioned.
5
The Virus Model How does probability and randomness affect the outcomes of agent models? Observe Briefly explore/illustrate some of the points from the previous slide using the multiple line plots virus model. Push the setup/clear button several times in a row without running the model to illustrate that the starting conditions vary. Ask “What are we seeing”? Then push Go and ask “What are we seeing?” Then run the model several times pushing the “setup/keep” button between runs. Again ask participants to offer observations. (This keeps the graphs from prior runs so that participants can see that the outcome varies. This model was specifically developed to show how subsequent runs with the same starting values can give different results. Emphasize again that most agent models have elements of randomness or probability in the behavior of individuals which can result in different outcomes for the entire system. ) Ask – why do the outcomes vary? Different placement of the sick person Different placement of the people Random motion There is a certain probability of getting sick Analyze the model: What is the math behind the model? What is the science behind the model? How do you teach transmission of viruses now? How would this model help student understanding?
6
Virus model – the rules Virus model with multiple plots “rules”
The agents are placed randomly in the world and one is randomly chosen to be sick. The rules for each agent are to wander around the world. If the an uninfected agent and infected agent are in the same space, there is a chance that the uninfected agent will get sick. Compare fire and virus Reference the attributes of an agent model listed on the slide as you explain how they are illustrated in the virus model: The agents are placed randomly in the world and one is randomly chosen to be sick. The rules for each agent are to wander around the world. If the an uninfected agent and infected agent are in the same space, there is a chance that the uninfected agent will get sick. Ask participants to compare fire and virus. Anticipated responses: The sick person is like the first tree that catches fire. Both models depend on probability and proximity to “spread” the fire/virus. In the fire model, the trees are standing still while in the virus model they are moving around. Again – have participants think about and discuss the math behind both models? Is there a science connection between them?
7
Agent modeling environments
Physlets OpenSource Physics Interactive Physics - $ Agent Sheets - $ Scratch StarLogo Alice NetLogo ……… Before clicking to have list appear, ask participants: Have they seen or used other agent models? Possible responses: Some may have used Physlets or Interactive Physics. Both of these are agent models where usually only a few agents are involved. But they are the same in that each “agent” has a set of rules. They tend to rely on algebraic rules instead of probability. Some may mention chemistry models at the PhET site. These are Java or Flash simulations and we can’t look under the hood to know what the rules for the agents are. Some may have used Odyssey for chemistry. Again, we can’t look under the hood to know what the rules are. After this short discussion, quickly run through the list. Details will depend on how much was shared in the previous discussion. Share as much of the following information as is important to the group: Physlets and Open Source Physics are free and fairly specific to physics and some chemistry models. Interactive Physics is an older program, still available, but hasn’t been updated in a while and has a cost associated. All the rest are more generally applicable. Each has varying degrees of programming levels. All but Agent Sheets are currently supported by research groups which may mean regular updates and fixes.
8
The NetLogo Environment
Agents are called “turtles”. Background squares are “patches”. Three layers – Interface, Info and Code The World Speed and Settings Command line Why NetLogo? Free, large number of models in its library and in the community. Downside – does suffer from frequent updates, though frequency is lessening. Does require some programming to alter or create models. Models can be saved as applets which can be an advantage in the classroom. Introduce the environment using Fireworks. Distribute handout “Introduction to NetLogo” - Say: In the virus model – the people were turtles. The patches were black and not referenced in that model. Show participants the three layers ( Interface, Information and Procedures). The handout explains each of these in greater detail. The world is the space where the “action” happens Show them the speed control and the settings button. Demonstrate how to explore the properties of an agent by “right-clicking” on it. This can be useful for debugging or understanding a model.
9
NetLogo input and output
Buttons – Setup and Go Sliders Output – graphs, monitors, etc. Name and explain the use of the various buttons, etc on the interface page. Setup – creates the initial “world” with agents as determined by any variables Go – runs the model – animates the turtles. In the Fireworks model, the Go button has a double arrow in the corner, which means it will continue without stopping until pushed again. Sliders – can be used to set the initial value of a variable. This model has 6 sliders. Other controls such as switches and choosers can also be used to set the initial conditions. This model has one switch. While the fireworks model doesn’t have them, the Virus model had a monitor (number sick) and a graph for output. Show participants the models library under the File menu.
10
Fireworks Model Open NetLogo
Choose File – Models Library – Art – Fireworks Open Fireworks Explore the model Have participants open NetLogo and explore fireworks. They can find Fireworks by going to File – Models Library. Then Art – Fireworks. After about 2-3 minutes, ask participants to share any insights from their exploration of Fireworks. This a simple model, so there shouldn’t be much. Time in NetLogo – participants may ask about time in these models. Explain: Netlogo models don’t keep “real time.” Time in Netlogo is usually marked each time the program cycles through its instructions. One can have the screen update continuously or on ticks (at the completion of program cycle). Depending on what is being measured a tic could be a matter of seconds (nuclear decay, chemical reactions) or months and years (population models).
11
NetLogo Across the Curriculum
Explore models in the models library that are relevant to your content Evaluate these models: How would you use them in your content? What do you like about the model? What would you change if you could? How would the model help students learn? What other topics would you like to see models for in an agent modeling environment? Have participants divide into content areas and work as small groups to explore the models library within their content. Ask them to evaluate and reflect on these models as directed by the questions on the slide. Have a chart ready to list the models they liked and how they think those models would benefit student learning. Circulate and help, ask questions about what they are seeing. You may want to guide them to particular models : Biology: Bug Hunt Speeds, Bug Hunt Camouflage, Wolf-Sheep Predation Chemistry/ Physics: any models under Chemical Reactions or GasLab Earth Science: Climate Change or Grand Canyon Make sure they look in the Curricular Models folder After 15 – 20 min (more time could be allotted here, if it is available), bring groups back together to report on what they found. Chart responses to what the they liked and what students would learn from them. Expected responses: Lots of chemistry and biology models, not as much in physics and earth science Some models very complex, lots of variables to control I wish that a particular model had ….. (This is the response you will build on for the next activity)
12
Modifying a model Sometimes simple changes to an existing model make it more useful for your classroom Working together we will make simple changes to a basic model – a look under the hood Modifying Simple Kinetics 1 from the Model Library While participants may be resisting to looking “under the hood”, point out that sometimes a few simple changes can make a pre-built model look more like the “model” in your head. That is the reasoning behind this next section. Handout “Modifying a NetLogo Model” Have participants follow the instructions for finding, opening and running the model. Have them stop and look at you when they reach the section “Change the colors of the molecules” Before going on, stop and discuss the math and science behind the model: Molecules are randomly placed and move randomly. Some are reactant molecules and some are product This is a bi-molecular reaction so it takes two reactant molecules “colliding” with sufficient energy to create a “dimer” product molecule. The creation of product depends on two reactants being in the same space and a random factor. This random factor “takes the place of” the calculation of activation energy, orientation and collision energy. Product molecules can dissociate as well, also based on a random factor. In the actual reaction, the NO2 is colorless and the dimer is a dark golden brown.
13
Change colors Open procedures section
Everywhere you see green change to orange – 1 Everywhere you see red change to yellow. Run the model to observe your changes. Ask: Why change colors? The model in our head. Model kits use blue for nitrogen and red for oxygen, so we could use those colors so that the computer model looks like our physical models. However, using those colors wouldn’t make the change visible. So another option is to have the molecules colored to reflect the color of the gases. It is important that students understand that atoms and molecules don’t have color, but we often color our models of them to help us understand. NO2 is a reddish-brown in color while N2O4 is colorless. However, as the equilibrium shifts to the dimer, the gas appears yellow as the brown color fades. So we will color NO2 orange and N2O4 yellow. Have the participants follow the handout or you as you make the changes Wait until everyone has successfully changed the colors and run the model with the new colors.
14
Change the plot Right-click on the plot Choose edit
Select plot pens and change colors Run the model and observe your changes Ask why change graph colors? So that the line colors reflect the colors of the molecules. Have participants follow the handout or you as they make and test the changes Make sure everyone has changed the plot
15
More changes Change the sliders Run the model Add a switch
Ask: Why change slider names to Kf and Kr. These variables are more commonly used in the study of chemical kinetics. Add a switch to have product in the initial mix – which adds a line of code to set the percent of product. What other changes would they like to make?
16
Stop and reflect Describe the attributes of agent models
Identify sources of ready-made models Evaluate a model for possible use in the classroom Modify a pre-built model Ask: How have we addressed these objectives? The presenters should judge the needs of the participants at this point. The presentation could stop here or cycle back to exploring more models in the library and allowing participants to try making small changes. However, if the group seems to want more “under the hood”, then the presented can continue on with the next section where participants will build a simple model from scratch.
17
Building a simple model
Starting from scratch A simple model What would you like to add? Handout needed Encourage participants to follow along with you as you build a model from scratch. Guide the group from the start through the section entitled “The Heart of the Model” stopping before the section for adding input and output devices. This should take about 10 minutes. Emphasize the approach that the model is built in pieces which are tested as you proceed. Explain what each step is doing as you proceed. Depending on time and the success of the group, you could: Stop here and encourage the group to complete the rest of the handout on their own. Work through the rest of the worksheet with the entire group Encourage those who are “right with you” to continue working through the handout while you back track / troubleshoot for those who do not have working models at this point When the model is completed, ask them for other things they might like to see in the model or if you followed option 3 above, see if any of the “advanced” group added other features. Wherever the group stops, ask them about the math behind the model. What science was there? What other science concepts could be related to this model? In fact, this is another variation of the Fire! and Virus models. – What is similar? What is different?
18
Summarize and reflect What have we learned?
What more would you like to know? What simple model would you like to build for your content? How could you use this tool in class? How will it help your students build computational reasoning? Refer back to the stated outcomes and help participants reflect on how they will use it in class
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.