16 #ifndef INDIVIDUAL_HPP_
17 #define INDIVIDUAL_HPP_
19 #include "repast_hpc/TDataSource.h"
20 #include "repast_hpc/SharedContext.h"
21 #include "repast_hpc/Schedule.h"
22 #include "repast_hpc/Random.h"
23 #include "repast_hpc/Properties.h"
24 #include "repast_hpc/Utilities.h"
25 #include "repast_hpc/io.h"
26 #include "repast_hpc/logger.h"
27 #include "repast_hpc/initialize_random.h"
35 #include <boost/serialization/access.hpp>
36 #include <boost/lexical_cast.hpp>
37 #include <boost/mpi.hpp>
38 #include <boost/mpi/collectives.hpp>
57 template <
class Archive>
58 void serialize ( Archive & ar ,
const unsigned int version ) {
78 IndividualPackage(
int aId,
int aInitProc,
int aAgentType,
int aCurProc, repast::AgentId aHhId,
int aMunId,
79 char aGender,
int aAgeClass,
int aAge,
char aEducation,
char aHhRelationship,
char aSPStatus,
80 char aDrivingLicence, std::vector<Activity> aActChain,
long aHouse);
154 Individual( repast::AgentId
id , repast :: AgentId hh_id,
int municipality,
155 char gender,
int age_class,
char education,
char hh_relationship );
167 Individual( repast::AgentId
id , repast :: AgentId hh_id,
int municipality,
168 char gender,
int age_class,
int age,
char education );
181 Individual( repast::AgentId
id, repast::AgentId hh_id,
int municipality,
182 char gender,
int age_class,
char education,
char hh_relationship,
197 Individual( repast::AgentId
id, repast::AgentId hh_id,
int municipality,
198 char gender,
int age_class,
int age,
char education,
char hh_relationship,
215 Individual( repast::AgentId
id, repast::AgentId hh_id,
int municipality,
216 char gender,
int age_class,
char education,
char sps_status,
217 char driving_license,
char hh_relationship,
long house,
218 std::vector<Activity> act_chain );
235 Individual( repast::AgentId
id, repast::AgentId hh_id,
int municipality,
236 char gender,
int age_class,
int age,
char education,
char sps_status,
237 char driving_license,
char hh_relationship,
long house, std::vector<Activity> act_chain );
440 const repast::AgentId &
getId()
const {
char _sps_status
Socio-professional status.
Definition: Individual.hpp:136
char driving_license
driving license ownership of the individual
Definition: Individual.hpp:94
int cur_proc
individual curent process
Definition: Individual.hpp:85
char education
education level of the individual
Definition: Individual.hpp:91
int _municipality
Municipality of the individual.
Definition: Individual.hpp:131
A class representing activities.
Definition: Activity.hpp:27
The package structure for Individual agents.
Definition: Individual.hpp:48
VirtualBelgium's activity-based model related classes and methods.
void setMunicipality(int val)
Set individual's muncipality.
Definition: Individual.hpp:302
IndividualPackage()
Constructor.
Definition: Individual.cpp:16
char _hh_relationship
Household status relationship.
Definition: Individual.hpp:138
int init_proc
initial individual process
Definition: Individual.hpp:83
repast::AgentId & getHhId()
Return Repast AgentId of the individual's household.
Definition: Individual.hpp:395
long house
house of the individual, i.e. a node id
Definition: Individual.hpp:96
void initAge()
Initialize the age of an Individual.
Definition: Individual.cpp:153
Individual birthInd(long babyId)
Generate a baby by the individual.
Definition: Individual.cpp:224
int age
age of the individual
Definition: Individual.hpp:90
Random number generators and related tools.
char hh_relationship
household relationship status of the individual
Definition: Individual.hpp:92
const repast::AgentId & getId() const
Return the individual Repast agent id (required by Repast).
Definition: Individual.hpp:440
std::vector< Activity > act_chain
activity chain of the individual
Definition: Individual.hpp:95
char _driving_license
Driving license ownership.
Definition: Individual.hpp:137
bool isDying()
Death process.
Definition: Individual.cpp:193
repast::AgentId _id
Individual's Repast::AgentId.
Definition: Individual.hpp:129
repast::AgentId _hh_id
Household's Repast::AgentId.
Definition: Individual.hpp:130
char getEducation() const
Return individual's education level.
Definition: Individual.hpp:310
repast::AgentId getId() const
Return individual's agent id.
Definition: Individual.hpp:102
const repast::AgentId & getHhId() const
Return Repast AgentId of the individual's household.
Definition: Individual.hpp:400
int getAge() const
Return individual's age.
Definition: Individual.hpp:278
char getSpsStatus() const
Return individual's socio-professional status.
Definition: Individual.hpp:326
int age_class
age class of the individual
Definition: Individual.hpp:89
void serialize(Archive &ar, const unsigned int version)
Serializing procedure of the package.
Definition: Individual.hpp:58
char getGender() const
Return individual's gender.
Definition: Individual.hpp:246
Data related class and methods.
char getHhRelationship() const
Return individual's household relationship status (head, mate, child, adult).
Definition: Individual.hpp:358
char gender
gender of the individual
Definition: Individual.hpp:88
void setEducation(char val)
Set individual's education level.
Definition: Individual.hpp:318
void setHouse(long val)
Set individual's house localization (i.e. a node id, see Network class).
Definition: Individual.hpp:424
void setSpsStatus(char val)
Set individual's socio-professional status.
Definition: Individual.hpp:334
char _education
Education level (No diploma, Primary school, High School, Master degree).
Definition: Individual.hpp:135
int _age_class
Age class of the individual.
Definition: Individual.hpp:133
long getHouse() const
Return the house localization (i.e. a node id, see Network class).
Definition: Individual.hpp:416
friend class boost::serialization::access
Definition: Individual.hpp:125
int getMunicipality() const
Return the ins code of individual's municipality.
Definition: Individual.hpp:294
void setHhId(repast::AgentId val)
Set the Repast AgentId of the individual's household.
Definition: Individual.hpp:408
Individual(repast::AgentId id, repast::AgentId hh_id, int municipality, char gender, int age_class, char education, char hh_relationship)
Constructor (initialize every attributes but house, sps status, age and activity chain).
Definition: Individual.cpp:54
std::vector< Activity > _act_chain
Activity chain of the individual.
Definition: Individual.hpp:140
void setHhRelationship(char val)
Set individual's household relationship status (head, mate, child, adult).
Definition: Individual.hpp:366
int id
id of the individual
Definition: Individual.hpp:82
char sps_status
socio-professional status of the individual
Definition: Individual.hpp:93
bool givingbirth()
Determine whether the individual is giving birth to a baby.
Definition: Individual.cpp:209
void setActChain(std::vector< Activity > val)
Set individual's activity chain.
Definition: Individual.hpp:382
int agent_type
individual agent_type
Definition: Individual.hpp:84
friend class boost::serialization::access
Definition: Individual.hpp:50
char getDrivingLicense() const
Return individual's driving license ownership.
Definition: Individual.hpp:342
repast::AgentId hh_id
Repast agent id of the individual.
Definition: Individual.hpp:86
void aging()
Incrementing the age of an Individual.
Definition: Individual.cpp:133
int _age
Actual age of the individual.
Definition: Individual.hpp:134
void setDrivingLicense(char val)
Set individual's driving license ownership.
Definition: Individual.hpp:350
void setAgeClass(int val)
Set individual's age class.
Definition: Individual.hpp:270
std::vector< Activity > getActChain() const
Return individual's activity chain.
Definition: Individual.hpp:374
void addActChain(Activity val)
Add an activity to individual's activity chain.
Definition: Individual.hpp:390
int getAgeClass() const
Return individual's age class.
Definition: Individual.hpp:262
void setAge(int val)
Set individual's age.
Definition: Individual.hpp:286
int municipality
ins code of the individual's municipality
Definition: Individual.hpp:87
void setGender(char val)
Set individual's gender.
Definition: Individual.hpp:254
long _house
Network's node's id of the individual's house.
Definition: Individual.hpp:139
The individual agent class.
Definition: Individual.hpp:122
virtual ~Individual()
Destructor.
Definition: Individual.cpp:130
repast::AgentId & getId()
Return the individual Repast agent id (required by Repast).
Definition: Individual.hpp:432
char _gender
Gender of the individual (Male, Female).
Definition: Individual.hpp:132