Skip to contents

Cross-check *_opts() lists to run the ringbp model

Usage

cross_check_opts(delays, event_probs)

Arguments

delays

a list with class <ringbp_delay_opts>: the delay distribution functions for the ringbp model, returned by delay_opts(). Contains 4 elements: incubation_period, onset_to_isolation, latent_period and onset_to_self_isolation

event_probs

a list with class <ringbp_event_prob_opts>: the event probabilities for the ringbp model, returned by event_prob_opts(). Contains 5 elements: asymptomatic, presymptomatic_transmission, alpha, symptomatic_traced and symptomatic_self_isolate

Value

TRUE if all the checks pass or an error or warning is thrown if the simulation options are incompatible.

Details

Currently the only cross-checking is between onset_to_self_isolation from delay_opts() and symptomatic_self_isolate from event_prob_opts().

If delays$onset_to_self_isolation carries a cross_checked attribute set to TRUE, the checks are skipped and TRUE is returned immediately. This lets scenario_sim() cross-check the options once and then tag delays so that the per-replicate outbreak_model() calls do not repeat the check (and re-emit its warning) for every simulation replicate. The attribute is set on a local copy of delays (a single scenario_sim() or outbreak_model()) call), and does not persist, so the warning will be repeated in separate scenario_sim() or outbreak_model()) calls.