Eclipse 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-2019 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 /****************************************************************************/
16 // Writes route distributions at a certain edge
17 /****************************************************************************/
18 #ifndef MSRouteProbe_h
19 #define MSRouteProbe_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSEdge;
37 class MSRoute;
38 class MSVehicle;
39 class OutputDevice;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
61 public:
69  MSRouteProbe(const std::string& id, const MSEdge* edge,
70  const std::string& distID, const std::string& lastID,
71  const std::string& vTypes);
72 
73 
75  virtual ~MSRouteProbe();
76 
77 
80 
92  bool notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
94 
95 
98 
112  void writeXMLOutput(OutputDevice& dev,
113  SUMOTime startTime, SUMOTime stopTime);
114 
115 
123  void writeXMLDetectorProlog(OutputDevice& dev) const;
125 
126  const MSRoute* getRoute() const;
127 
128 private:
130  std::pair<std::string, RandomDistributor<const MSRoute*>*> myLastRouteDistribution;
131 
133  std::pair<std::string, RandomDistributor<const MSRoute*>*> myCurrentRouteDistribution;
134 
135 
136 private:
138  MSRouteProbe(const MSRouteProbe&);
139 
142 
143 
144 };
145 
146 #endif
147 
148 /****************************************************************************/
149 
MSRouteProbe::operator=
MSRouteProbe & operator=(const MSRouteProbe &)
Invalidated assignment operator.
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
MSDetectorFileOutput
Base of value-generating classes (detectors)
Definition: MSDetectorFileOutput.h:63
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSRouteProbe::writeXMLOutput
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes values into the given stream.
Definition: MSRouteProbe.cpp:87
MSRouteProbe
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:60
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSRouteProbe::writeXMLDetectorProlog
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
Definition: MSRouteProbe.cpp:118
MSDetectorFileOutput.h
MSRoute
Definition: MSRoute.h:66
MSMoveReminder
Something on a lane to be noticed about vehicle movement.
Definition: MSMoveReminder.h:66
MSRouteProbe::myCurrentRouteDistribution
std::pair< std::string, RandomDistributor< const MSRoute * > * > myCurrentRouteDistribution
The current distribution of routes (probability->route)
Definition: MSRouteProbe.h:133
MSMoveReminder.h
RandomDistributor.h
MSRouteProbe::myLastRouteDistribution
std::pair< std::string, RandomDistributor< const MSRoute * > * > myLastRouteDistribution
The previous distribution of routes (probability->route)
Definition: MSRouteProbe.h:130
MSRouteProbe::MSRouteProbe
MSRouteProbe(const std::string &id, const MSEdge *edge, const std::string &distID, const std::string &lastID, const std::string &vTypes)
Constructor.
Definition: MSRouteProbe.cpp:42
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSRouteProbe::getRoute
const MSRoute * getRoute() const
Definition: MSRouteProbe.cpp:124
MSRouteProbe::~MSRouteProbe
virtual ~MSRouteProbe()
Destructor.
Definition: MSRouteProbe.cpp:65
MSRouteProbe::notifyEnter
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Returns whether the vehicle shall be aware of this entry.
Definition: MSRouteProbe.cpp:70
config.h
MSMoveReminder::Notification
Notification
Definition of a vehicle state.
Definition: MSMoveReminder.h:91
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79