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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Writes route distributions at a certain edge
18 /****************************************************************************/
19 #ifndef MSRouteProbe_h
20 #define MSRouteProbe_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSEdge;
38 class MSRoute;
39 class MSVehicle;
40 class OutputDevice;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
62 public:
70  MSRouteProbe(const std::string& id, const MSEdge* edge,
71  const std::string& distID, const std::string& lastID,
72  const std::string& vTypes);
73 
74 
76  virtual ~MSRouteProbe();
77 
78 
81 
93  bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
95 
96 
99 
113  void writeXMLOutput(OutputDevice& dev,
114  SUMOTime startTime, SUMOTime stopTime);
115 
116 
124  void writeXMLDetectorProlog(OutputDevice& dev) const;
126 
127  const MSRoute* getRoute() const;
128 
129 private:
131  std::pair<std::string, RandomDistributor<const MSRoute*>*> myLastRouteDistribution;
132 
134  std::pair<std::string, RandomDistributor<const MSRoute*>*> myCurrentRouteDistribution;
135 
136 
137 private:
139  MSRouteProbe(const MSRouteProbe&);
140 
143 
144 
145 };
146 
147 #endif
148 
149 /****************************************************************************/
150 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
long long int SUMOTime
Definition: SUMOTime.h:36
const MSRoute * getRoute() const
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:61
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:131
virtual ~MSRouteProbe()
Destructor.
A road/street connecting two junctions.
Definition: MSEdge.h:75
Representation of a vehicle.
Definition: SUMOVehicle.h:60
std::pair< std::string, RandomDistributor< const MSRoute * > * > myCurrentRouteDistribution
The current distribution of routes (probability->route)
Definition: MSRouteProbe.h:134
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:64
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:78
Base of value-generating classes (detectors)