interventions.interventions
interventions.interventions
Shared intervention infrastructure for TBsim.
TBProductRoutine — generic routine delivery for TB vaccine/treatment products.
Classes
| Name | Description |
|---|---|
| TBProductRoutine | Generic routine delivery for TB vaccine/treatment products. |
TBProductRoutine
interventions.interventions.TBProductRoutine(product=None, pars=None, **kwargs)Generic routine delivery for TB vaccine/treatment products.
Handles date-windowed delivery with composable eligibility filters (age range, disease state, user-provided callable) and orchestrates per-step product operations.
Any product that exposes update_roster(), administer(people, uids), and apply_protection() can be plugged into this delivery.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| product | ss.Vx |
The vaccine/treatment product. | None |
| coverage | ss.bernoulli |
Fraction of eligible individuals who accept (applied once per person). | required |
| start / stop | ss.date |
Campaign window (defaults to sim start/stop if not provided). | required |
| age_range | list or None | [min_age, max_age] filter, or None to skip. |
required |
| eligible_states | list or None | List of disease-state values (e.g. [TBS.INFECTION]) to filter on, or None to skip. |
required |
| eligibility | callable or None | User-provided fn(sim) -> BoolArr \| uids for custom filtering (passed through to ss.Intervention). |
required |
Methods
| Name | Description |
|---|---|
| check_eligibility | Combine built-in filters (age, disease state) with optional |
| init_pre | Fill in start/stop from sim timeline if not explicitly set. |
| init_results | Define result channels for newly initiated and currently protected counts. |
| step | Routine delivery step: |
| update_results | Record number of newly initiated individuals this timestep. |
check_eligibility
interventions.interventions.TBProductRoutine.check_eligibility()Combine built-in filters (age, disease state) with optional user-provided eligibility callable. Coverage applied once per person.
init_pre
interventions.interventions.TBProductRoutine.init_pre(sim)Fill in start/stop from sim timeline if not explicitly set.
init_results
interventions.interventions.TBProductRoutine.init_results()Define result channels for newly initiated and currently protected counts.
step
interventions.interventions.TBProductRoutine.step()Routine delivery step:
- Check date window.
- Product handles internal phase transitions (
update_roster) - even outside of date window - Find and deliver to newly eligible agents - only during date window
- Product applies
rr_*modifiers for all currently protected - even outside of date window
update_results
interventions.interventions.TBProductRoutine.update_results()Record number of newly initiated individuals this timestep.