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

Main VirtualBelgium class. More...

#include <Model.hpp>

Public Member Functions

 Model (boost::mpi::communicator *comm, repast::Properties &props)
 Constructor. More...
 
 ~Model ()
 Destructor. More...
 
void initSchedule ()
 Initialisation of the simulation's schedule. More...
 
void step ()
 Implements one step of the simulation. More...
 
void computeActivityChains ()
 Generates the travel demand forecasting via activity chains model. More...
 
void computePopulationEvolution ()
 Computes the socio-demographic evolution of the population. More...
 
void resetAggregateOutputs ()
 Reset every aggregate data set to 0. More...
 
void writeIndividuals ()
 Save the agents state of the current process' Individual shared context in a file. More...
 
void writeActivityChains ()
 Write the Individual agents plans to an XML file that can be processed with MATSim. More...
 
void saveActivityLocalizationAndTime ()
 Save activities localization and when they are performed. More...
 
void saveODMatrix ()
 Save origin-destination matrices for several time slots. More...
 
void providePackage (Individual *agent, std::vector< IndividualPackage > &out)
 Used by Repast HPC to exchange Individual agents between process. More...
 
void providePackage (Household *agent, std::vector< HouseholdPackage > &out)
 Used by Repast HPC to exchange Households agents between process. More...
 
IndividualcreateAgent (IndividualPackage package)
 Used by Repast HPC to create an Individual Agent from an IndividualPackage. More...
 
HouseholdcreateAgent (HouseholdPackage package)
 Used by Repast HPC to create an Household Agent from an HouseholdPackage. More...
 
void provideContent (repast::AgentRequest req, std::vector< IndividualPackage > &out)
 Used by Repast HPC exchange Individuals agents between processes. More...
 
void provideContent (repast::AgentRequest req, std::vector< HouseholdPackage > &out)
 Used by Repast HPC exchange Households agents between processes. More...
 
void updateAgent (IndividualPackage package)
 Used by Repast HPC to update a local copy of an Individual agent with the data of the actual agent. More...
 
void updateAgent (HouseholdPackage package)
 Used by Repast HPC to update a local copy of an Household agent with the data of the actual agent. More...
 

Public Attributes

repast::SharedContext< Individualagents
 Shared context containing the individual agents of the simulation. More...
 
repast::SharedContext< HouseholdagentsHh
 Shared context containing the household agents of the simulation. More...
 

Private Attributes

int _proc
 rank of the model's process More...
 
repast::Properties _props
 properties of the model More...
 
repast::SVDataSet * _data_out
 aggregated output data set More...
 
AggregateSum_deathMenSum
 aggregated number of death (men) More...
 
AggregateSum_deathWomenSum
 aggregated number of death (women) More...
 
AggregateSum_babyBoySum
 aggregated number of death More...
 
AggregateSum_babyGirlSum
 aggregated number of death More...
 
AggregateSum_menSum
 aggregated number of men More...
 
AggregateSum_girlSum
 aggregated number of women More...
 
AggregateSum_age0MSum
 aggregated number of men in age class 0 More...
 
AggregateSum_age1MSum
 aggregated number of men in age class 1 More...
 
AggregateSum_age2MSum
 aggregated number of men in age class 2 More...
 
AggregateSum_age3MSum
 aggregated number of men in age class 3 More...
 
AggregateSum_age4MSum
 aggregated number of men in age class 4 More...
 
AggregateSum_age5MSum
 aggregated number of men in age class 5 More...
 
AggregateSum_age6MSum
 aggregated number of men in age class 6 More...
 
AggregateSum_age7MSum
 aggregated number of men in age class 7 More...
 
AggregateSum_age8MSum
 aggregated number of men in age class 8 More...
 
AggregateSum_age9MSum
 aggregated number of men in age class 9 More...
 
AggregateSum_age10MSum
 aggregated number of men in age class 10 More...
 
