Download presentation
Presentation is loading. Please wait.
1
Modeling and Simulation Module 1: Lesson 1
Introduction to Complex Adaptive Systems and Computer Modeling and Simulation
2
Turn & Walk Activity Simple Rules You are an agent
Form a circle (or not) Turn to face the person on your left Close your eyes and take three steps in that heading
3
Turn & Walk Computer Model
Web-based StarLogo Nova Platform What is the relationship between the computer model and the real world? What was included and what was missing from the computer model of Turn & Walk? What are computer models good for?
4
Setup and Forever blocks
5
Complex Adaptive Systems (CAS)
video “Introduction to Complex Systems”
6
Complex Adaptive Systems (CAS)
7
Terms to Remember Scatter Agent Initial conditions Simple rules
Outcome Phenomenon Adaptive Agent Simple rules Heading Iteration Prediction Emergent patterns
8
Introduction to StarLogo Nova and Building Painting Turtles
Modeling and Simulation Module 1: Lesson 2 Introduction to StarLogo Nova and Building Painting Turtles
9
StarLogo Nova A web-based software program
Computer Science Concepts Instructions Computer Program Looping Iterations Public and Private Galleries Remixing
10
Guided Tour of StarLogo Nova
Follow Guided Introduction to StarLogo Nova to see the different parts of site. User Interface Terrain & Spaceland area Blocks & Drawers (workspace to create your code) Account & log in My Profile, public & private galleries, creating new project Sharing your project Remixing your project Use the Guided Introduction to StarLogo Nova- Reference Guide for Teachers See Activity 1, Lesson 2
11
Flower Turtles Project
Start a new blank project. Name it ‘Flower Turtles’ with your name(s) in the title. Your challenge: Have turtles create a flower create 5 turtles that separate when ‘Setup’button is pushed. have the turtles move and leave trails with their pens down Save your project with both partners names Activity 2, Lesson 2
12
Flower Turtles Project
In the World Page- create 5 turtles that separate when the setup button is pushed. In the Turtle Page- have the turtles move & turn to create a flower pattern. Activity 2, Lesson 2 Look for Lesson 2a: Flower Turtles in the GUTS gallery for Module 1
13
Extensions: Painting Turtles Challenge
REMIX your Flower Turtle project and call it “Painting Turtles” Your challenge: Paint a masterpiece create many turtles have the turtles move around the space leaving trails have a slight wiggle to their walk Change the colors of the turtles. Save your project with both partners names
14
Terms to Remember Agent Location Heading Steps Iteration Setup Runtime
Random
15
Modeling and Simulation Module 1: Lesson 3
Conditional Branching Trailblazer and Bumper Turtles
16
Review from Lesson 2 What commands enabled turtles to change their environment? What could an agent leaving trails represent in a real world scenario? The pen down command was the block that let the turtles leave a trail, thus changing their environment. Real world examples include: ants & pheromones, walking in your house with muddy shoes, a truck that paints the dividers on a road
17
How turtles can react to their environment Trailblazer
Instructions Starting and ending in the same place. Using a pencil, draw the path in the CENTER of squares. Pick up ALL the gold while avoiding the hazards. Color the squares as necessary according to the following rules: Take a step forward. If you are standing on a RED square, then turn right by 90 degrees Else If you are standing on a BLUE square, then turn left by 90 degrees Else If you are standing on a BLACK square, then turn right by 180 degrees Trade your map with your partner. Activity 1, Lesson 3
18
Discussion and New Concepts
Comparing solutions Computer Science concept: conditionals New commands: If/Then and If/Then/Else Boolean statements- Evaluate to either True or False (Yes or No) Examples of conditionals in real life? Real life examples of conditional statements: If it is raining outside, take an umbrella If the bell rings, go to the next class
19
Setup and Forever blocks
These blocks are known at ‘event handlers’ that are waiting for an action like the mouse click to execute the code inside.
20
New SLNova Blocks
21
Bumper Turtles Challenge
Start with the program called “Bumper Turtles starter” program Click on the “Paint Landmarks” push button and see the program execute the code provided. Do not change the code in Paint Landmarks! Remix the project, add your name(s) to the title Your challenge is to make the turtles react to the landmarks created by the “Paint Landmarks” Use logic blocks that evaluate the color of the terrain and tells the turtle how to turn. Activity 2, Lesson 3
22
Partial Solution
23
Discussion What is the difference between if/then statements in a row vs. nested if/then/else statements Does execution order matter? What could these trails and bumpers represent in Bumper Turtles model? Terms to remember: conditional, Boolean, evaluation
24
Modeling and Simulation Module 1: Lesson 1
Probability with Dice and Data, Wiggle Walk, and Colliding Turtles
25
Review from Lesson 3 What commands enabled agents to react to their environments? Conditional statements that evaluate the terrain color
26
Review from Lesson 3 What commands enabled agents to react to their environments? IF/THEN IF/THEN/ELSE
27
Review from Lesson 3 An example of reacting to the environment:
IF/THEN with a Boolean expression
28
New in Lesson 4 Today we are going to learn about probability (or the likelihood of something happening). Then we are going to use probability to make turtles do a “wiggle” walk. What is probability? Noun. The extent to which something is probable; the likelihood of something happening or being the case.
29
Chances Are Today we are going to learn about probability
Form small groups and each group gets a cup and a die. Roll the die in the cup and record the result on your activity sheet. Repeat until you have 50 trials. Activity 1, Lesson 4
30
Chances Are What were your results?
If you used a bar graph to visualize your results, what would it look like? Pool each groups data and see the results for the class. What are the chances of rolling each number between 1 and 6?
31
Chances Are We can mimic a roll of a die in StarLogo Nova using the random command. Random 6 will return a number between 0 and 5.
32
Chances Are Random can be used within other commands. For example, used within a left turn command, what do you think this command now does? If we used this command in an agent’s walk, what would it’s trail look like?
33
Wiggle walk Next imagine that you were going to roll two dice instead of one die. Do you think we will still get a flat distribution? In other words, is rolling a pair of ones as common as rolling a sum of 8?
34
Wiggle walk Fill in all the possible combinations of rolling two dice.
Student 1 - Student 2 Fill in all the possible combinations of rolling two dice.
35
Wiggle Walk What is the most common result of rolling two dice?
What is the next most common result? If we were to graph out the number of occurrences of each result, what would it look like? Common number is 0 (zero)
36
Wiggle Walk We use this “triangle” distribution when we want to to make agents walk with some randomness in their motion but mostly follow a straight line. We call this a wiggle walk.
37
Wiggle Walk We use this distribution when we want to to make agents walk with some randomness in their motion but mostly follow a straight line. We call this a wiggle walk.
38
Wiggle Walk
39
Wiggle Walk Try it yourself!
Open your Bumper Turtle program and make your agents wiggle when they walk. Next you can get rid of the red, black and blue blocks
40
Wiggle Walk What’s the difference between a walk that uses one command
And two commands?
41
Colliding Turtles New Command: Collision
Collisions occur when two agents bump into one another. (They do not need to be centered on the same patch.) This is different from bumper turtles – In bumper turtles, agents were responding to colored patches in their environment, not other agents. Activity 2, Lesson 4
42
Colliding Turtles New Command: Collision
43
Colliding Turtles New Command: Collision with a condition
44
New StarLogo Nova Blocks
45
Colliding Turtles (coding agent to agent interaction)
Start from a new blank project Create 50 blue turtles and 5 red turtles (use 2 ‘create do’ blocks) Have the turtles move forward with a little wiggle in their walk. (forever block on the turtle page) Upon colliding with a red turtle, have turtles react to that agent (the collidee) by changing their color to red. Save your project, make sure your name(s) are in the title. Extension: add a ‘chance’ or probability of a turtle turning red when it collides with a red turtle.
46
Review from Lesson 4 What could collisions represent in the real world? Why do we use probability in models?
47
End of Lesson 4
48
Modeling and Simulation Module 1: Lesson 5
Epidemiology Modeling the Spread of Disease Designing and Running Experiments
49
Review from Lesson 4 What could collisions represent in the real world? Why do we use probability in models? Collisions would be any type of interaction between 2 organisms- a rabbit eating some grass, 2 people talking, a car hitting another car Probability allows for some randomness and possible emergence of unexpected results, allows for each agent to behave slightly differently.
50
Lesson 5 Introduction to Epidemiology.
Modeling the spread of a disease. Creating a slider for transmission rate. Using the slider value to determine whether or not to pass a disease from agent to agent. Creating a slider for recovery rate. Using it to determine if a sick agent recovers.
51
Introduction to Epidemiology
Epidemics are the spread of disease Epidemiologists study the spread of disease One way epidemiologists try to study the spread of disease is through running simulations of how a disease spreads. Then they can test different measures to stop and epidemic. “Scientists who study epidemics are called epidemiologists. Epidemiologists study the spread of disease such as the swine flu. Epidemics are hard to study because they are made up of many connected and inter-related parts interacting in different ways. They can be hard to predict and sometimes the way a disease spreads creates patterns that cannot be predicted even if you know something about the people involved. These are characteristics of what we call “Complex systems”. (Many interacting parts, hard to predict, patterns emerge that are not predictable even if you know about individuals)” “One way epidemiologists try to understand epidemics is to run computer simulations of how diseases spread and test different measures that could be taken to stop an epidemic.” We are going to alter our Colliding turtles to make it into a model of an Epidemic.
52
What is MRSA? MRSA is a bacteria called Methicillin resistant Staphylococcus Aureus. Staphylococcus means grape-cluster in Greek. Viewed at 10,000 x magnification.
53
MRSA 30% of a population has some form of staphylococcus or staph on their skin or nose, which is known as colonization. About 880,000 people are infected with MRSA each year, out of those, 3% die.
54
How Does it Spread? Direct physical contact
55
How to treat an infection
The infection is usually drained, cleaned, and covered. Treated with an appropriate antibiotic. Keep it covered and don’t share personal items.
56
Susceptible (Healthy)
Picture of MRSA cycle MRSA transmission Susceptible (Healthy) Colonized Infected
57
Community-Associated MRSA Modeled as a Complex Adaptive System
Can you guess “Who are the agents?” What are their behaviors? This is a screen shot from a simplified version of a Community-associated MRSA model developed by the University of Chicago / Argonne National Laboratory. In this model, students go from home to school and back again. The agents can be in one of three states: healthy, infected, or colonized, and can infect others if they are colonized or infected.
58
New in Lesson 5 CS concepts: Variables and Procedures
We are going to turn our colliding turtles model to make it into an epidemic model. Let’s add a new widget called a slider. We will use this slider to hold a value called the transmission rate. This rate is the percentage of time a disease gets passed from one person to another upon collision. In colliding turtles, every time a red and blue agent collide, the blue one gets red. In diseases, not all collisions result in the spread of disease.
59
Variables Variables are containers for holding values.
Think of a variable as a box with a label. In StarLogo Nova, Sliders can be used to hold values and set values as inputs to the model. In
60
Procedures Procedures are stacks of commands that perform a particular function and can be given a name. In colliding turtles, every time a red and blue agent collide, the blue one gets red. In diseases, not all collisions result in the spread of disease.
61
Create a New StarLogo Nova widget
62
New StarLogo Nova widget
Change the max value to 100 by typing in 100 next to max and hitting the return key. Click on “Edit Widgets” again to get out into editing mode and back into play mode.
63
Use the New Widget We now have a way to set the transmission rate through the user interface with a slider. We can get the value of transmission rate in code. How do we “pass the disease to the healthy agent 40% of the time after a collision?” [hint: remember the dice rolls]
64
Use the Transmission Rate Widget
We are rolling a 100-sided die. If the result is less than the transmission rate, pass the disease on. How often should we roll less than the transmission rate? What kind of distribution does the roll of a single die give us?
65
Save and Test your Model
Try changing the transmission rate? What is missing if you wanted to use your model as an experimental test bed? A testbed (also commonly spelled as test bed in research publications) is a platform for experimentation. Testbeds allow for rigorous, transparent, and replicable testing of scientific theories, computational tools, and new technologies.
66
Extension: Adding Recovery
People sometimes recover from a disease How can we use probability to determine when a sick person recovers?
67
Adding Recovery Recovery will be a new procedure.
At each step a sick person has a chance of recovery. A procedure is a container for a group instructions or commands. We use a call block to call the procedure. Procedures are not “run” or “executed” unless they are called.
68
Adding Recovery Create a new slider for recovery rate.
Use that slider in the recover procedure to determine whether the sick agent recovers (becomes healthy again).
69
Adding Recovery Create a new slider for recovery rate.
70
Adding Recovery Use that slider in the recover procedure to determine whether the sick agent recovers (becomes healthy again or blue). Note: even if the recovery rate is set to a low number, it will happen quickly and the disease might die out. Try changing the values of the sliders to make it more realistic to an identified communicable disease.
71
Save and Test your Model
Try changing the recovery rate? Did you see any new outcomes or patterns? A testbed (also commonly spelled as test bed in research publications) is a platform for experimentation. Testbeds allow for rigorous, transparent, and replicable testing of scientific theories, computational tools, and new technologies.
72
Review from Lesson 5 What does this model tell you?
What is the impact of changing the transmission rate? And recovery rate? What other things move through a population like a disease? We used probability in the wiggle walk, the chance of transmitting the disease and the chance of recovering from the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.
73
End of Lesson 5
74
Modeling and Simulation Module 1: Lesson 6
Adding Instrumentation Designing and Running Experiments
75
Review from Lesson 5 What are the different ways we have used probability in this model? What is the impact of changing the transmission rate? What was the impact of changing the recovery rate? We used probability in the wiggle walk and in the chance of transmitting the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.
76
Instrumenting your Model
Definitions: Qualitative means relating to, measuring, or measured by the quality of something (its size, appearance, value, etc.) rather than its quantity. Quantitative means relating to, measuring, or measured by the quantity of something rather than its quality. Number healthy and sick over time?
77
Instrumenting your Model
We need some way of tracking the spread of disease. What data should we collect? Number healthy and sick over time?
78
Instrumenting your Model
Let’s create a new “line graph” widget called “Population Healthy and Sick.” We’ll use it to track #red (sick) and #blue (healthy) over time. Number healthy and sick over time?
79
Instrumenting your Model
Drag the line graph off to the side of Spaceland. Double click on New Series and change its name to “CountHealthy” then select blue as its line color. Add another Series and change its name to “CountSick” then select red as its line color. Finally, click “Edit Widgets” to leave editing mode and returning to play mode. Number healthy and sick over time?
80
Instrumenting your Model
We want The World will update the line graph each time through the forever loop.
81
Test your Model Does the line graph work?
What patterns can you see that were difficult to see without the line graph? Number healthy and sick over time?
82
Customization Researching diseases and adding in real transmission rate values.
83
Designing and Running Experiments
Use the Experimental Design form to describe your experiment. Plan and run your experiment. Describe and share your findings. What are the variables in the model? What are the assumptions made? What are the initial conditions? What behaviors can influence whether or not one gets sick in the model?
84
Review from Lesson 6 Why is it important to instrument models?
How can computer models of epidemics be used to better understand the spread of disease? We used probability in the wiggle walk, the chance of transmitting the disease and the chance of recovering from the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.
85
End of Lesson 6
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.