Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSMeanData_Net.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2004-2025 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// Network state mean data collector for edges/lanes
21/****************************************************************************/
22#include <config.h>
23
24#ifdef HAVE_FOX
26#endif
31#include <microsim/MSEdge.h>
32#include <microsim/MSLane.h>
33#include <microsim/MSVehicle.h>
34#include <microsim/MSGlobals.h>
35#include <mesosim/MELoop.h>
36#include <mesosim/MESegment.h>
37#include "MSMeanData_Net.h"
38
39
40// ===========================================================================
41// debug constants
42// ===========================================================================
43//#define DEBUG_OCCUPANCY
44//#define DEBUG_OCCUPANCY2
45//#define DEBUG_NOTIFY_ENTER
46//#define DEBUG_COND (veh.getLane()->getID() == "")
47//#define DEBUG_COND (false)
48//#define DEBUG_COND2 (veh.getEdge()->getID() == "")
49
50
51// ===========================================================================
52// method definitions
53// ===========================================================================
54// ---------------------------------------------------------------------------
55// MSMeanData_Net::MSLaneMeanDataValues - methods
56// ---------------------------------------------------------------------------
58 const double length,
59 const bool doAdd,
60 const MSMeanData_Net* parent)
61 : MSMeanData::MeanDataValues(lane, length, doAdd, parent),
68 myParent(parent) {}
69
70
73
74
75void
96
97
98void
123
124
125void
127 const SUMOTrafficObject& veh, const double frontOnLane,
128 const double timeOnLane, const double /* meanSpeedFrontOnLane */,
129 const double meanSpeedVehicleOnLane,
130 const double travelledDistanceFrontOnLane,
131 const double travelledDistanceVehicleOnLane,
132 const double meanLengthOnLane) {
133#ifdef DEBUG_OCCUPANCY
134 if (DEBUG_COND2) {
135 std::cout << SIMTIME << "\n MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal()\n"
136 << " veh '" << veh.getID() << "' on edge '" << veh.getEdge()->getID() << "'"
137 << ", timeOnLane=" << timeOnLane
138 << ", meanSpeedVehicleOnLane=" << meanSpeedVehicleOnLane
139 << ",\ntravelledDistanceFrontOnLane=" << travelledDistanceFrontOnLane
140 << ", travelledDistanceVehicleOnLane=" << travelledDistanceVehicleOnLane
141 << ", meanLengthOnLane=" << meanLengthOnLane
142 << std::endl;
143 }
144#endif
145 if (myParent != nullptr && !myParent->vehicleApplies(veh)) {
146 return;
147 }
148 sampleSeconds += timeOnLane;
149 travelledDistance += travelledDistanceVehicleOnLane;
150 vehLengthSum += veh.getVehicleType().getLength() * timeOnLane;
152 // For the mesosim case no information on whether the vehicle was occupying
153 // the lane with its whole length is available. We assume the whole length
154 // Therefore this increment is taken out with more information on the vehicle movement.
155 occupationSum += veh.getVehicleType().getLength() * timeOnLane;
156 } else {
157 // for the microsim case more elaborate calculation of the average length on the lane,
158 // is taken out in notifyMove(), refs #153
159 occupationSum += meanLengthOnLane * TS;
160 }
161 if (!veh.isStopped()) {
162 if (myParent != nullptr && meanSpeedVehicleOnLane < myParent->myHaltSpeed) {
163 waitSeconds += timeOnLane;
164 } else if (MSGlobals::gUseMesoSim) {
166 }
167 const double vmax = veh.getLane() == nullptr ? veh.getEdge()->getVehicleMaxSpeed(&veh) : veh.getLane()->getVehicleMaxSpeed(&veh);
168 if (vmax > 0) {
169 timeLoss += timeOnLane * MAX2(0.0, vmax - meanSpeedVehicleOnLane) / vmax;
170 }
171 }
172 frontSampleSeconds += frontOnLane;
173 frontTravelledDistance += travelledDistanceFrontOnLane;
176 } else {
178 }
179#ifdef DEBUG_OCCUPANCY2
180 // refs #3265
181 std::cout << SIMTIME << "ID: " << getDescription() << " minVehicleLength=" << minimalVehicleLength << std::endl;
182#endif
183}
184
185
186bool
188 if ((myParent == nullptr || myParent->vehicleApplies(veh)) && (
189 getLane() == nullptr || !veh.isVehicle() || getLane() == static_cast<MSVehicle&>(veh).getLane())) {
190#ifdef HAVE_FOX
191 ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1);
192#endif
195 }
197 ++nVehArrived;
198 } else if (reason == MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
200 } else if (myParent == nullptr || reason != MSMoveReminder::NOTIFICATION_SEGMENT) {
201 ++nVehLeft;
206 }
207 }
208 }
210 return false;
211 }
213}
214
215
216bool
218#ifdef DEBUG_NOTIFY_ENTER
219 std::cout << "\n" << SIMTIME << " MSMeanData_Net::MSLaneMeanDataValues: veh '" << veh.getID() << "' enters lane '" << enteredLane->getID() << "'" << std::endl;
220#else
221 UNUSED_PARAMETER(enteredLane);
222#endif
223 if (myParent == nullptr || myParent->vehicleApplies(veh)) {
224 if (getLane() == nullptr || !veh.isVehicle() || getLane() == static_cast<MSVehicle&>(veh).getLane()) {
225#ifdef HAVE_FOX
226 ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1);
227#endif
229 ++nVehDeparted;
230 } else if (reason == MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
232 } else if (myParent == nullptr || reason != MSMoveReminder::NOTIFICATION_SEGMENT) {
233 ++nVehEntered;
234 }
235 }
236 return true;
237 }
238 return false;
239}
240
241
242bool
244 return sampleSeconds == 0 && nVehDeparted == 0 && nVehArrived == 0 && nVehEntered == 0
245 && nVehLeft == 0 && nVehVaporized == 0 && nVehTeleported == 0 && nVehLaneChangeFrom == 0 && nVehLaneChangeTo == 0;
246}
247
248double
250 return occupationSum / STEPS2TIME(period) / myLaneLength / (double)numLanes * 100.;
251}
252
253void
255 const int numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles) const {
256
257 double density = frontSampleSeconds / STEPS2TIME(period) * 1000. / myLaneLength;
258 double overlapDensity = sampleSeconds / STEPS2TIME(period) * 1000. / myLaneLength;
260 // avoid exceeding upper bound
261 density = MIN2(density, 1000 * (double)numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
262 overlapDensity = MIN2(overlapDensity, 1000 * (double)numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
263 }
264 const double laneDensity = density / (double)numLanes;
265 const double occupancy = getOccupancy(period, numLanes);
266#ifdef DEBUG_OCCUPANCY2
267 // tests #3264
268 if (occupancy > 100) {
269 std::cout << SIMTIME << " Encountered bad occupancy: " << occupancy
270 << ", myLaneLength=" << myLaneLength << ", period=" << STEPS2TIME(period) << ", occupationSum=" << occupationSum
271 << std::endl;
272 }
273 // refs #3265
274 std::cout << SIMTIME << "ID: " << getDescription() << " minVehicleLength=" << minimalVehicleLength
275 << "\ndensity=" << density << "\n";
276#endif
277
278 if (myParent == nullptr) {
279 const double speed = sampleSeconds == 0 ? 0. : travelledDistance / sampleSeconds;
280 dev.writeOptionalAttr(SUMO_ATTR_DENSITY, density, attributeMask, sampleSeconds == 0);
281 dev.writeOptionalAttr(SUMO_ATTR_LANEDENSITY, laneDensity, attributeMask, sampleSeconds == 0);
282 dev.writeOptionalAttr(SUMO_ATTR_OCCUPANCY, occupancy, attributeMask, sampleSeconds == 0);
285 dev.writeOptionalAttr(SUMO_ATTR_SPEED, speed, attributeMask, sampleSeconds == 0);
286 dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. || sampleSeconds == 0 ? 0. : travelledDistance / sampleSeconds / speedLimit,
287 attributeMask, sampleSeconds == 0);
291 dev.writeOptionalAttr(SUMO_ATTR_LEFT, nVehLeft, attributeMask);
294 dev.writeOptionalAttr(SUMO_ATTR_FLOW, density * speed * 3.6, attributeMask, sampleSeconds == 0);
295 dev.closeTag();
296 return;
297 }
298 const bool haveSamples = sampleSeconds > myParent->myMinSamples;
299 const bool haveSamplesOrDefault = haveSamples || defaultTravelTime >= 0.;
300 bool haveTravelTime = haveSamplesOrDefault;
301 double traveltime = myParent->myMaxTravelTime;
302 if (haveSamples) {
303 if (numVehicles > 0) {
304 traveltime = sampleSeconds / numVehicles;
305 } else {
306 traveltime = myParent->myMaxTravelTime;
307 if (frontTravelledDistance > NUMERICAL_EPS) {
308 traveltime = MIN2(traveltime, myLaneLength * frontSampleSeconds / frontTravelledDistance);
309 } else if (defaultTravelTime >= 0.) {
310 traveltime = defaultTravelTime;
311 } else {
312 haveTravelTime = false;
313 }
314 }
315 } else if (defaultTravelTime >= 0.) {
316 traveltime = defaultTravelTime;
317 }
318 dev.writeOptionalAttr(SUMO_ATTR_TRAVELTIME, traveltime, attributeMask, !haveTravelTime);
319 double overlapTraveltime = myParent->myMaxTravelTime;
320 if (travelledDistance > 0.) {
321 // one vehicle has to drive lane length + vehicle length before it has left the lane
322 // thus we need to scale with an extended length, approximated by lane length + average vehicle length
323 overlapTraveltime = MIN2(overlapTraveltime, (myLaneLength + vehLengthSum / sampleSeconds) * sampleSeconds / travelledDistance);
324 }
325 dev.writeOptionalAttr(SUMO_ATTR_OVERLAPTRAVELTIME, overlapTraveltime, attributeMask, !haveSamples || numVehicles > 0);
326 dev.writeOptionalAttr(SUMO_ATTR_DENSITY, density, attributeMask, !haveSamples || numVehicles > 0);
327 dev.writeOptionalAttr(SUMO_ATTR_OVERLAPDENSITY, overlapDensity, attributeMask, sampleSeconds == 0);
328 dev.writeOptionalAttr(SUMO_ATTR_LANEDENSITY, laneDensity, attributeMask, !haveSamples || numVehicles > 0);
329 dev.writeOptionalAttr(SUMO_ATTR_OCCUPANCY, occupancy, attributeMask, !haveSamples || numVehicles > 0);
330 dev.writeOptionalAttr(SUMO_ATTR_WAITINGTIME, waitSeconds, attributeMask, !haveSamples);
331 dev.writeOptionalAttr(SUMO_ATTR_TIMELOSS, timeLoss, attributeMask, !haveSamples);
332 double speed = 0.;
333 if (haveSamples) {
335 } else if (defaultTravelTime > 0.) {
336 speed = myLaneLength / defaultTravelTime;
337 }
338 dev.writeOptionalAttr(SUMO_ATTR_SPEED, speed, attributeMask, !haveSamplesOrDefault);
339 dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. ? 0. : speed / speedLimit, attributeMask, !haveSamplesOrDefault);
343 dev.writeOptionalAttr(SUMO_ATTR_LEFT, nVehLeft, attributeMask);
348 dev.writeOptionalAttr(SUMO_ATTR_FLOW, density * speed * 3.6, attributeMask, !haveSamples || numVehicles > 0);
349 dev.closeTag();
350}
351
352
353double
355 const SUMOTime period, const double numLanes, const double speedLimit) const {
357 switch (a) {
359 return MIN2(frontSampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength,
360 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
362 const double density = MIN2(frontSampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength,
363 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
364 return density / numLanes;
365 }
367 const double overlapDensity = MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength,
368 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
369 return overlapDensity / numLanes;
370 }
372 return occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 1000;
374 return waitSeconds;
376 return timeLoss;
377 case SUMO_ATTR_SPEED:
380 return speedLimit == 0. ? 0. : travelledDistance / sampleSeconds / speedLimit;
382 return nVehDeparted;
384 return nVehArrived;
386 return nVehEntered;
387 case SUMO_ATTR_LEFT:
388 return nVehLeft;
390 return nVehVaporized;
392 return nVehTeleported;
393 case SUMO_ATTR_FLOW: {
394 const double density = MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength,
395 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS));
396 const double speed = travelledDistance / sampleSeconds;
397 return density * speed * 3.6;
398 }
399 default:
400 return 0;
401 }
402}
403
404// ---------------------------------------------------------------------------
405// MSMeanData_Net - methods
406// ---------------------------------------------------------------------------
407MSMeanData_Net::MSMeanData_Net(const std::string& id,
408 const SUMOTime dumpBegin,
409 const SUMOTime dumpEnd, const bool useLanes,
410 const bool withEmpty, const bool printDefaults,
411 const bool withInternal,
412 const bool trackVehicles,
413 const int detectPersons,
414 const double maxTravelTime,
415 const double minSamples,
416 const double haltSpeed,
417 const std::string& vTypes,
418 const std::string& writeAttributes,
419 const std::vector<MSEdge*>& edges,
420 bool aggregate) :
421 MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
422 withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes, writeAttributes, edges, aggregate),
423 myHaltSpeed(haltSpeed)
424{ }
425
426
428
429
431MSMeanData_Net::createValues(MSLane* const lane, const double length, const bool doAdd) const {
432 return new MSLaneMeanDataValues(lane, length, doAdd, this);
433}
434
435
436std::vector<std::string>
438 std::vector<std::string> result;
439 result.push_back(toString(SUMO_ATTR_DENSITY));
440 result.push_back(toString(SUMO_ATTR_LANEDENSITY));
441 result.push_back(toString(SUMO_ATTR_OCCUPANCY));
442 result.push_back(toString(SUMO_ATTR_WAITINGTIME));
443 result.push_back(toString(SUMO_ATTR_TIMELOSS));
444 result.push_back(toString(SUMO_ATTR_SPEED));
445 result.push_back(toString(SUMO_ATTR_SPEEDREL));
446 result.push_back(toString(SUMO_ATTR_DEPARTED));
447 result.push_back(toString(SUMO_ATTR_ARRIVED));
448 result.push_back(toString(SUMO_ATTR_ENTERED));
449 result.push_back(toString(SUMO_ATTR_LEFT));
450 result.push_back(toString(SUMO_ATTR_VAPORIZED));
451 result.push_back(toString(SUMO_ATTR_TELEPORTED));
452 result.push_back(toString(SUMO_ATTR_FLOW));
453 return result;
454}
455
456
457double
458MSMeanData_Net::getAttributeValue(const MSLane* lane, SumoXMLAttr a, double defaultValue) const {
459 double result = defaultValue;
460 const std::vector<MeanDataValues*>* edgeValues = getEdgeValues(&lane->getEdge());
461 if (edgeValues == nullptr) {
462 return result;
463 }
464 MeanDataValues* values = nullptr;
465 if (!myAmEdgeBased) {
466 values = (*edgeValues)[lane->getIndex()];
467 } else {
468 MeanDataValues* sumData = createValues(nullptr, lane->getLength(), false);
469 for (MeanDataValues* meanData : (*edgeValues)) {
470 meanData->addTo(*sumData);
471 }
472 values = sumData;
473 }
474 const SUMOTime myLastResetTime = 0; // XXX store last reset time
475 const SUMOTime period = SIMSTEP - myLastResetTime;
476 result = values->getAttributeValue(a, period, lane->getEdge().getNumLanes(), lane->getSpeedLimit());
477 if (myAmEdgeBased) {
478 delete values;
479 }
480 return result;
481}
482
483
484/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
#define DEBUG_COND2(obj)
Definition MESegment.cpp:54
#define STEPS2TIME(x)
Definition SUMOTime.h:55
#define SIMSTEP
Definition SUMOTime.h:61
#define TS
Definition SUMOTime.h:42
#define SIMTIME
Definition SUMOTime.h:62
std::bitset< 96 > SumoXMLAttrMask
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_FLOW
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_WAITINGTIME
@ SUMO_ATTR_OVERLAPDENSITY
@ SUMO_ATTR_OVERLAPTRAVELTIME
@ SUMO_ATTR_LANECHANGEDFROM
@ SUMO_ATTR_TRAVELTIME
@ SUMO_ATTR_SPEEDREL
@ SUMO_ATTR_ARRIVED
@ SUMO_ATTR_TELEPORTED
@ SUMO_ATTR_LANECHANGEDTO
@ SUMO_ATTR_TIMELOSS
@ SUMO_ATTR_VAPORIZED
@ SUMO_ATTR_OCCUPANCY
@ SUMO_ATTR_ENTERED
@ SUMO_ATTR_DEPARTED
@ SUMO_ATTR_LANEDENSITY
@ SUMO_ATTR_DENSITY
@ SUMO_ATTR_LEFT
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
int getNumLanes() const
Definition MSEdge.h:172
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition MSEdge.cpp:1180
static bool gUseMesoSim
Definition MSGlobals.h:106
static double gLateralResolution
Definition MSGlobals.h:100
static int gNumSimThreads
how many threads to use for simulation
Definition MSGlobals.h:146
Representation of a lane in the micro simulation.
Definition MSLane.h:84
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
Definition MSLane.h:597
double getLength() const
Returns the lane's length.
Definition MSLane.h:611
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
Definition MSLane.h:574
int getIndex() const
Returns the lane's index.
Definition MSLane.h:647
MSEdge & getEdge() const
Returns the lane's edge.
Definition MSLane.h:769
Data structure for mean (aggregated) edge/lane values.
Definition MSMeanData.h:66
MeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData *const parent)
Constructor.
double travelledDistance
The sum of the distances the vehicles travelled.
Definition MSMeanData.h:190
const double myLaneLength
The length of the lane / edge the data collector is on.
Definition MSMeanData.h:182
virtual double getAttributeValue(SumoXMLAttr a, const SUMOTime period, const double numLanes, const double speedLimit) const
return attribute value
Definition MSMeanData.h:169
SUMOTime resetTime
time at which collection was reset;
Definition MSMeanData.h:194
Data structure for mean (aggregated) edge/lane values.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
const MSMeanData_Net * myParent
The meandata parent.
double frontTravelledDistance
The travelled distance regarding the vehicle front.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
void write(OutputDevice &dev, const SumoXMLAttrMask &attributeMask, const SUMOTime period, const int numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
int nVehLaneChangeTo
The number of vehicles that changed to this lane.
double getAttributeValue(SumoXMLAttr a, const SUMOTime period, const double numLanes, const double speedLimit) const
return attribute value
int nVehVaporized
The number of vehicles that left this lane via vaporization within the sample interval.
double minimalVehicleLength
minimal vehicle length in the current interval (used to determine a maximal density,...
double getOccupancy(SUMOTime period, int numLanes) const
bool isEmpty() const
Returns whether any data was collected.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes current values and adds them to their sums.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Net *parent)
Constructor.
void notifyMoveInternal(const SUMOTrafficObject &veh, const double frontOnLane, const double timeOnLane, const double, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double meanLengthOnLane)
Internal notification about the vehicle moves.
int nVehLeft
The number of vehicles that left this lane within the sample interval.
int nVehLaneChangeFrom
The number of vehicles that changed from this lane.
int nVehTeleported
The number of vehicles that left this lane via teleporting within the sample interval.
double timeLoss
The time loss accrued by vehicle probes.
double frontSampleSeconds
The number of vehicle probes regarding the vehicle front.
int nVehArrived
The number of vehicles that finished on the lane.
double waitSeconds
The number of vehicle probes with small speed.
double occupationSum
The sum of the occupation of the lane.
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
double vehLengthSum
The sum of the lengths the vehicles had.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
virtual ~MSMeanData_Net()
Destructor.
double getAttributeValue(const MSLane *lane, SumoXMLAttr a, double defaultValue) const
return attribute value for the given lane
MSMeanData_Net(const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes, const std::string &writeAttributes, const std::vector< MSEdge * > &edges, bool aggregate)
Constructor.
std::vector< std::string > getAttributeNames() const
return all attributes that are (potentially) written by this output
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
const double myHaltSpeed
the minimum sample seconds
const bool myAmEdgeBased
Information whether the output shall be edge-based (not lane-based).
Definition MSMeanData.h:491
const std::vector< MeanDataValues * > * getEdgeValues(const MSEdge *edge) const
MSMeanData(const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double minSamples, const double maxTravelTime, const std::string &vTypes, const std::string &writeAttributes, const std::vector< MSEdge * > &edges, bool aggregate)
Constructor.
const std::string & getDescription() const
Notification
Definition of a vehicle state.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted).
@ NOTIFICATION_TELEPORT_ARRIVED
The vehicle was teleported out of the net.
@ NOTIFICATION_VAPORIZED_CALIBRATOR
The vehicle got removed by a calibrator.
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network).
@ NOTIFICATION_SEGMENT
The vehicle changes the segment (meso only).
@ NOTIFICATION_LANE_CHANGE
The vehicle changes lanes (micro only).
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
@ NOTIFICATION_TELEPORT
The vehicle is being teleported.
void removeFromVehicleUpdateValues(SUMOTrafficObject &veh)
const MSLane * getLane() const
Returns the lane the reminder works on.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double getLength() const
Get vehicle's length [m].
const std::string & getID() const
Returns the id.
Definition Named.h:74
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeOptionalAttr(const SumoXMLAttr attr, const T &val, const SumoXMLAttrMask &attributeMask, const bool isNull=false)
writes a named attribute unless filtered
Representation of a vehicle, person, or container.
virtual bool isVehicle() const
Whether it is a vehicle.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual SUMOTime getWaitingTime(const bool accumulated=false) const =0
virtual bool isStopped() const =0
Returns whether the object is at a stop.
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
A scoped lock which only triggers on condition.
#define UNUSED_PARAMETER(x)