Skip to content

Commit

Permalink
Set vaccination to min of doses or indivs; WIP #226
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikunterwegs committed May 24, 2024
1 parent 68696ea commit d5ac766
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions inst/include/model_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ struct epidemic_default {
vax_nu_current =
vaccination::current_nu(t, vax_nu, vax_time_begin, vax_time_end);

// NB: Casting initial conditions matrix columns to arrays is necessary
// for vectorised operations
/// NOTE: Casting initial conditions matrix columns to arrays is necessary
/// for vectorised operations

// compartmental transitions without accounting for contacts
Eigen::ArrayXd sToE = model_params_temp.at("transmission_rate") *
Expand All @@ -124,7 +124,9 @@ struct epidemic_default {
model_params_temp.at("recovery_rate") * x.col(2).array();

/// NOTE: vax_nu_current holds COUNTS, not rates. See issue #198 for details
Eigen::ArrayXd sToV = vax_nu_current.col(0).array();
// S -> V is the group-wise minimum of doses or individuals
// preventing negative values in S
Eigen::ArrayXd sToV = x.col(0).array().min(vax_nu_current.col(0).array());

// compartmental changes accounting for contacts (for dS and dE)
// β: transmission_rate; ν: vaccination COUNTS, see issue #198
Expand Down
5 changes: 3 additions & 2 deletions inst/include/model_vacamole.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ struct epidemic_vacamole {
(cm_temp * (x.col(5) + x.col(6))).array();

/// NOTE: vax_nu_current holds COUNTS, not rates. See issue #198 for details
// individuals vaccinated are the group-wise minimum of doses or individuals
// Susceptible to vaccinated with one dose
Eigen::ArrayXd sToV1 = vax_nu_current.col(0).array();
Eigen::ArrayXd sToV1 = x.col(0).array().min(vax_nu_current.col(0).array());
// Vaccinated one dose to vaccinated with two doses
Eigen::ArrayXd v1ToV2 = vax_nu_current.col(1).array();
Eigen::ArrayXd v1ToV2 = x.col(1).array().min(vax_nu_current.col(1).array());

// Vaccinated one dose to exposed - same as susceptible to exposed
Eigen::ArrayXd v1ToE = model_params_temp.at("transmission_rate") *
Expand Down

0 comments on commit d5ac766

Please sign in to comment.