SUMO - Simulation of Urban MObility
MSRouteProbe.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Writes route distributions at a certain edge
20 /****************************************************************************/
21 #ifndef MSRouteProbe_h
22 #define MSRouteProbe_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 <string>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MSEdge;
44 class MSRoute;
45 class MSVehicle;
46 class OutputDevice;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
68 public:
76  MSRouteProbe(const std::string& id, const MSEdge* edge,
77  const std::string& distID, const std::string& lastID,
78  const std::string& vTypes);
79 
80 
82  virtual ~MSRouteProbe();
83 
84 
87 
99  bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
101 
102 
105 
119  void writeXMLOutput(OutputDevice& dev,
120  SUMOTime startTime, SUMOTime stopTime);
121 
122 
130  void writeXMLDetectorProlog(OutputDevice& dev) const;
132 
133  const MSRoute* getRoute() const;
134 
135 private:
137  std::pair<std::string, RandomDistributor<const MSRoute*>*> myLastRouteDistribution;
138 
140  std::pair<std::string, RandomDistributor<const MSRoute*>*> myCurrentRouteDistribution;
141 
142 
143 private:
145  MSRouteProbe(const MSRouteProbe&);
146 
149 
150 
151 };
152 
153 #endif
154 
155 /****************************************************************************/
156 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
const MSRoute * getRoute() const
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:67
Notification
Definition of a vehicle state.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes values into the given stream.
std::pair< std::string, RandomDistributor< const MSRoute * > * > myLastRouteDistribution
The previous distribution of routes (probability->route)
Definition: MSRouteProbe.h:137
virtual ~MSRouteProbe()
Destructor.
A road/street connecting two junctions.
Definition: MSEdge.h:80
Representation of a vehicle.
Definition: SUMOVehicle.h:66
std::pair< std::string, RandomDistributor< const MSRoute * > * > myCurrentRouteDistribution
The current distribution of routes (probability->route)
Definition: MSRouteProbe.h:140
MSRouteProbe & operator=(const MSRouteProbe &)
Invalidated assignment operator.
Something on a lane to be noticed about vehicle movement.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Returns whether the vehicle shall be aware of this entry.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
long long int SUMOTime
Definition: TraCIDefs.h:51
MSRouteProbe(const std::string &id, const MSEdge *edge, const std::string &distID, const std::string &lastID, const std::string &vTypes)
Constructor.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
Base of value-generating classes (detectors)