Skip to content

File virus-distribute-meat.hpp

FileList > epiworld > virus-distribute-meat.hpp

Go to the source code of this file

Public Functions

Type Name
VirusToAgentFun< TSeq > distribute_virus_randomly (epiworld_double prevalence, bool prevalence_as_proportion=true, std::vector< size_t > agents_ids={})
Distributes a virus randomly to agents.
VirusToAgentFun< TSeq > distribute_virus_to_entities (std::vector< double > prevalence, bool as_proportion=true)
VirusToAgentFun< TSeq > distribute_virus_to_set (std::vector< size_t > agents_ids)

Public Functions Documentation

function distribute_virus_randomly

Distributes a virus randomly to agents.

template<typename TSeq>
inline VirusToAgentFun < TSeq > distribute_virus_randomly (
    epiworld_double prevalence,
    bool prevalence_as_proportion=true,
    std::vector< size_t > agents_ids={}
) 

This function takes a sequence of agents and randomly assigns a virus to each agent.

Template parameters:

  • TSeq The type of the sequence of agents.

Parameters:

  • agents The sequence of agents to distribute the virus to.

Returns:

A function object that assigns a virus to each agent randomly.


function distribute_virus_to_entities

template<typename TSeq>
inline VirusToAgentFun < TSeq > distribute_virus_to_entities (
    std::vector< double > prevalence,
    bool as_proportion=true
) 

Function template to distribute a virus to agents in each entity of a model.

Template parameters:

  • TSeq The sequence type used in the model.

Parameters:

  • prevalence A vector of prevalences for each entity in the model.
  • as_proportion Flag indicating whether the prevalences are given as proportions or absolute values.

Returns:

A lambda function that distributes the virus to agents in each entity of the model.


function distribute_virus_to_set

template<typename TSeq>
inline VirusToAgentFun < TSeq > distribute_virus_to_set (
    std::vector< size_t > agents_ids
) 

Distributes a virus to a set of agents.

This function takes a vector of agent IDs and returns a lambda function that can be used to distribute a virus to the specified agents.

Parameters:

  • agents_ids A vector of agent IDs representing the set of agents to distribute the virus to.

Returns:

A lambda function that takes a Virus object and a Model object and distributes the virus to the specified agents.



The documentation for this class was generated from the following file epiworld-src/include/epiworld/virus-distribute-meat.hpp