SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_Tripinfo.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A device which collects info on the vehicle trip
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSDevice_Tripinfo_h
22 #define MSDevice_Tripinfo_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include "MSDevice.h"
35 #include <utils/common/SUMOTime.h>
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class SUMOVehicle;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
53 class MSDevice_Tripinfo : public MSDevice {
54 public:
65  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
66 
67 
71  static const std::type_info& getTypeInfo() {
72  return typeid(MSDevice_Tripinfo);
73  }
74 
75 
76 
77 public:
80 
81 
82 
85 
95  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
96  SUMOReal newPos, SUMOReal newSpeed);
97 
98 
108 
109 
118  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
121 
122 
129  void generateOutput() const;
130 
131 
132 private:
138  MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id);
139 
140 
143 
144 
145 private:
147  std::string myDepartLane;
153  unsigned int myWaitingSteps;
157  std::string myArrivalLane;
162 
163 
164 private:
167 
170 
171 
172 };
173 
174 
175 #endif
176 
177 /****************************************************************************/
178 
SUMOTime myArrivalTime
The vehicle&#39;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:63
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.
static const std::type_info & getTypeInfo()
Returns this device&#39;s type information.
Abstract in-vehicle device.
Definition: MSDevice.h:68
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:221