AggregateSum_age0WSum
 aggregated number of women in age class 0 More...
 
AggregateSum_age1WSum
 aggregated number of women in age class 1 More...
 
AggregateSum_age2WSum
 aggregated number of women in age class 2 More...
 
AggregateSum_age3WSum
 aggregated number of women in age class 3 More...
 
AggregateSum_age4WSum
 aggregated number of women in age class 4 More...
 
AggregateSum_age5WSum
 aggregated number of women in age class 5 More...
 
AggregateSum_age6WSum
 aggregated number of women in age class 6 More...
 
AggregateSum_age7WSum
 aggregated number of women in age class 7 More...
 
AggregateSum_age8WSum
 aggregated number of women in age class 8 More...
 
AggregateSum_age9WSum
 aggregated number of women in age class 9 More...
 
AggregateSum_age10WSum
 aggregated number of women in age class 10 More...
 
unsigned int _n_activity_start_time_x_ins [589][24]
 Number of starting activities time of the day by municipality. More...
 
unsigned int _n_activity_end_time_x_ins [589][24]
 Number of ending activities performed / time of the day by municipality (also trip start) More...
 
unsigned int _origin_destination_matrix [589][589]
 Origin-Destination matrix between municipalities. More...
 
unsigned int _origin_destination_matrix_mp [589][589]
 Origin-Destination matrix between municipalities (morning peak: 7:00 - 9:00) More...
 
unsigned int _origin_destination_matrix_ep [589][589]
 Origin-Destination matrix between municipalities (evening peak: 15:00 - 19:00) More...
 
int _babyId
 Id initialized for the babies. More...
 

Friends

class ProviderReceiver
 

Detailed Description

Main VirtualBelgium class.

This class contains the scheduler and responsible for data aggregation. It is the core of VirtualBelgium.

Constructor & Destructor Documentation

Model::Model ( boost::mpi::communicator *  comm,
repast::Properties &  props 
)

Constructor.

Model::~Model ( )

Destructor.

Member Function Documentation

void Model::computeActivityChains ( )

Generates the travel demand forecasting via activity chains model.

void Model::computePopulationEvolution ( )

Computes the socio-demographic evolution of the population.

Individual * Model::createAgent ( IndividualPackage  package)

Used by Repast HPC to create an Individual Agent from an IndividualPackage.

Parameters
packagea package containing an individual agent
Returns
an individual agent
Household * Model::createAgent ( HouseholdPackage  package)

Used by Repast HPC to create an Household Agent from an HouseholdPackage.

Parameters
packagea package containing an household agent
Returns
an household agent
void Model::initSchedule ( )

Initialisation of the simulation's schedule.

void Model::provideContent ( repast::AgentRequest  req,
std::vector< IndividualPackage > &  out 
)

Used by Repast HPC exchange Individuals agents between processes.

Parameters
reqthe set of requested agents
outthe vector containing the packaged requested agents
void Model::provideContent ( repast::AgentRequest  req,
std::vector< HouseholdPackage > &  out 
)

Used by Repast HPC exchange Households agents between processes.

Parameters
reqthe set of requested agents
outthe vector containing the packaged requested agents
void Model::providePackage ( Individual agent,
std::vector< IndividualPackage > &  out 
)

Used by Repast HPC to exchange Individual agents between process.

Parameters
agentthe agent to exchange
outthe package containing the agent to exchange
void Model::providePackage ( Household agent,
std::vector< HouseholdPackage > &  out 
)

Used by Repast HPC to exchange Households agents between process.

Parameters
agentthe agent to exchange
outthe package containing the agent to exchange
void Model::resetAggregateOutputs ( )

Reset every aggregate data set to 0.

void Model::saveActivityLocalizationAndTime ( )

Save activities localization and when they are performed.

void Model::saveODMatrix ( )

Save origin-destination matrices for several time slots.

void Model::step ( )

Implements one step of the simulation.

void Model::updateAgent ( IndividualPackage  package)

