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

A data class. More...

#include <Data.hpp>

Public Member Functions

 Data (repast::Properties aProps)
 Constructor. More...
 
virtual ~Data ()
 Destructor. More...
 
void read_mun_age_men ()
 Read the age's distribution by municipality for the men. More...
 
void read_mun_age_women ()
 Read the age's distribution by municipality for the women. More...
 
void read_death_age ()
 Read the death probability by age and gender. More...
 
void read_birth_age ()
 Read the birth probability by age and the probability to have a boy or a girl. More...
 
void read_node_ins ()
 Read the municipalities's node. More...
 
void read_activity_cdb ()
 Read the activities' codebook. More...
 
void read_network ()
 Read the road network. More...
 
void read_distribution_parameters_distance ()
 Read the distribution parameters for activities' distance. More...
 
void read_distribution_parameters_house_tdep ()
 Read the distribution parameters for activities' house time departure. More...
 
void read_distribution_parameters_start_duration ()
 Read the distribution parameters for activities' starting time x duration. More...
 
void read_distribution_parameters_distance_x_duration_trip ()
 Read the distribution parameters for distance x duration of a trip. More...
 
void read_indicators ()
 Read the various indicators used by the activity localization model. More...
 
void read_ins_id_mun ()
 Read the codebooks of ins code and municipality id (1 to 589). More...
 
std::vector< long int > getMunAge (int municipality, char gender)
 Get the age's distribution of a municipality for a given gender. More...
 
float getDeathProba (char gender, int age)
 Compute and return the death's probability of an individual. More...
 
float getBirthProba (int age)
 Compute and return the birth's probability of an individual by women's age. More...
 
float getBirthsex (int age)
 Compute and return the probability to be a boy or girl. More...
 
std::vector< long > getNodesIdFromIns (int aIns)
 Return the list of node of a given municipality identified by its INS code. More...
 
long getOneNodeIdFromIns (int aIns)
 Return one node of a given municipality identified by its INS code. More...
 
dist_param_mixture getActDistParDist (int aActivityType)
 Return the distance's distribution's parameter of a given activity type. More...
 
dist_param_mixture getActHouseTDepParDist (int aActivityType)
 Return the house departure time distribution's parameter for a given activity type. More...
 
dist_param_mixture getActDurationCondiStartParDist (int aActivityType, int aStartTime)
 Return the activity duration distribution's parameter conditional to a starting time for a given activity type. More...
 
dist_param_mixture getDurationCondiDistTripParDist (int aDistance)
 Return a journey duration distribution's parameters conditional to the journey distance. More...
 
const NetworkgetNetwork () const
 Return the road network. More...
 
const std::map< char, int > & getMapActCharToInt () const
 Return the character to integer activity code-book. More...
 
const std::map< int, char > & getMapActIntToChar () const
 Return the integer to character activity code-book. More...
 
const std::map< int, int > & getMapInsIdMun () const
 Return the codebook of municipalities ins code to their id (1 to 589). More...
 
const std::map< int, int > & getMapIdMunIns () const
 Return the codebook of municipalities id (1 to 589) to their ins code. More...
 

Private Attributes

std::map< int, std::vector
< long > > 
_mun_age_men
 men's age distribution by municipality More...
 
std::map< int, std::vector
< long > > 
_mun_age_women
 women's age distribution by municipality More...
 
std::map< int, float > _death_age_men
 death's probability for a man by age More...
 
std::map< int, float > _death_age_women
 death's probability for a woman by age More...
 
std::map< int, float > _birth_age
 birth's probability by women's age More...
 
std::map< int, float > _birth_men
 birth's probability to have a boy More...
 
std::multimap< int, long > _map_ins_node
 set of node by municipalities' ins code More...
 
std::map< long, int > _map_node_ins
 ins code of node More...
 
std::map< int, char > _map_act_intToChar
 activities' code-book (from integer to character encoding) More...
 
std::map< char, int > _map_act_charToInt
 activities' code-book (from character to integer encoding) More...
 
std::map< int, dist_param_mixture_map_act_dist_par_dist
 distribution parameters for activities' distance (log normal) More...
 
std::map< int, dist_param_mixture_map_act_tdep_par_dist
 distribution parameters for activities' house departure time (log normal) More...
 
std::map< int,
dist_param_mixture_2d
_map_act_start_x_dur
 distribution parameters for activities' log(starting time) x log(duration) More...
 
dist_param_mixture_2d _act_dist_x_dur_trip_dist
 distribution parameters for log(distance) x log(duration of the trip) More...
 
Network _network
 road network More...
 
std::map< int, long > _indic_mun_size
 size indicator of a municipality More...
 
std::map< int, int > _map_ins_id_mun
 map of ins code (key) x id of municipality (value) More...
 
std::map< int, int > _map_id_mun_ins
 map of id of municipality (key) x ins code (value) More...
 
repast::Properties _props
 properties of simulation More...
 

Friends

class Singleton< Data >
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< Data >
static void makeInstance (repast::Properties aProps)
 Generates a singleton instance of a T object. More...
 
static DatagetInstance ()
 Return the generated, unique, instance of a T object (if already instanciated). More...
 
static void kill ()
 Free the memory. More...
 
- Protected Member Functions inherited from Singleton< Data >
 Singleton ()
 Constructor. More...
 
 ~Singleton ()
 Destructor. More...
 

Detailed Description

A data class.

A data class reading and producing all the inputs required by the various models of Virtual Belgium. This class is implemented using a singleton design pattern.

Constructor & Destructor Documentation

Data::Data ( repast::Properties  aProps)
inline

Constructor.

The constructor initialize all the private members of a Data object.

Parameters
aPropsthe properties of VirtualBelgium, including paths to data files
virtual Data::~Data ( )
inlinevirtual

Destructor.

Member Function Documentation

dist_param_mixture Data::getActDistParDist ( int  aActivityType)

Return the distance's distribution's parameter of a given activity type.

Parameters
aActivityTypethe type of an activity (integer coding)
Returns
a mixture of univariate log-normal distributions
dist_param_mixture Data::getActDurationCondiStartParDist ( int  aActivityType,
int  aStartTime 
)

Return the activity duration distribution's parameter conditional to a starting time for a given activity type.

Parameters
aActivityTypetype of an activity, integer coding
aStartTimestarting time of an activity
Returns
a mixture of univariate log-normal distributions
dist_param_mixture Data::getActHouseTDepParDist ( int  aActivityType)

Return the house departure time distribution's parameter for a given activity type.

Parameters
aActivityTypethe type of an activity (integer coding)
Returns
a mixture of univariate log-normal distributions
float Data::getBirthProba ( int  age)

Compute and return the birth's probability of an individual by women's age.

Parameters
agethe age of the women
Returns
a probability of having a child
float Data::getBirthsex ( int  age)

Compute and return the probability to be a boy or girl.

Parameters
agethe age of the mother
Returns
a probability to be a boy
float Data::getDeathProba ( char  gender,
int  age 
)

Compute and return the death's probability of an individual.

Parameters
genderthe gender of the individual
agethe age of the individual
Returns
a probability of dying
dist_param_mixture Data::getDurationCondiDistTripParDist ( int  aDistance)

Return a journey duration distribution's parameters conditional to the journey distance.

Parameters
aDistancethe distance performed
Returns
a mixture of univariate log-normal distributions
const std::map<char, int>& Data::getMapActCharToInt ( ) const
inline

Return the character to integer activity code-book.

Returns
character to integer activity code-book
const std::map<int, char>& Data::getMapActIntToChar ( ) const
inline

Return the integer to character activity code-book.

Returns
integer to character activity code-book.
const std::map<int, int>& Data::getMapIdMunIns ( ) const
inline

Return the codebook of municipalities id (1 to 589) to their ins code.

