You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate HIV example to scenarios API; drop module.order
The make_param() helper is replaced by a base param.net() plus a flat
scenarios data frame fed through create_scenario_list() / use_scenario().
module.order was unnecessary: with the snapshot pattern in progress and
cascade, the default ordering produces equivalent dynamics.
Stage and ART-status multipliers reflect viral-load biology and the U=U evidence base; PrEP efficacy reflects the high end of demonstrated effectiveness with consistent adherence (oral TDF/FTC, injectable CAB-LA, lenacapavir).
602
+
Stage and ART-status multipliers reflect viral-load biology and the U=U evidence base; PrEP efficacy reflects the high end of demonstrated effectiveness with consistent adherence (oral TDF/FTC, injectable CAB-LA, lenacapavir). The base parameter object holds every parameter the modules read; cascade and PrEP rates are defaulted to zero so the "no intervention" scenario inherits an all-off baseline directly from this set.
# PrEP (off by default; indication threshold set up front)
630
+
prep.init.cov = 0,
631
+
prep.start.rate = 0,
632
+
prep.stop.rate = 0,
633
+
prep.indic.deg = 2,
634
+
# Vital dynamics
635
+
departure.rate = departure_rate,
636
+
arrival.rate = 0.00065
637
+
)
644
638
645
639
init <- init.net(i.num = round(0.08 * N))
646
640
```
647
641
648
642
### Control Settings
649
643
650
-
`progress()` and `cascade()` run before `infect()` so transmission probabilities reflect the current step's stage and ART status. `prep()` updates PrEP status among susceptibles just before `infect()` so newly-PrEPed people benefit immediately.
651
-
652
644
```{r}
653
645
#| label: control-settings
654
646
control <- control.net(
@@ -664,48 +656,41 @@ control <- control.net(
664
656
prep.FUN = prep,
665
657
departures.FUN = dfunc,
666
658
arrivals.FUN = afunc,
667
-
verbose = FALSE,
668
-
module.order = c("resim_nets.FUN",
669
-
"progress.FUN",
670
-
"cascade.FUN",
671
-
"prep.FUN",
672
-
"infection.FUN",
673
-
"departures.FUN",
674
-
"arrivals.FUN",
675
-
"nwupdate.FUN",
676
-
"summary_nets.FUN",
677
-
"prevalence.FUN")
659
+
verbose = FALSE
678
660
)
679
661
```
680
662
681
663
### Scenarios
682
664
665
+
Scenarios are defined as a flat data frame (one row per scenario, columns matching parameter names in `param_base`) and converted to a scenario list with `create_scenario_list()`. Inside the loop, `use_scenario(param_base, scn)` returns a parameter object with the scenario's row applied to the base defaults. The `.scenario.id` column labels each scenario; `.at = 0` applies the override before step 1.
0 commit comments