Virtual Belgium  2.0
A micro-simulation platform for the Belgian population
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Household Class Reference

The household agent class. More...

#include <Household.hpp>

Public Member Functions

 Household (repast::AgentId id, int ins, std::vector< repast::AgentId > list_ind, std::string type, int n_children, int n_adults)
 Constructor. More...
 
 Household (repast::AgentId id, int ins, std::vector< repast::AgentId > list_ind, std::string type, int n_children, int n_adults, long house)
 Constructor. More...
 
virtual ~Household ()
 Destructor. More...
 
std::string getType () const
 Return the current household type. More...
 
void setType (std::string val)
 Set household's type. More...
 
int getNChildren () const
 Get the number of children. More...
 
void setNChildren (int val)
 Set the number of children. More...
 
int getNAdults () const
 Return the number of additional adults. More...
 
void setNAdults (int val)
 Set the number of additional adults. More...
 
std::vector< repast::AgentId > & getListInd ()
 Return a list of the household's member. More...
 
void setListInd (std::vector< repast::AgentId > val)
 Set the list of household members. More...
 
long getHouse () const
 Return the node id of the household's home. More...
 
void setHouse (long val)
 Set the node id of the household's home. More...
 
int getIns () const
 Return the ins code of the household's municipality. More...
 
void setIns (int val)
 Set the household ins code. More...
 
repast::AgentId & getId ()
 Return the household repast agent id (required by Repast). More...
 
const repast::AgentId & getId () const
 Return the household repast agent id (required by Repast). More...
 
std::vector< Individual * > getIndividuals (repast::SharedContext< Individual > &agentsInd)
 Return a vector of pointers to the individual agents belonging to the household. More...
 
void computeHhType (repast::SharedContext< Individual > &agentsInd)
 Determines the household type. More...
 
void removeIndFromList (repast::AgentId aId)
 Removes an individual from the household. More...
 
void localizeHouse (Data dataset)
 Choose randomly a node of the network inside of the household's municipality as the household's house. More...
 
void addBaby (repast::AgentId aBabyId)
 Adding a baby to the household. More...
 

Private Attributes

repast::AgentId _id
 household's unique id More...
 
int _ins
 household's municipality ins code More...
 
std::vector< repast::AgentId > _list_ind
 household's members id More...
 
std::string _type
 household's type More...
 
int _n_children
 household's number of children (< 18 years old) More...
 
int _n_adults
 household's number of additional adults More...
 
long _house
 id of the network's node where the household is living More...
 

Friends

class boost::serialization::access
 

Detailed Description

The household agent class.

This class implements the households agents in VirtualBelgium. Each household is characterized by

  • an id of the type repast::AgentId;
  • a type;
  • a list of household members;
  • a number of children;
  • a number of additional adults (i.e. household head and mate not included);
  • a housing unit;
  • a municipality.

Constructor & Destructor Documentation

Household::Household ( repast::AgentId  id,
int  ins,
std::vector< repast::AgentId >  list_ind,
std::string  type,
int  n_children,
int  n_adults 
)

Constructor.

Parameters
ida Repast agent id
insa ins code
list_inda list households members
typea household type
n_childrenthe number of children (< 18 years old)
n_adultsnumber of adults
Household::Household ( repast::AgentId  id,
int  ins,
std::vector< repast::AgentId >  list_ind,
std::string  type,
int  n_children,
int  n_adults,
long  house 
)

Constructor.

Parameters
ida Repast agent id
insa ins code
list_inda list households members
typea household type
n_childrenthe number of children (< 18 years old)
n_adultsnumber of adults
housea node id (see network class)
Household::~Household ( )
virtual

Destructor.

Member Function Documentation

void Household::addBaby ( repast::AgentId  aBabyId)

Adding a baby to the household.

Parameters
aBabyIdthe Repast individual agent id of the baby to add
void Household::computeHhType ( repast::SharedContext< Individual > &  agentsInd)

Determines the household type.

Parameters
agentsIndthe Repast shared context containing the individuals
long Household::getHouse ( ) const
inline

Return the node id of the household's home.

Returns
a node id (see Network class)
repast::AgentId& Household::getId ( )
inline

Return the household repast agent id (required by Repast).

Returns
the household repast agent id
const repast::AgentId& Household::getId ( ) const
inline

Return the household repast agent id (required by Repast).

Returns
the household repast agent id
vector< Individual * > Household::getIndividuals ( repast::SharedContext< Individual > &  agentsInd)

Return a vector of pointers to the individual agents belonging to the household.

Parameters
agentsIndthe Repast shared context containing the individuals
int Household::getIns ( ) const
inline

Return the ins code of the household's municipality.

Returns
a ins code
std::vector<repast::AgentId>& Household::getListInd ( )
inline

Return a list of the household's member.

Returns
a vector of repast individual agent id
int Household::getNAdults ( ) const
inline

Return the number of additional adults.

Returns
current number of additional adults
int Household::getNChildren ( ) const
inline

Get the number of children.

Returns
current number of children
std::string Household::getType ( ) const
inline

Return the current household type.

Returns
current household's type
void Household::localizeHouse ( Data  dataset)

Choose randomly a node of the network inside of the household's municipality as the household's house.

Parameters
datasetsimulation input data (see Data class)
void Household::removeIndFromList ( repast::AgentId  aId)

Removes an individual from the household.

Parameters
aIda repast individual agent id of the household's member to remove
void Household::setHouse ( long  val)
inline

Set the node id of the household's home.

Parameters
vala node id (see Network class)
void Household::setIns ( int  val)
inline

Set the household ins code.

Parameters
vala ins code
void Household::setListInd ( std::vector< repast::AgentId >  val)
inline

Set the list of household members.

Parameters
vala new list of individual repast agent id
void Household::setNAdults ( int  val)
inline

Set the number of additional adults.

Parameters
valnew number of additional adults in the household
void Household::setNChildren ( int  val)
inline

Set the number of children.

Parameters
valnew number of children
void Household::setType ( std::string  val)
inline

Set household's type.

Parameters
valnew household type

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Member Data Documentation

long Household::_house
private

id of the network's node where the household is living

repast::AgentId Household::_id
private

household's unique id

int Household::_ins
private

household's municipality ins code

std::vector<repast::AgentId> Household::_list_ind
private

household's members id

int Household::_n_adults
private

household's number of additional adults

int Household::_n_children
private

household's number of children (< 18 years old)

std::string Household::_type
private

household's type


The documentation for this class was generated from the following files: