sim
sim
Classes
| Name | Description |
|---|---|
| Sim | A thin subclass of sti.Sim that supplies HIV-appropriate defaults. |
Sim
sim.Sim(pars=None, sim_pars=None, hiv_pars=None, location=None, **kwargs)A thin subclass of sti.Sim that supplies HIV-appropriate defaults.
Equivalent to::
sti.Sim(
diseases='hiv',
demographics=[ss.Pregnancy(), ss.Deaths()],
networks=[sti.StructuredSexual(), ss.MaternalNet(), ss.BreastfeedingNet()],
interventions=[sti.HIVTest(), sti.ART(), sti.VMMC(), sti.Prep()],
)
Parameter routing (hiv_pars, network pars, etc.) is entirely delegated to sti.Sim’s separate_pars machinery. Users can customize: - A whole module slot by passing the module directly (diseases=MyHIV()) - Or by passing pars for the default module (hiv=dict(rel_trans_acute=26) or flat rel_trans_acute=26) - But not both for the same slot (sti.Sim raises XOR violation).
Collisions between pars and kwargs raise an error: specify a value exactly once.
Functions
| Name | Description |
|---|---|
| demo | Create a demo HIVsim simulation. |
demo
sim.demo(example=None, run=True, plot=True, **kwargs)Create a demo HIVsim simulation.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| example | str | Example name (‘simple’, ‘zimbabwe’). Default: ‘simple’. | None |
| run | bool | Whether to run the sim. | True |
| plot | bool | Whether to plot results (only if run=True). | True |
| **kwargs | Passed to the example’s make_sim(). | {} |
Returns
| Name | Type | Description |
|---|---|---|
| Sim | Configured (and optionally run) simulation. |
Examples::
import hivsim
hivsim.demo() # Run simple default demo
hivsim.demo('zimbabwe') # Run Zimbabwe HIV model
sim = hivsim.demo('zimbabwe', run=False, n_agents=500) # Just create it