![]() |
Virtual Belgium
2.0
A micro-simulation platform for the Belgian population
|
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 |
The household agent class.
This class implements the households agents in VirtualBelgium. Each household is characterized by
| Household::Household | ( | repast::AgentId | id, |
| int | ins, | ||
| std::vector< repast::AgentId > | list_ind, | ||
| std::string | type, | ||
| int | n_children, | ||
| int | n_adults | ||
| ) |
Constructor.
| id | a Repast agent id |
| ins | a ins code |
| list_ind | a list households members |
| type | a household type |
| n_children | the number of children (< 18 years old) |
| n_adults | number 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.
| id | a Repast agent id |
| ins | a ins code |
| list_ind | a list households members |
| type | a household type |
| n_children | the number of children (< 18 years old) |
| n_adults | number of adults |
| house | a node id (see network class) |
|
virtual |
Destructor.
| void Household::addBaby | ( | repast::AgentId | aBabyId | ) |
Adding a baby to the household.
| aBabyId | the Repast individual agent id of the baby to add |
| void Household::computeHhType | ( | repast::SharedContext< Individual > & | agentsInd | ) |
Determines the household type.
| agentsInd | the Repast shared context containing the individuals |
|
inline |
Return the node id of the household's home.
|
inline |
Return the household repast agent id (required by Repast).
|
inline |
Return the household repast agent id (required by Repast).
| vector< Individual * > Household::getIndividuals | ( | repast::SharedContext< Individual > & | agentsInd | ) |
Return a vector of pointers to the individual agents belonging to the household.
| agentsInd | the Repast shared context containing the individuals |
|
inline |
Return the ins code of the household's municipality.
|
inline |
Return a list of the household's member.
|
inline |
Return the number of additional adults.
|
inline |
Get the number of children.
|
inline |
Return the current household type.
| void Household::localizeHouse | ( | Data | dataset | ) |
Choose randomly a node of the network inside of the household's municipality as the household's house.
| dataset | simulation input data (see Data class) |
| void Household::removeIndFromList | ( | repast::AgentId | aId | ) |
Removes an individual from the household.
| aId | a repast individual agent id of the household's member to remove |
|
inline |
Set the node id of the household's home.
| val | a node id (see Network class) |
|
inline |
Set the household ins code.
| val | a ins code |
|
inline |
Set the list of household members.
| val | a new list of individual repast agent id |
|
inline |
Set the number of additional adults.
| val | new number of additional adults in the household |
|
inline |
Set the number of children.
| val | new number of children |
|
inline |
Set household's type.
| val | new household type |
|
friend |
|
private |
id of the network's node where the household is living
|
private |
household's unique id
|
private |
household's municipality ins code
|
private |
household's members id
|
private |
household's number of additional adults
|
private |
household's number of children (< 18 years old)
|
private |
household's type