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

A class representing activities. More...

#include <Activity.hpp>

Public Member Functions

 Activity ()
 Constructor. More...
 
 Activity (char aType)
 Default constructor. More...
 
 Activity (char aType, long node, bool start, float startTime)
 Constructor. More...
 
 Activity (long nodeId, int nextActivityType)
 Constructor of the first activity. More...
 
 Activity (long startNode, long endNode)
 Constructor of the last activity. More...
 
virtual ~Activity ()
 Destructor. More...
 
float getEndTime () const
 Return the end time of the activity. More...
 
void setEndTime (float endTime)
 Set the end time of an activity. More...
 
char getType () const
 Return the character type of the activity. More...
 
void setType (char type)
 Set the character type of the activity. More...
 
long getNodeId () const
 Return the node id where the activity is performed. More...
 
void setNodeId (long nodeId)
 Set the node id where the activity is performed. More...
 
int getTypeNum () const
 Return the activity type (integer coding). More...
 
void setTypeNum (int typeNum)
 Set the activity type (integer coding). More...
 
float getDistance () const
 Return the distance performed to reach the activity localization. More...
 
void setDistance (float distance)
 Set the distance performed to reach the activity localization. More...
 
float getDuration () const
 Return the duration of the activity. More...
 
void setDuration (float duration)
 Set the duration of the trip to reach the activity localization. More...
 
float getDurationTrip () const
 Return the duration of the trip performed to reach the activity localization. More...
 
void setDurationTrip (float durationTrip)
 Set the duration of the trip performed to reach the activity localization. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

char _type
 activity type (char encoding). More...
 
int _type_num
 activity type (numerical encoding). More...
 
float _end_time
 end time of the activity (in seconds). More...
 
float _duration
 duration of the activity (in seconds). More...
 
float _distance
 distance to reach the activity (in meters). More...
 
float _dur_trip
 duration of the trip to reach activity localization (in seconds) More...
 
long _nodeId
 id of the node where the activity occurs. More...
 

Friends

class boost::serialization::access
 

Detailed Description

A class representing activities.

This class represents an activity performed by an individual. An activity is defined by a type, a duration, an end time and a localization. The methods implemented allows to generate an activity and determining its characteristics

Constructor & Destructor Documentation

Activity::Activity ( )

Constructor.

This constructor generate a default activity, i.e. no type, no end time, localized at (0,0).

Activity::Activity ( char  aType)

Default constructor.

This constructor generate an activity of type aType, and randomly initialize the end time and localization.

/param aType the activity type

Activity::Activity ( char  aType,
long  node,
bool  start,
float  startTime 
)

Constructor.

This constructor generate an activity of type aType and compute its end time and localization.

Parameters
aTypethe desired type of activity.
nodethe network's node id of the previous activity.
starta boolean indicating whether the node is where the activity is taking place (false) or the node is the starting place from where the activity's destination is computed (true).
startTimestarting time of the activity (used to compute the end time)
Activity::Activity ( long  nodeId,
int  nextActivityType 
)

Constructor of the first activity.

This constructor should be used to generate the first activity of an agent, i.e. being at home. The house departure time depends on the type of the first activity to be performed after leaving the house.

Parameters
nodeIdthe node id where the activity take place
nextActivityTypetype of the first activity performed by the individual after leaving home
Activity::Activity ( long  startNode,
long  endNode 
)

Constructor of the last activity.

Constructor of the last activity performed by an Individual, i.e. returning home.

Parameters
endNodeid node where is last activity takes place
startNodeid node left to reach endNode
virtual Activity::~Activity ( )
inlinevirtual

Destructor.

Member Function Documentation

float Activity::getDistance ( ) const
inline

Return the distance performed to reach the activity localization.

Returns
a distance
float Activity::getDuration ( ) const
inline

Return the duration of the activity.

Returns
a duration
float Activity::getDurationTrip ( ) const
inline

Return the duration of the trip performed to reach the activity localization.

Returns
a trip duration
float Activity::getEndTime ( ) const
inline

Return the end time of the activity.

Returns
the end time of the activity
long Activity::getNodeId ( ) const
inline

Return the node id where the activity is performed.

Returns
a node id
char Activity::getType ( ) const
inline

Return the character type of the activity.

Returns
type of the activity, character coding
int Activity::getTypeNum ( ) const
inline

Return the activity type (integer coding).

Returns
the type of the activity, integer coding
template<class Archive >
void Activity::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate
void Activity::setDistance ( float  distance)
inline

Set the distance performed to reach the activity localization.

Parameters
distancethe distance
void Activity::setDuration ( float  duration)
inline

Set the duration of the trip to reach the activity localization.

Parameters
durationthe duration
void Activity::setDurationTrip ( float  durationTrip)
inline

Set the duration of the trip performed to reach the activity localization.

Parameters
durationTripthe duration of the trip
void Activity::setEndTime ( float  endTime)
inline

Set the end time of an activity.

Parameters
endTimeend time of the activity
void Activity::setNodeId ( long  nodeId)
inline

Set the node id where the activity is performed.

Parameters
nodeIdthe node id of the activity
void Activity::setType ( char  type)
inline

Set the character type of the activity.

Parameters
typecharacter type of the activity
void Activity::setTypeNum ( int  typeNum)
inline

Set the activity type (integer coding).

Parameters
typeNuman activity type

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Member Data Documentation

float Activity::_distance
private

distance to reach the activity (in meters).

float Activity::_dur_trip
private

duration of the trip to reach activity localization (in seconds)

float Activity::_duration
private

duration of the activity (in seconds).

float Activity::_end_time
private

end time of the activity (in seconds).

long Activity::_nodeId
private

id of the node where the activity occurs.

char Activity::_type
private

activity type (char encoding).

int Activity::_type_num
private

activity type (numerical encoding).


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