Returns
the codebook of municipalities id (1 to 589) to their ins code
const std::map<int, int>& Data::getMapInsIdMun ( ) const
inline

Return the codebook of municipalities ins code to their id (1 to 589).

Returns
the codebook of municipalities ins code to their id (1 to 589)
vector< long int > Data::getMunAge ( int  municipality,
char  gender 
)

Get the age's distribution of a municipality for a given gender.

Parameters
municipalitythe INS code of a municipality
genderthe gender of an individual
Returns
a vector of age's distribution
const Network& Data::getNetwork ( ) const
inline

Return the road network.

Returns
the road network
vector< long > Data::getNodesIdFromIns ( int  aIns)

Return the list of node of a given municipality identified by its INS code.

Parameters
aInsthe INS code of the municipality of interest
Returns
a vector containing the node's id of the municipality
long Data::getOneNodeIdFromIns ( int  aIns)

Return one node of a given municipality identified by its INS code.

Parameters
aInsthe INS code of the municipality of interest
Returns
the node's id of the municipality
void Data::read_activity_cdb ( )

Read the activities' codebook.

void Data::read_birth_age ( )

Read the birth probability by age and the probability to have a boy or a girl.

void Data::read_death_age ( )

Read the death probability by age and gender.

void Data::read_distribution_parameters_distance ( )

Read the distribution parameters for activities' distance.

void Data::read_distribution_parameters_distance_x_duration_trip ( )

Read the distribution parameters for distance x duration of a trip.

void Data::read_distribution_parameters_house_tdep ( )

Read the distribution parameters for activities' house time departure.

void Data::read_distribution_parameters_start_duration ( )

Read the distribution parameters for activities' starting time x duration.

void Data::read_indicators ( )

Read the various indicators used by the activity localization model.

void Data::read_ins_id_mun ( )

Read the codebooks of ins code and municipality id (1 to 589).

void Data::read_mun_age_men ( )

Read the age's distribution by municipality for the men.

void Data::read_mun_age_women ( )

Read the age's distribution by municipality for the women.

void Data::read_network ( )

Read the road network.

void Data::read_node_ins ( )

Read the municipalities's node.

Friends And Related Function Documentation

friend class Singleton< Data >
friend

Member Data Documentation

dist_param_mixture_2d Data::_act_dist_x_dur_trip_dist
private

distribution parameters for log(distance) x log(duration of the trip)

std::map<int, float> Data::_birth_age
private

birth's probability by women's age

std::map<int, float> Data::_birth_men
private

birth's probability to have a boy

std::map<int, float> Data::_death_age_men
private

death's probability for a man by age

std::map<int, float> Data::_death_age_women
private

death's probability for a woman by age

std::map<int, long> Data::_indic_mun_size
private

size indicator of a municipality

std::map<char,int> Data::_map_act_charToInt
private

activities' code-book (from character to integer encoding)

std::map<int,dist_param_mixture> Data::_map_act_dist_par_dist
private

distribution parameters for activities' distance (log normal)

std::map<int,char> Data::_map_act_intToChar
private

activities' code-book (from integer to character encoding)

std::map<int, dist_param_mixture_2d> Data::_map_act_start_x_dur
private

distribution parameters for activities' log(starting time) x log(duration)

std::map<int,dist_param_mixture> Data::_map_act_tdep_par_dist
private

distribution parameters for activities' house departure time (log normal)

std::map<int, int> Data::_map_id_mun_ins
private

map of id of municipality (key) x ins code (value)

std::map<int, int> Data::_map_ins_id_mun
private

map of ins code (key) x id of municipality (value)

std::multimap<int, long> Data::_map_ins_node
private

set of node by municipalities' ins code

std::map<long,int> Data::_map_node_ins
private

ins code of node

std::map<int, std::vector<long> > Data::_mun_age_men
private

men's age distribution by municipality

std::map<int, std::vector<long> > Data::_mun_age_women
private

women's age distribution by municipality

Network Data::_network
private

road network

repast::Properties Data::_props
private

properties of simulation


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