Tuesday, Thursday at 10:00-11:25am in Thorvaldson S386.
Class Instructor: Nathaniel Osgood, Thorvaldson 280.6, 966-6102, osgood@cs.usask.ca
Office Hours: Tuesdays 3:30 – 5:30pm and by appointment.
Readings from a variety of sources (primarily articles and excerpts from texts on dynamic
modeling) will be provided as PDFs on the course website.
Introduces the theory and practice of Agent-Based simulation modeling for informing decision
making and strategic planning, with a strong emphasis on applications in public health.
This course introduces students to the theory and practice of agent-based simulation to inform
decision making and policy evaluation, particularly in public health. The course provides an
introduction to the use of simulation using examples drawn from the health area, and covers the
entire model lifecycle from qualitative model conceptualization, quantitative model
conceptualization and formulation, model parameterization & calibration, use of models for
policy analysis. This course is highly complementary with – but does not require as a
prerequisite – the version of CMPT covering System Dynamics modeling.
While public health simulation models have been proposed and conducted in a variety of
frameworks the course will focus on modeling using Agent-Based modeling. Students will be
provided with some additional background in order to come up to speed in each of these areas.
While System Dynamics modeling is taught in an alternating version of this course, the course
will provide a very brief exposure to System Dynamics modeling tools for interested students.
In light of the diverse background of course participants, the instructor will strive to present
material at a level that will be accessible to all participants, and extra tutorials on background
material will be presented upon expression of interest by students. Class exercises and
assignments will be carried out in user-friendly graphical software. However, in contrast to the
System Dynamics version of the course, some computer programming will be required to
complete course assignments. Following the tradition of CMPT graduate “topics” courses, this
class will review pieces of the associated literature in a more informal manner. While the class
will include presentation of material, most such delivery will be somewhat informal, and the
“instructor” will often serve as more of a facilitator with session time will be devoted to hands-on
in-class exercises and tutorials aimed at fostering learning for all involved. Graduate students
within the class are assumed to be mature colleagues that will participate in active learning by
identifying and seeking out material of interest. In the course of the semester, the flow and
direction of the class may be adjusted to reflect the interests of these participants. The schedule
included in this outline is thus tentative.
The weighting for coursework is as follows:
| Deliverable | Detail | % Mark | Rough due date |
| Participation | In classroom and office hours | 10% | N/A |
| Presentation | On Term Project at End of Term | 5% | April 5,7 |
| Assignment 1 | TBD | 10% | TBD |
| Assignment 2 | TBD | 10% | TBD |
| Term Project Part 1 | Informal description of area in which you’d like to
work for your model, resources you may use. | 0% | Jan 22 |
| Term Project Part 2 | Informal estimate of scope of model to be
implemented. Further details on data sources
planned for use. Identification of major
properties/attributes for agents | 0% | Feb 10 |
| Term Project Part 3 | Discussion of agent interaction.
Descriptions of scenarios & sensitivity analyses
that you plan to investigate. | 0% | Mar 12 |
| Term Project Part 4 | Final report | 65% | Apr 15 |
Note that a significant fraction of students’ grades will be based on class participation. In
recognition of differences in communication styles and interests among students, this
participation score will reflect interaction in class and in office hours and (where appropriate)
tutorials.
The contents of the term project will be decided under discussion with the instructor.
The completion of a project is an important part of the class. The project type and topic will be
chosen by the students in conjunction with the faculty, and may be pursued on an individual or
group basis. Students are encouraged to work in teams for the project. Based verbal discussion
and on a series of incremental deliverables submitted during the term, the instructor (and possibly
individuals) will help guide the students on the project. (Please note that these early deliverables
for the project may be informal and rough. While all deliverables should attempt to communicate
material, no focus on creating a careful presentation of these materials is required prior to the
final report for the project.) The project emphases may vary, but most projects should include the
following:
- Creating one or more simulation models that describe these phenomena, or adapting a
particular model to a different context.
- Placing data into the model to customize it to a particular context.
- Running a “baseline” scenario with the existing model parameters, and commenting on
its plausibility.
- Running one or more “what if” scenarios with the model to explore different possible
situations. These situations could reflect the results of implementing different policies, or
different possible external conditions.
- Performing one or more “sensitivity analyses”, in which assumptions in the model (in the
form of parameter values, or structural elements of the model) are changed.
- A well-structured written report describing the above, and your findings.
- An in-class 30-minute presentation where you summarize the model, its construction and
findings.
Please note that while most projects will fall into the framework described above, the instructor is
open to the idea of students exploring alternative methodologically oriented project types. These
could include (but are not limited to) investigation of meta-level issues in modeling (e.g.
challenges in characterizing a certain dynamic phenomenon in different modeling frameworks),
or an analysis of or proposal for innovations involving the modeling tools and methodologies
used for simulation modeling. If you wish to pursue one of these other types of projects, please
discuss your interests with the instructor.
Students may access the course website
We will try to post course lecture slides, notes, and other material to the website.
We plan to record the lectures given as part of class, for reference by students in this class as well
as others. We are asking for student help in recording these lectures, and will attempt to post
them to the course website on a regular basis.
There is no required reference book for the class. Interested students may find the following two
books of value in understand elements of Agent-Based Modeling and System Dynamics
modeling, respectively:
Epstein, J. M. (2006). Generative social science: studies in agent-based computational
modeling. Princeton: Princeton University Press.
Sterman, J. Business Dynamics. Boston: McGraw-Hill Higher Education. 2000.
This course will demand more than is typical of a class. This course will require some dedicated
effort from each student, but that effort will be met with dedication on the part of the instructor.
The demands are of several sorts:
The class will have a significant time demand, and we do not recommend that the class be taken
for credit by students whose schedules prevent devoting many hours a week to master course
material. However, much of the demand of the course will come not in terms of time, but in
terms of willingness to stretch yourselves conceptually and in terms of your knowledge base.
While the class is highly interdisciplinary (probably more so than any class the students have
taken in years), it will demand much “stretching” from all sides. What is being asked of students
will vary by area of the students:
- For those from health sciences background: A willingness to take on
quantitative challenges, and to acquire new skills and approaches to
understanding public health phenomena. For this year in particular, the course
will require a willingness to learn small bits of computer programming.
- For those from Computer Science background: Patience with understanding
textured health science concepts, terminology and aspects of public health
practice.
All types of students are also being asked to show respect for the skills and perspective brought
by other students, regardless of their area.
A serious investment in the above will give you a set of skills that are currently rare and much
valued. However, based on the level of commitment being required, we recognize that this
course will be not be a good match for many students, and recommend that students who are not
confident of their wiliness to commit their time and effort to the course look elsewhere.
A preliminary schedule for topics is included below. As noted above, this schedule is tentative is
subject to change as student interest and discussion direction warrant.
| Date | Focus | Notes |
| Jan 6 | Preparatory Tasks | Broad Motivations, Terminology
(Individual & Agent-Based models) |
| Jan 11 | System science concepts. | Some essential concepts: Emergence, Non-
linear dynamics: Tipping Points & Lock-
in. ABM as realization of mathematical
process, SIR example of Emergence, Levels
of description. |
| Jan 13 | Introduction to the Agent Based modeling process | Understanding the modeling process.
Critical role of model boundary & question
being addressed. Maintaining distinct
abstract model description &
implementation. |
| Jan 18 | Scoping a model | Thinking in a structured way about the state
of an agent (distinguishing static from
dynamic), causal interactions (both
structured and random) between the parties,
higher level environmental influences,
multi-level interactions. High level
summary measures/statistics. Representing
Inter- and intra-individual Feedbacks in
Agent-Based models. Key question: What
is relevant to answer the research questions
being asked? Endogenous/Exogenous/Ignored
classification. Interaction Scenarios.
Breadth vs. depth. Opportunity costs. Incremental
development.
Key problem features pointing to agent-
based or aggregate approaches.
|
| Jan 20 | Hands-on AnyLogic Overview 1:
Supported modeling Methodologies &
their Interactions, Key infrastructure
building blocks & concepts | Brief introduction to relative strengths and
natural spheres of application of System
Dynamics, Network-based & Agent-Based
modeling.
AnyLogic user interface. Design vs.
execution environment. The notion of
“builds”.
Declarative specification (“How much Java
code will I actually have to write?”)
Association of presentations with classes.
Experiment objects. Data sets & output
(charts & tables). Lack of trajectory files.
Simulation time horizon. Access to Java
code. Libraries & Library documentation.
Modification-based & incremental
development. |
| Jan 25 | Hands-on AnyLogic Overview 3:
Computational Structure of Agent-
Based Models (Fundamental Anylogic
Classes) | Key classes for all types of models.
Primary classes: Main, Agent classes,
Presentations, Experiments. Relationship of
classes, run-time objects & design-time
objects. Expressing agent heterogeneity
with subclassing vs. parameterization.
Parameters & (State) variables. Functions.
“Action” based code fragments (entering &
leaving state, at transition, startup &
destruction of Main & Person objects).
Accessing the “Main” object via
get_Main().
Declaring agent populations. Real-time
display: Dynamic properties. Peeks under
the hood: Imposed & elective (Java source
files). Snippets of Java code: Where &
why. (Startup, Destroy, etc.) |
| Jan 27 | No class – project work |
| Feb 1 | Hands-On Tutorial on Building
Models in AnyLogic 1: Specifying
Intra-Agent Dynamics: Discrete
Behaviour | Visual UML State Diagrams, Branching,
sources & sinks. Transitions: Rates,
Timeouts, Events. Building up graphical model of T2DM
progression.
|
| Feb 3
| Hands-On Tutorial on Building
Models in AnyLogic 2: Expressing
Discrete Inter-Agent Dynamics via
Messaging
| Continuous & Discrete (Event-based)
Interactions, Contagion of Pathogens &
Ideas. Network neighbour selection
options.
|
| Feb 8
| Hands-On Tutorial on Building
Models in AnyLogic 4: Specifying
Intra-Agent Dynamics: Continuous
Evolution
| Stocks & flows, common patterns (1st and
higher order delays). CT & Viral
Dynamics.
Understanding Simple Feedback: First-
order delays 1. Understanding Simple
Feedback: First-order & higher order
delays, glimpse of implications of
competing risks.
|
| Feb 10
| Hands-On Tutorial on Building
Models in AnyLogic 5: The Embedded
Environment (The Network & regular
spatial embedding in agent-based
modeling)
| Networks: The Environment object,
choices for network structure,
communicating across networks: Directly
& via messaging.
|
| Feb 15
| Structural dynamics
| Dynamic agent populations, dynamic
network structure, environment interaction.
|
| Feb 17
| The Embedded Environment: Focus on
Regular Spatial Embedding
| Regular spatial embedding (Cellular
Automata): Neighbourhoods & inter-agent
communication. Color. Boundary
Conditions. Alternative tessellation
schemes.
|
| Feb 22 | Vacation |
| Feb 24 |
| Feb 29 | Hands-On Tutorial on Building
Models in AnyLogic 6: The Embedded
Environment (Irregular & Location-
Based Spatial Embedding & Network
based modeling)
| Irregular spatial embedding: “Network-
Based Modeling” in AnyLogic. Capturing
spatial locations for processing. Dealing
with resources & resource
competition/mutual exclusion. Spatial
movement between discrete locations.
Defining paths & resources. Static &
dynamic resources.
|
| Feb 29
| Hands-On Tutorial on Building
Models in AnyLogic 6: The Embedded
Environment (Irregular & Location-
Based Spatial Embedding & Network
based modeling)
| Irregular spatial embedding: “Network-
Based Modeling” in AnyLogic. Capturing
spatial locations for processing. Dealing
with resources & resource
competition/mutual exclusion. Spatial
movement between discrete locations.
Defining paths & resources. Static &
dynamic resources.
|
| Mar 1
| Hands on Tutorial on Building Models
in AnyLogic 7: Capturing the
interactions of multiple agent types
| Using subtyping & polymorphism to
capture multiple agent types. Capturing
agent heterogeneity via subtyping vs.
parameterization. Leveraging a single
network for multiple agents.
|
| Mar 3
| Debugging in AnyLogic
| Via Eclipse & AnyLogic
Resesarch/Professional Debugger.
Tracing. Isolation. Binary search.
Distinguishing the failure from the fault.
Common defects. Remote debugging via
Eclipse.
|
| Mar 8
| Hybrid & Multi-scale modeling
| Discussion of multiple schemes of hybrid
modeling. Stocks & Flows within agents.
Stocks & flows as driving environmental
factors in an agent-based model. Agents
driving flows of aggregated stocks.
|
| Mar 10
| Best Practices: Model building
| Reducing software engineering complexity
via modularity & model transparency.
Trajectory Recording, abstraction using
methods & classes, separating interface
specification & implementation.
Commenting. Using intention-revealing
naming conventions.
|
| Mar 15
| Best Practices: Model building 2
| Eliminating manifest constants. Unit
checking. Assertions. Brief exposure to
principles of testing (test drivers, harnesses,
mocks/fakes, unit tests). Peer reviews.
ABM as realization of mathematical
process; documenting mathematical
description. Checking adherence of code to
mathematical specification.
|
| Mar 17
| Model parameter estimation | Diverse sources of parameters. Challenges
of network data. Opportunities for
employing novel data collection
mechanisms
|
| Mar 22
| Calibration & confidence building 1
| Overview of calibration process. Dynamic
Hypotheses & Calibration. Calibration in
Vensim & AnyLogic.
|
| Mar 24
| Calibration & confidence building 2
| Unique challenges of calibrating ABM.
|
| Mar 29
| Sensitivity Analyses 1
| Parameter, structural, automated & manual,
one way & multi-way
|
| Mar 31
| Sensitivity Analysis 2
| Monte Carlo & structured sensitivity
analyses
|
| Apr 5
| Student Presentations 1
|
|
| Apr 7 | Student Presentations 2 | |
NB: The schedule above – including the contents and dates of both lectures and management
meetings – is subject to change. On occasion, updated schedules may be provided.
Where these occur, lectures slides will be provided via the course website (using WebCT).
Readings distributed electronically are shown below. Additional readings and URLs will be
shown in the notes for the topic in question.
The class will include a number of tutorials and labs to provide background material for the
mathematical concepts and software used in class, or to provide more advanced material for those
students who have the requisite background. These tutorials are optional, and will be scheduled
per the availability of students. To facilitate meeting as a group, we will attempt to arrange a
specific tutorial time to use for the entire term.
In some cases, a possible tutorial topics may instead be presented as a lecture.
Possible areas for background tutorials are as follows:
| Tutorial Topic | Notes |
| Review of health science terminology | For those not from health science background. Some
introductory terminology from epidemiology & public
health |
| Essential Object Oriented
Programming Concepts and practice,
with a focus on Java syntax
| Java as a language. Classes & objects, class hierarchies,
polymorphism, references. (Interfaces?) Static vs.
dynamic methods & fields. Allocation & garbage
collection. Concept of scope. References. Subtyping,
Subclassing, Polymorphism, Interface-based
programming & Encapsulation Methods: Formal
parameters, calls & arguments.
|
| Data input & output
| Ad-hoc and pre-planned. Databases & files.
|
| User input design
| Use of user interface controls to interact with AnyLogic
models.
|
| Vensim modeling software basics
| For those who have not already taken the version of
CMPT 858 covering System Dynamics modeling.
Focuses on mechanics of using software.
|
| Decision Analysis Tie-Ins
| Linkages of simulation models with other modeling
techniques such as multiattribute decision theory and
risk analysis
|
| Subscripting in Vensim
| Single and multi-dimensional subscripting
|
| Representing contact in aggregate
models
| Mixing & preference matrices.
|
| Tradeoffs between Individual &
Aggregate Models
| Broad Motivations, Terminology (Individual & Agent-
Based models), Emergence. ABM as realization of
mathematical process, SIR example of Emergence,
Levels of description. The myth of “bottom up”
description. Independent representation & interactions
of comorbidity. Intervention granularity,
expressiveness, performance scaling, expressing
heterogeneity (both static & dynamic), transfer effects,
capturing detailed dynamics (e.g. spatial & network
spread, memoryful processes), calibration &
parameterization, ease of specification. Immuno-
epidemiological modeling for influenza & Chlamydia
as an example.
|
| Multi-network agent-based models
| Using multiple networks involving different agents.
Capturing agent presence in multiple networks. Multi-
network visualization. Manual network construction.
|
| Multi-network agent-based models
| Using multiple networks involving different agents.
Capturing agent presence in multiple networks. Multi-
network visualization. Manual network construction.
|
| Algorithmic necessities: An overview
of basic programming constructs
| Covers both textual coding & graphical programming
via “Actions”. Conditionals, Looping, variable
declarations, allocation, brief glimpse of data structures.
|
| Using third-party software
| Using external libraries & representing dependencies.
|
| Best Practices: Supporting Tools
| Leveraging AnyLogic with tools for trajectory
recording, model & scenario versioning. Enabling
trajectory recording. Automatic & manual addition of
data sets. Opening trajectory files in Excel. Tracing
execution. JUnit.
|
| Dimensionality & units checks
| Dimensional consistency checks, subscripting
|
| Basics of Model Mathematical
Analysis
| Phase space diagrams, the concept of fixed points, and
identifying the location and stability of fixed points.
Basins of Attraction Eigenmodes.
|
| Best Practices: Team Software
Development
| Peer reviews, Versioning, Check-in (commit)/check out
(locking). Comparing versions. Unit, Integration &
System Testing. Daily builds/continuous integration &
smoke test.
|
| Best Practices: Individual Software
Development
| Individual versioning. Mocks & Fakes. Incremental
delivery. Change & configuration management.
Exceptions vs. return codes. Clean coding suggestions.
Test-first coding.
|
| Thinking about Feedback: Structure &
Behavior
| Examples from energy metabolism & weight
regulation, immunology, obesity, infectious disease
epidemiology & policy adaptation
|