Starsim: A new agent-based framework for �modeling HIV and STI co-transmission
Cliff Kerr1★, Robyn Stuart1, Jamie Cohen1, Alina Muellenmeister2, Romesh Abeysuriya2, Darcy Rao1, Daniel Klein1
1 Institute for Disease Modeling, Bill & Melinda Gates Foundation, USA; 2 Burnet Institute, Australia
★ We are unable to present the poster in person, but please contact us at: info@starsim.org
Fig. 6: Participants and facilitators at the agent-based modeling training in Nairobi, Kenya in April.
Introduction
Sim
People
Diseases (& health states)
Connectors
Interventions
Analyzers
Results
Vaccines
Diagnostics
Treatment
Calibration
Age binning
Trans. trees
Plotting
Export
Disease interactions
Network interactions
States [alive, age, vaccinated, HPV infected, etc.]
Networks
Demographics
Pregnancy
Death
Migration
Respiratory
Household
Community
Custom
Sexual
School
Workplace
Risk-stratified
Preference
Age-mixed
Injecting
Environmental
…
…
HPV
HIV
Typhoid
+ Custom
Syphilis
TB
States
Results
Diabetes
Nutrition
Design philosophy
Fig. 1: Simple Starsim simulation in Python, illustrating how common tasks (setting parameters, running a simulation, and plotting results) can be executed in just a few lines of code.
import starsim as ss
# Define the parameters
pars = dict(
n_agents = 50_000, # Number of agents to simulate
networks = dict( # "Networks" define how agents interact w/ each other
type = 'random', # Here, we use a 'random' network
n_contacts = 10 # Each person has 10 contacts with other people
),
diseases = dict( # "Diseases" add detail on what diseases to model
type = 'SIR', # Here, we're creating an SIR disease
init_prev = 0.01, # Proportion of the population initially infected
beta = 0.05, # Probability of transmission between contacts
)
)
# Make the sim, run and plot
sim = ss.Sim(pars) # Create the simulation
sim.run() # Run the simulation (takes 1 second for 50,000 agents)
sim.plot() # Plot all the simulation results
sim.diseases.sir.plot() # Plot the standard SIR curves
Fig. 2: Outputs from the code shown in Fig. 1. Starsim has a default plot showing all simulation results (above), as well as disease-specific plots (right).
Structure and performance
Fig. 4: Modular structure of Starsim. Everything is contained by the "Sim" object. The "People" object coordinates all properties of the agents, allowing disease interactions.
Application and summary
Fig. 5: Example of an HIV-syphilis coinfection simulation, showing the importance of accounting for each disease during calibration (left) and evaluating intervention impact (right).