Person-to-person transmission is captured by network-mediated interaction. In this tutorial, we will use a random network, where pairings of people are generated at random at each timestep, but the average number of pairings or contacts on each timestep can be specified.
import starsim as ssimport typhoidsim as ty# Define high-level simulation parameterspars =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 populationppl = ss.People(10_000)# Person to person transmissionrandom_p2p = ss.RandomNet({'n_contacts': 5})# The disease typhoid = ty.Typhoid()sim = ss.Sim( pars=pars, people=ppl, networks=random_p2p, diseases=typhoid, )sim.run()sim.plot()
Figure(1024x768)
Contact route: how it currently works
For this particular network, a target individual will be in contact on average with 5 people (called sources) on each time step. These sources can be infected or not. If they are infected, the target individual will receive a dose of CFUs that will depend on:
the infectiousness of the source individual
the individual shedding rate of the source individual – currently captured in a variable called rel_trans (abbreviation for relative transmissibility)
The tranmission is handled as follows:
For every source contact of a target individual
draw a daily daily number of exposures to the source, and