![]() |
Virtual Belgium
2.0
A micro-simulation platform for the Belgian population
|
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 |
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
| 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.
| aType | the desired type of activity. |
| node | the network's node id of the previous activity. |
| start | a 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). |
| startTime | starting 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.
| nodeId | the node id where the activity take place |
| nextActivityType | type 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.
| endNode | id node where is last activity takes place |
| startNode | id node left to reach endNode |
|
inlinevirtual |
Destructor.
|
inline |
Return the distance performed to reach the activity localization.
|
inline |
Return the duration of the activity.
|
inline |
Return the duration of the trip performed to reach the activity localization.
|
inline |
Return the end time of the activity.
|
inline |
Return the node id where the activity is performed.
|
inline |
Return the character type of the activity.
|
inline |
Return the activity type (integer coding).
|
inlineprivate |
|
inline |
Set the distance performed to reach the activity localization.
| distance | the distance |
|
inline |
Set the duration of the trip to reach the activity localization.
| duration | the duration |
|
inline |
Set the duration of the trip performed to reach the activity localization.
| durationTrip | the duration of the trip |
|
inline |
Set the end time of an activity.
| endTime | end time of the activity |
|
inline |
Set the node id where the activity is performed.
| nodeId | the node id of the activity |
|
inline |
Set the character type of the activity.
| type | character type of the activity |
|
inline |
Set the activity type (integer coding).
| typeNum | an activity type |
|
friend |
|
private |
distance to reach the activity (in meters).
|
private |
duration of the trip to reach activity localization (in seconds)
|
private |
duration of the activity (in seconds).
|
private |
end time of the activity (in seconds).
|
private |
id of the node where the activity occurs.
|
private |
activity type (char encoding).
|
private |
activity type (numerical encoding).