Virtual Belgium  2.0
A micro-simulation platform for the Belgian population
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Activity.hpp
Go to the documentation of this file.
1 /*
2  * Activity.hpp
3  *
4  * Created on: Aug 14, 2012
5  * Author: jojo
6  */
7 
12 #ifndef ACTIVITY_HPP_
13 #define ACTIVITY_HPP_
14 
15 #include "Data.hpp"
16 #include "Random.hpp"
17 #include "Network.hpp"
18 #include "repast_hpc/RepastProcess.h"
19 #include <boost/serialization/access.hpp>
20 
22 
27 class Activity {
28 
30 
31 private:
32 
33  template<class Archive>
34  void serialize(Archive & ar, const unsigned int version ) {
35  ar & _type;
36  ar & _type_num;
37  ar & _end_time;
38  ar & _duration;
39  ar & _distance;
40  ar & _dur_trip;
41  ar & _nodeId;
42  }
43 
44 
45  char _type;
46  int _type_num;
47  float _end_time;
48  float _duration;
49  float _distance;
50  float _dur_trip;
51  long _nodeId;
52 
53 public:
54 
56 
59  Activity();
60 
62 
67  Activity(char aType);
68 
70 
79  Activity(char aType, long node, bool start, float startTime);
80 
82 
90  Activity(long nodeId, int nextActivityType);
91 
93 
99  Activity(long startNode, long endNode);
100 
102  virtual ~Activity() {};
103 
105 
108  float getEndTime() const {
109  return _end_time;
110  }
111 
113 
116  void setEndTime(float endTime) {
117  _end_time = endTime;
118  }
119 
121 
124  char getType() const {
125  return _type;
126  }
127 
129 
132  void setType(char type) {
133  _type = type;
134  }
135 
137 
140  long getNodeId() const {
141  return _nodeId;
142  }
143 
145 
148  void setNodeId(long nodeId) {
149  _nodeId = nodeId;
150  }
151 
153 
156  int getTypeNum() const {
157  return _type_num;
158  }
159 
161 
164  void setTypeNum(int typeNum) {
165  _type_num = typeNum;
166  }
167 
169 
172  float getDistance() const {
173  return _distance;
174  }
175 
177 
180  void setDistance(float distance) {
181  _distance = distance;
182  }
183 
185 
188  float getDuration() const {
189  return _duration;
190  }
191 
193 
196  void setDuration(float duration) {
197  _duration = duration;
198  }
199 
201 
204  float getDurationTrip() const {
205  return _dur_trip;
206  }
207 
209 
212  void setDurationTrip(float durationTrip) {
213  _dur_trip = durationTrip;
214  }
215 
216 };
217 
218 #endif /* ACTIVITY_HPP_ */
void setDurationTrip(float durationTrip)
Set the duration of the trip performed to reach the activity localization.
Definition: Activity.hpp:212
void serialize(Archive &ar, const unsigned int version)
Definition: Activity.hpp:34
Activity()
Constructor.
Definition: Activity.cpp:16
A class representing activities.
Definition: Activity.hpp:27
int getTypeNum() const
Return the activity type (integer coding).
Definition: Activity.hpp:156
float _dur_trip
duration of the trip to reach activity localization (in seconds)
Definition: Activity.hpp:50
void setDistance(float distance)
Set the distance performed to reach the activity localization.
Definition: Activity.hpp:180
virtual ~Activity()
Destructor.
Definition: Activity.hpp:102
long getNodeId() const
Return the node id where the activity is performed.
Definition: Activity.hpp:140
Random number generators and related tools.
long _nodeId
id of the node where the activity occurs.
Definition: Activity.hpp:51
void setEndTime(float endTime)
Set the end time of an activity.
Definition: Activity.hpp:116
void setType(char type)
Set the character type of the activity.
Definition: Activity.hpp:132
float _end_time
end time of the activity (in seconds).
Definition: Activity.hpp:47
void setDuration(float duration)
Set the duration of the trip to reach the activity localization.
Definition: Activity.hpp:196
float getDistance() const
Return the distance performed to reach the activity localization.
Definition: Activity.hpp:172
Data related class and methods.
float _distance
distance to reach the activity (in meters).
Definition: Activity.hpp:49
int _type_num
activity type (numerical encoding).
Definition: Activity.hpp:46
void setTypeNum(int typeNum)
Set the activity type (integer coding).
Definition: Activity.hpp:164
float getEndTime() const
Return the end time of the activity.
Definition: Activity.hpp:108
char getType() const
Return the character type of the activity.
Definition: Activity.hpp:124
float _duration
duration of the activity (in seconds).
Definition: Activity.hpp:48
Road network related class and methods (Heap, Node, Link and Network classes).
float getDurationTrip() const
Return the duration of the trip performed to reach the activity localization.
Definition: Activity.hpp:204
friend class boost::serialization::access
Definition: Activity.hpp:29
char _type
activity type (char encoding).
Definition: Activity.hpp:45
float getDuration() const
Return the duration of the activity.
Definition: Activity.hpp:188
void setNodeId(long nodeId)
Set the node id where the activity is performed.
Definition: Activity.hpp:148