SUMO - Simulation of Urban MObility
MSDevice_Tripinfo.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A device which collects info on the vehicle trip
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSDevice_Tripinfo_h
23 #define MSDevice_Tripinfo_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include "MSDevice.h"
36 #include <utils/common/SUMOTime.h>
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class SUMOVehicle;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
54 class MSDevice_Tripinfo : public MSDevice {
55 public:
66  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
67 
68 
69 
70 public:
73 
74 
75 
78 
87  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
88 
89 
99 
100 
109  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason);
111 
112 
113 
120  void generateOutput() const;
121 
122 
123 
124 private:
130  MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id);
131 
132 
135 
136 
137 private:
139  std::string myDepartLane;
140 
143 
146 
148  unsigned int myWaitingSteps;
149 
152 
154  std::string myArrivalLane;
155 
158 
161 
162 
163 
164 private:
167 
170 
171 
172 };
173 
174 
175 #endif
176 
177 /****************************************************************************/
178 
SUMOTime myArrivalTime
The vehicle's arrival time.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
Notification
Definition of a vehicle state.
void generateOutput() const
Called on writing tripinfo output.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
SUMOReal myArrivalPos
The position on the lane the vehicle arrived at.
~MSDevice_Tripinfo()
Destructor.
MSDevice_Tripinfo & operator=(const MSDevice_Tripinfo &)
Invalidated assignment operator.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves.
SUMOReal myDepartSpeed
The speed on departure.
SUMOReal myArrivalSpeed
The speed when arriving.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
Representation of a vehicle.
Definition: SUMOVehicle.h:64
unsigned int myWaitingSteps
The overall number of waiting steps.
SUMOReal myDepartPos
The position on the lane the vehicle departed at.
std::string myDepartLane
The lane the vehicle departed at.
Abstract in-vehicle device.
Definition: MSDevice.h:69
std::string myArrivalLane
The lane the vehicle arrived at.
MSDevice_Tripinfo()
dummy constructor
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Saves arrival info.
#define SUMOReal
Definition: config.h:215