Skip to content

Class Entity

template <typename TSeq>

ClassList > Entity

Groups of agents within a model.

  • #include <entity-bones.hpp>

Public Functions

Type Name
Entity (std::string name, EntityToAgentFun< TSeq > fun=nullptr)
Constructs an Entity object.
void add_agent (Agent< TSeq > & p, Model< TSeq > & model)
void add_agent (Agent< TSeq > * p, Model< TSeq > & model)
std::vector< size_t >::iterator begin ()
std::vector< size_t >::const_iterator begin () const
void distribute (Model< TSeq > * model)
std::vector< size_t >::iterator end ()
std::vector< size_t >::const_iterator end () const
const std::vector< size_t > & get_agents () const
const std::vector< size_t > & get_agents_ids () const
int get_id () noexcept const
std::vector< epiworld_double > & get_location ()
const std::string & get_name () noexcept const
void get_queue (epiworld_fast_int * init, epiworld_fast_int * post)
void get_state (epiworld_fast_int * init, epiworld_fast_int * post)
bool operator!= (const Entity< TSeq > & other) const
bool operator== (const Entity< TSeq > & other) const
size_t operator[] (size_t i)
void print () const
void rm_agent (size_t idx, Model< TSeq > & model)
void set_distribution (EntityToAgentFun< TSeq > fun)
void set_location (std::vector< epiworld_double > loc)
void set_queue (epiworld_fast_int init, epiworld_fast_int post)
void set_state (epiworld_fast_int init, epiworld_fast_int post)
size_t size () noexcept const
~Entity () = default

Public Functions Documentation

function Entity

Constructs an Entity object.

inline Entity::Entity (
    std::string name,
    EntityToAgentFun < TSeq > fun=nullptr
) 

This constructor initializes an Entity object with the specified parameters.

Parameters:

  • name The name of the entity.
  • fun A function pointer to a function that maps the entity to an agent.

function add_agent [1/2]

inline void Entity::add_agent (
    Agent < TSeq > & p,
    Model < TSeq > & model
) 

function add_agent [2/2]

inline void Entity::add_agent (
    Agent < TSeq > * p,
    Model < TSeq > & model
) 

function begin [1/2]

inline std::vector< size_t >::iterator Entity::begin () 

function begin [2/2]

inline std::vector< size_t >::const_iterator Entity::begin () const

function distribute

inline void Entity::distribute (
    Model < TSeq > * model
) 

function end [1/2]

inline std::vector< size_t >::iterator Entity::end () 

function end [2/2]

inline std::vector< size_t >::const_iterator Entity::end () const

function get_agents

inline const std::vector< size_t > & Entity::get_agents () const

function get_agents_ids

inline const std::vector< size_t > & Entity::get_agents_ids () const

function get_id

inline int Entity::get_id () noexcept const

function get_location

inline std::vector< epiworld_double > & Entity::get_location () 

function get_name

inline const std::string & Entity::get_name () noexcept const

function get_queue

inline void Entity::get_queue (
    epiworld_fast_int * init,
    epiworld_fast_int * post
) 

function get_state

inline void Entity::get_state (
    epiworld_fast_int * init,
    epiworld_fast_int * post
) 

function operator!=

inline bool Entity::operator!= (
    const Entity < TSeq > & other
) const

function operator==

inline bool Entity::operator== (
    const Entity < TSeq > & other
) const

function operator[]

size_t Entity::operator[] (
    size_t i
) 

function print

inline void Entity::print () const

function rm_agent

inline void Entity::rm_agent (
    size_t idx,
    Model < TSeq > & model
) 

function set_distribution

inline void Entity::set_distribution (
    EntityToAgentFun < TSeq > fun
) 

function set_location

inline void Entity::set_location (
    std::vector< epiworld_double > loc
) 

function set_queue

inline void Entity::set_queue (
    epiworld_fast_int init,
    epiworld_fast_int post
) 

function set_state

inline void Entity::set_state (
    epiworld_fast_int init,
    epiworld_fast_int post
) 

function size

inline size_t Entity::size () noexcept const

function ~Entity

Entity::~Entity () = default


The documentation for this class was generated from the following file epiworld-src/include/epiworld/entity-bones.hpp