T2 - How to build your model

In the previous tutorial we mentioned model ingredients. Within Starsim, these are the ingredients of an epidemic, namely:

In this tutorial we’ll specify the same model as we did before, but you will notice that people is specified as an ‘ingredient’. Other ingredients wil be covered later.

import starsim as ss
import typhoidsim as ty

# Define high-level simulation parameters
pars = dict(
    start    = 2000,  # Starting year
    dur      = 1.0,   # Duration of the simulation in years
    dt       = 1.0/365.0,     # Timestep of 1 day, expressed in years
    verbose  = 0,             # Do not print details of the run
)

# The population
ppl = ss.People(10_000)

# The disease 
typhoid = ty.Typhoid()

sim = ss.Sim(
    pars=pars,
    people=ppl, ## People is now specified as an ingredient
    diseases=typhoid,
    )
sim.run()
sim.plot()
Figure(1024x768)