Used by Repast HPC to update a local copy of an Individual agent with the data of the actual agent.

Parameters
packagea package containing the updated informations
void Model::updateAgent ( HouseholdPackage  package)

Used by Repast HPC to update a local copy of an Household agent with the data of the actual agent.

Parameters
pacjagea package containing the updated informations
void Model::writeActivityChains ( )

Write the Individual agents plans to an XML file that can be processed with MATSim.

void Model::writeIndividuals ( )

Save the agents state of the current process' Individual shared context in a file.

Friends And Related Function Documentation

friend class ProviderReceiver
friend

Member Data Documentation

AggregateSum* Model::_age0MSum
private

aggregated number of men in age class 0

AggregateSum* Model::_age0WSum
private

aggregated number of women in age class 0

AggregateSum* Model::_age10MSum
private

aggregated number of men in age class 10

AggregateSum* Model::_age10WSum
private

aggregated number of women in age class 10

AggregateSum* Model::_age1MSum
private

aggregated number of men in age class 1

AggregateSum* Model::_age1WSum
private

aggregated number of women in age class 1

AggregateSum* Model::_age2MSum
private

aggregated number of men in age class 2

AggregateSum* Model::_age2WSum
private

aggregated number of women in age class 2

AggregateSum* Model::_age3MSum
private

aggregated number of men in age class 3

AggregateSum* Model::_age3WSum
private

aggregated number of women in age class 3

AggregateSum* Model::_age4MSum
private

aggregated number of men in age class 4

AggregateSum* Model::_age4WSum
private

aggregated number of women in age class 4

AggregateSum* Model::_age5MSum
private

aggregated number of men in age class 5

AggregateSum* Model::_age5WSum
private

aggregated number of women in age class 5

AggregateSum* Model::_age6MSum
private

aggregated number of men in age class 6

AggregateSum* Model::_age6WSum
private

aggregated number of women in age class 6

AggregateSum* Model::_age7MSum
private

aggregated number of men in age class 7

AggregateSum* Model::_age7WSum
private

aggregated number of women in age class 7

AggregateSum* Model::_age8MSum
private

aggregated number of men in age class 8

AggregateSum* Model::_age8WSum
private

aggregated number of women in age class 8

AggregateSum* Model::_age9MSum
private

aggregated number of men in age class 9

AggregateSum* Model::_age9WSum
private

aggregated number of women in age class 9

AggregateSum* Model::_babyBoySum
private

aggregated number of death

AggregateSum* Model::_babyGirlSum
private

aggregated number of death

int Model::_babyId
private

Id initialized for the babies.

repast::SVDataSet* Model::_data_out
private

aggregated output data set

AggregateSum* Model::_deathMenSum
private

aggregated number of death (men)

AggregateSum* Model::_deathWomenSum
private

aggregated number of death (women)

AggregateSum* Model::_girlSum
private

aggregated number of women

AggregateSum* Model::_menSum
private

aggregated number of men

unsigned int Model::_n_activity_end_time_x_ins[589][24]
private

Number of ending activities performed / time of the day by municipality (also trip start)

unsigned int Model::_n_activity_start_time_x_ins[589][24]
private

Number of starting activities time of the day by municipality.

unsigned int Model::_origin_destination_matrix[589][589]
private

Origin-Destination matrix between municipalities.

unsigned int Model::_origin_destination_matrix_ep[589][589]
private

Origin-Destination matrix between municipalities (evening peak: 15:00 - 19:00)

unsigned int Model::_origin_destination_matrix_mp[589][589]
private

Origin-Destination matrix between municipalities (morning peak: 7:00 - 9:00)

int Model::_proc
private

rank of the model's process

repast::Properties Model::_props
private

properties of the model

repast::SharedContext<Individual> Model::agents

Shared context containing the individual agents of the simulation.

repast::SharedContext<Household> Model::agentsHh

Shared context containing the household agents of the simulation.


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