Info Tech in a global economy
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 1/8
Features Explore Insights New Insights Create a Free Account Log In
This tutorial describes how to construct a model of an infectious disease usingThis tutorial describes how to construct a model of an infectious disease using
Insight Maker. Agent-Based Modeling techniques are used in the constructionInsight Maker. Agent-Based Modeling techniques are used in the construction
of this model. Before starting the tutorial, make sure you have familiarizedof this model. Before starting the tutorial, make sure you have familiarized
yourself with how to yourself with how to create primitivescreate primitives and and run modelsrun models..
Table of Contents Insight Maker Guide
Getting Help
Features
Types of Modeling
System Dynamics
Agent Based Modeling
Collaborate and Share
Free and Open Source
Tutorials
Disease Dynamics (SD)
Disease Dynamics (ABM)
Predator-Prey Interactions (SD)
Manual
Model Diagramming
Ghosting
Keyboard Shortcuts
Equations and Formulae
Built-In Functions
Advanced Equations
Types of Primitives
Stocks
Flows
Variables
Links
Converters
States
Transitions
Actions
Agent Populations
Running a Model
Model Verification
Constraints
Units
Storytelling
Agent Geography
Spatial Geography
Network Geography
Sensitivity Testing
Optimization
Vectors
Macros
Model Scripting
User login
Start Building Insights and Models
Disease Dynamics (ABM)
Create a new Create a new StateState named named HealthyHealthy ..11
Create a new Create a new StateState named named InfectedInfected ..22
Create a new Create a new StateState named named RecoveredRecovered ..33
The model diagram should now look something like this:The model diagram should now look something like this:
States represent the condition someone is in. So in ourStates represent the condition someone is in. So in our
model a person can either be healthy, infected, ormodel a person can either be healthy, infected, or
recovered from the infection. Now, lets add transitionsrecovered from the infection. Now, lets add transitions
that move a person from state to state.that move a person from state to state.
44
Create a new Create a new TransitionTransition going from the primitive going from the primitive HealthyHealthy to the primitive to the primitive InfectedInfected ..
Name that transition Name that transition InfectionInfection ..
55
Create a new Create a new TransitionTransition going from the primitive going from the primitive InfectedInfected to the primitive to the primitive
RecoveredRecovered . Name that transition . Name that transition RecoveryRecovery ..
66
The model diagram should now look something like this:The model diagram should now look something like this:77
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 2/8
Create new account
Request new password
Log in
Please note that in this model someone who is recoveredPlease note that in this model someone who is recovered
cannot become sick again. They have gained immunity tocannot become sick again. They have gained immunity to
the disease. the disease.
Now that the model structure has been designed, let's addNow that the model structure has been designed, let's add
equations and configure the primitives.equations and configure the primitives.
Change the Change the Initial ActiveInitial Active property of the primitive property of the primitive HealthyHealthy to to truetrue ..
When a state is active, it means a person is in that state.When a state is active, it means a person is in that state.
By setting By setting HealthyHealthy to start to start truetrue, we have the person, we have the person start in the healthy state.start in the healthy state.
88
Change the Change the Trigger TypeTrigger Type property of the primitive property of the primitive InfectionInfection to to ProbabilityProbability ..99
Change the Change the Value/EquationValue/Equation property of the primitive property of the primitive InfectionInfection to to 0.30.3 ..1010
Change the Change the Trigger TypeTrigger Type property of the primitive property of the primitive RecoveryRecovery to to ProbabilityProbability ..1111
Change the Change the Value/EquationValue/Equation property of the primitive property of the primitive RecoveryRecovery to to 0.20.2 ..
Using the Using the ProbabilityProbability type for the transition trigger means type for the transition trigger means that the person has a fixed probability of transitioningthat the person has a fixed probability of transitioning
from one state to the next each year.from one state to the next each year.
1212
Run the model. Here are sample results:Run the model. Here are sample results:1313
Username or e-mail *
Password *
Remember me
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 3/8
Don't worry if your results do not look exactly like this.Don't worry if your results do not look exactly like this.
This is a stochastic model so each time we run it, we willThis is a stochastic model so each time we run it, we will
get different results. Let's give it a try.get different results. Let's give it a try.
Run the model. Here are sample results:Run the model. Here are sample results:1414
Run the model. Here are sample results:Run the model. Here are sample results:1515
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 4/8
When a state takes on the value When a state takes on the value 11 it means the person is it means the person is in the state. We can see how the person moves fromin the state. We can see how the person moves from
healthy, to infected, to recovered in these three differenthealthy, to infected, to recovered in these three different
simulation runs. Right now we are only simulating a singlesimulation runs. Right now we are only simulating a single
person. Let's extend our model to simulate a population ofperson. Let's extend our model to simulate a population of
people.people.
Create a new Create a new FolderFolder named named PersonPerson . The folder should surround the primitives. The folder should surround the primitives
HealthyHealthy , , InfectedInfected , , RecoveredRecovered , , InfectionInfection and and RecoveryRecovery ..
1616
The model diagram should now look something like this:The model diagram should now look something like this:1717
Change the Change the BehaviorBehavior property of the primitive property of the primitive PersonPerson to to AgentAgent ..1818
Create a new Create a new Agent PopulationAgent Population named named PopulationPopulation ..1919
Change the Change the Agent BaseAgent Base property of the primitive property of the primitive PopulationPopulation to to PersonPerson ..2020
The model diagram should now look something like this:The model diagram should now look something like this:2121
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 5/8
Run the model. Here are sample results:Run the model. Here are sample results:
That looks pretty good! We can see the disease graduallyThat looks pretty good! We can see the disease gradually
spread through our population of 100 people.spread through our population of 100 people.
However, right now the probability of a person gettingHowever, right now the probability of a person getting
sick is independent of the other people in the model. Let'ssick is independent of the other people in the model. Let's
change the model so the more sick people there are, thechange the model so the more sick people there are, the
higher the likelihood that a healthy person will becomehigher the likelihood that a healthy person will become
sick.sick.
2222
Create a new Create a new VariableVariable named named Percent InfectedPercent Infected ..2323
Create a new Create a new LinkLink going from the primitive going from the primitive PopulationPopulation to the primitive to the primitive
Percent InfectedPercent Infected ..
2424
Create a new Create a new LinkLink going from the primitive going from the primitive Percent InfectedPercent Infected to the primitive to the primitive
InfectionInfection ..
2525
The model diagram should now look something like this:The model diagram should now look something like this:2626
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 6/8
Now let's configure the value of Now let's configure the value of Percent InfectedPercent Infected and and change the change the InfectionInfection transition to use it. transition to use it.
Change the Change the EquationEquation property of the primitive property of the primitive Percent InfectedPercent Infected to to
Count(FindState([Population], [Infected]))/PopulationSize([Population])Count(FindState([Population], [Infected]))/PopulationSize([Population]) ..
This equation uses the This equation uses the FindStateFindState function to select all the function to select all the people in the people in the PopulationPopulation primitive who are in the primitive who are in the InfectedInfected state. It then divides the count of those people state. It then divides the count of those people
by the total size of the population.by the total size of the population.
2727
Change the Change the Value/EquationValue/Equation property of the primitive property of the primitive InfectionInfection to to
[Percent Infected][Percent Infected] , and the , and the RecalculateRecalculate property of the primitive property of the primitive InfectionInfection to to
YesYes ..
The The RecalculateRecalculate property causes the infection rate to be property causes the infection rate to be recalculated and updated at every time step of therecalculated and updated at every time step of the
simulation.simulation.
2828
Run the model. Here are sample results:Run the model. Here are sample results:
Nothing happened because we don't have anyone to startNothing happened because we don't have anyone to start
the infection. Let's seed the model with a single initialthe infection. Let's seed the model with a single initial
infected person.infected person.
2929
Change the Change the Initial ActiveInitial Active property of the primitive property of the primitive InfectedInfected to to Index(Self) == 1Index(Self) == 1 ..3030
Change the Change the Initial ActiveInitial Active property of the primitive property of the primitive HealthyHealthy to to Index(Self) <> 1Index(Self) <> 1 ..
Each of the people in the population is given an uniqueEach of the people in the population is given an unique
IndexIndex. The first agent will have an index of 1, the second. The first agent will have an index of 1, the second
3131
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 7/8
an index of 2, and so on. an index of 2, and so on. SelfSelf always refers to the always refers to the current agent. These equations will set the first agentcurrent agent. These equations will set the first agent
created to start in the created to start in the InfectedInfected state while all the other state while all the other agents will start in the agents will start in the HealthyHealthy state. state.
Run the model. Here are sample results:Run the model. Here are sample results:
Since this is a stochastic model, each time you run it, youSince this is a stochastic model, each time you run it, you
will get slightly different results. Let's give it a try.will get slightly different results. Let's give it a try.
3232
Run the model. Here are sample results:Run the model. Here are sample results:3333
Run the model. Here are sample results:Run the model. Here are sample results:3434
10/6/2019 Disease Dynamics (ABM) | Insight Maker
https://insightmaker.com/node/3790 8/8
‹ Disease Dynamics (SD) up Predator-Prey Interactions (SD) ›
Printer-friendly version
That works great! We now have a full Agent-Based ModelThat works great! We now have a full Agent-Based Model
of disease.of disease.
We can also configure the display type to be a map of theWe can also configure the display type to be a map of the
people in the model in a two-dimensional geography.people in the model in a two-dimensional geography.
Right now, people are placed randomly, but we couldRight now, people are placed randomly, but we could
configure their locations or make them move around inconfigure their locations or make them move around in
response to different factors. We could also change theresponse to different factors. We could also change the
infection rate so the infection spread geographically.infection rate so the infection spread geographically.
Run the model. Here are sample results:Run the model. Here are sample results:3535
[email protected] | Terms of Use and Licenses | Privacy Policy
Copyright 2010-2017. Insight Maker is Open-Source.