Skip to content

Class ModelSIRMixing

template <typename TSeq>

ClassList > ModelSIRMixing

  • #include <sirmixing.hpp>

Inherits the following classes: epiworld::Model< EPI_DEFAULT_TSEQ >

Public Static Attributes

Type Name
const int INFECTED = 1
const int RECOVERED = 2
const int SUSCEPTIBLE = 0

Public Functions

Type Name
ModelSIRMixing ()
ModelSIRMixing (ModelSIRMixing< TSeq > & model, const std::string & vname, epiworld_fast_uint n, epiworld_double prevalence, epiworld_double contact_rate, epiworld_double transmission_rate, epiworld_double recovery_rate, std::vector< double > contact_matrix)
Constructs a ModelSIRMixing object.
ModelSIRMixing (const std::string & vname, epiworld_fast_uint n, epiworld_double prevalence, epiworld_double contact_rate, epiworld_double transmission_rate, epiworld_double recovery_rate, std::vector< double > contact_matrix)
Constructs a ModelSIRMixing object.
Model< TSeq > * clone_ptr ()
size_t get_n_infected (size_t group) const
ModelSIRMixing< TSeq > & initial_states (std::vector< double > proportions_, std::vector< int > queue_={})
Set the initial states of the model.
void reset ()
ModelSIRMixing< TSeq > & run (epiworld_fast_uint ndays, int seed=-1)
void set_contact_matrix (std::vector< double > cmat)

Public Static Attributes Documentation

variable INFECTED

const int ModelSIRMixing< TSeq >::INFECTED;

variable RECOVERED

const int ModelSIRMixing< TSeq >::RECOVERED;

variable SUSCEPTIBLE

const int ModelSIRMixing< TSeq >::SUSCEPTIBLE;

Public Functions Documentation

function ModelSIRMixing [1/3]

inline ModelSIRMixing::ModelSIRMixing () 

function ModelSIRMixing [2/3]

Constructs a ModelSIRMixing object.

inline ModelSIRMixing::ModelSIRMixing (
    ModelSIRMixing < TSeq > & model,
    const std::string & vname,
    epiworld_fast_uint n,
    epiworld_double prevalence,
    epiworld_double contact_rate,
    epiworld_double transmission_rate,
    epiworld_double recovery_rate,
    std::vector< double > contact_matrix
) 

Template for a Susceptible-Exposed-Infected-Removed (SEIR) model.

Parameters:

  • model A reference to an existing ModelSIRMixing object.
  • vname The name of the ModelSIRMixing object.
  • n The number of entities in the model.
  • prevalence The initial prevalence of the disease in the model.
  • contact_rate The contact rate between entities in the model.
  • transmission_rate The transmission rate of the disease in the model.
  • recovery_rate The recovery rate of the disease in the model.
  • contact_matrix The contact matrix between entities in the model.
  • model A Model<TSeq> object where to set up the SIR.
  • vname std::string Name of the virus
  • prevalence Initial prevalence (proportion)
  • contact_rate Average number of contacts (interactions) per step.
  • transmission_rate Probability of transmission
  • recovery_rate Probability of recovery

function ModelSIRMixing [3/3]

Constructs a ModelSIRMixing object.

inline ModelSIRMixing::ModelSIRMixing (
    const std::string & vname,
    epiworld_fast_uint n,
    epiworld_double prevalence,
    epiworld_double contact_rate,
    epiworld_double transmission_rate,
    epiworld_double recovery_rate,
    std::vector< double > contact_matrix
) 

Parameters:

  • vname The name of the ModelSIRMixing object.
  • n The number of entities in the model.
  • prevalence The initial prevalence of the disease in the model.
  • contact_rate The contact rate between entities in the model.
  • transmission_rate The transmission rate of the disease in the model.
  • recovery_rate The recovery rate of the disease in the model.
  • contact_matrix The contact matrix between entities in the model.

function clone_ptr

inline Model < TSeq > * ModelSIRMixing::clone_ptr () 

function get_n_infected

inline size_t ModelSIRMixing::get_n_infected (
    size_t group
) const

function initial_states

Set the initial states of the model.

inline ModelSIRMixing < TSeq > & ModelSIRMixing::initial_states (
    std::vector< double > proportions_,
    std::vector< int > queue_={}
) 

Parameters:

  • proportions_ Double vector with a single element:
  • The proportion of non-infected individuals who have recovered.

function reset

inline void ModelSIRMixing::reset () 

function run

inline ModelSIRMixing < TSeq > & ModelSIRMixing::run (
    epiworld_fast_uint ndays,
    int seed=-1
) 

function set_contact_matrix

inline void ModelSIRMixing::set_contact_matrix (
    std::vector< double > cmat
) 


The documentation for this class was generated from the following file include/epiworld/models/sirmixing.hpp