Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSRouteProbe.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// Writes route distributions at a certain edge
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
25#include <string>
29
30
31// ===========================================================================
32// class declarations
33// ===========================================================================
34class MSEdge;
35class MSRoute;
36class MSVehicle;
37class OutputDevice;
38
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
59public:
67 MSRouteProbe(const std::string& id, const MSEdge* edge,
68 const std::string& distID, const std::string& lastID,
69 const std::string& vTypes);
70
71
73 virtual ~MSRouteProbe();
74
75
78
90 bool notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0) override;
92
93
96
110 void writeXMLOutput(OutputDevice& dev, SUMOTime startTime, SUMOTime stopTime) override;
111
112
120 void writeXMLDetectorProlog(OutputDevice& dev) const override;
122
123 /* @brief sample a route from the routeDistribution
124 * @param[in] last Retrieve route from the previous (complete) collection interval
125 */
126 ConstMSRoutePtr sampleRoute(bool last = true) const;
127
128 const MSEdge* getEdge() {
129 return myEdge;
130 }
131
132 void clearState(SUMOTime step) override;
133
134private:
135 void initDistributions();
136
137private:
138 std::string myDistID;
139 std::string myLastID;
140
143
146
149
150
151private:
154
157
158
159};
long long int SUMOTime
Definition GUI.h:36
std::shared_ptr< const MSRoute > ConstMSRoutePtr
Definition Route.h:32
Base of value-generating classes (detectors)
A road/street connecting two junctions.
Definition MSEdge.h:77
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Writes routes of vehicles passing a certain edge.
MSRouteProbe(const MSRouteProbe &)
Invalidated copy constructor.
void clearState(SUMOTime step) override
Remove all vehicles before quick-loading state.
std::string myLastID
MSRouteProbe & operator=(const MSRouteProbe &)
Invalidated assignment operator.
void writeXMLDetectorProlog(OutputDevice &dev) const override
Opens the XML-output using "detector" as root element.
virtual ~MSRouteProbe()
Destructor.
RandomDistributor< ConstMSRoutePtr > * myCurrentRouteDistribution
The current distribution of routes (probability->route)
const MSEdge * myEdge
the edge of this route probe
const MSEdge * getEdge()
RandomDistributor< ConstMSRoutePtr > * myLastRouteDistribution
The previous distribution of routes (probability->route)
void initDistributions()
std::string myDistID
ConstMSRoutePtr sampleRoute(bool last=true) const
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0) override
Returns whether the vehicle shall be aware of this entry.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) override
Writes values into the given stream.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
Static storage of an output device and its base (abstract) implementation.
Represents a generic random distribution.
Representation of a vehicle, person, or container.