![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Export the queueing length in front of a junction (very experimental!) More...
#include <MSQueueExport.h>
Static Public Member Functions | |
| static void | finish (OutputDevice &of, SUMOTime timestep) |
| Writes the last (possibly incomplete) aggregation interval and clears the collected samples. | |
| static void | write (OutputDevice &of, SUMOTime timestep) |
| Export the queueing length in front of a junction (very experimental!) | |
Private Member Functions | |
| MSQueueExport (const MSQueueExport &) | |
| Invalidated copy constructor. | |
| MSQueueExport & | operator= (const MSQueueExport &) |
| Invalidated assignment operator. | |
Static Private Member Functions | |
| static double | percentile (const std::vector< double > &sorted, double p) |
| Returns the given percentile (with linear interpolation) of a sorted sample vector. | |
| static void | writeEdge (OutputDevice *of, double threshold, const std::function< void()> &ensureOpen) |
| Iterates through the edges and their lanes (micro) or segment queues (meso). If of is nullptr, queue length samples are collected for aggregation instead of being written. ensureOpen lazily opens the enclosing timestep element before the first record is written. | |
| static void | writeInterval (OutputDevice &of, SUMOTime begin, SUMOTime end) |
| Writes aggregated per-edge queue length statistics for the given interval. | |
| static void | writeLane (OutputDevice *of, const MSLane &lane, double threshold, const std::function< void()> &ensureOpen) |
| Checks a single lane for a vehicle queue (micro) | |
| static void | writeMesoQueue (OutputDevice *of, const MSEdge &edge, const MESegment &segment, int qIdx, double segmentOffset, double threshold, const std::function< void()> &ensureOpen) |
| Checks a single segment queue (meso) | |
Static Private Attributes | |
| static std::map< const MSEdge *, std::vector< std::pair< double, double > > > | myEdgeSamples |
| Queue length samples (in vehicles, in meters) per edge, collected during the current aggregation interval. | |
| static SUMOTime | myIntervalStart = SUMOTime_MIN |
| The begin of the current aggregation interval. | |
Export the queueing length in front of a junction (very experimental!)
The class offers a static method, which writes the actual queueing length of the network into the given OutputDevice.
Definition at line 52 of file MSQueueExport.h.
|
private |
Invalidated copy constructor.
|
static |
Writes the last (possibly incomplete) aggregation interval and clears the collected samples.
| [in] | of | The output device to use |
| [in] | timestep | The final time step |
Definition at line 96 of file MSQueueExport.cpp.
References OptionsCont::getOptions(), MIN2(), myEdgeSamples, myIntervalStart, string2time(), SUMOTime_MIN, and writeInterval().
Referenced by MSNet::closeSimulation().
|
private |
Invalidated assignment operator.
|
staticprivate |
Returns the given percentile (with linear interpolation) of a sorted sample vector.
Definition at line 290 of file MSQueueExport.cpp.
Referenced by writeInterval().
|
static |
Export the queueing length in front of a junction (very experimental!)
Opens the current time step, goes through the lanes check for a traffic jam in front of a junction
| [in] | of | The output device to use |
| [in] | timestep | The current time step |
| IOError | If an error on writing occurs (!!! not yet implemented) |
Definition at line 55 of file MSQueueExport.cpp.
References OutputDevice::closeTag(), OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getOptions(), OptionsCont::getString(), myIntervalStart, OutputDevice::openTag(), string2time(), SUMOTime_MIN, time2string(), OutputDevice::writeAttr(), writeEdge(), and writeInterval().
Referenced by MSNet::writeOutput().
|
staticprivate |
Iterates through the edges and their lanes (micro) or segment queues (meso). If of is nullptr, queue length samples are collected for aggregation instead of being written. ensureOpen lazily opens the enclosing timestep element before the first record is written.
Definition at line 107 of file MSQueueExport.cpp.
References MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getInstance(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, writeLane(), and writeMesoQueue().
Referenced by write().
|
staticprivate |
Writes aggregated per-edge queue length statistics for the given interval.
Definition at line 242 of file MSQueueExport.cpp.
References OutputDevice::closeTag(), OptionsCont::getBool(), MSNet::getEdgeControl(), MSEdgeControl::getEdges(), OptionsCont::getFloat(), Named::getID(), MSNet::getInstance(), OptionsCont::getOptions(), myEdgeSamples, OutputDevice::openTag(), percentile(), time2string(), and OutputDevice::writeAttr().
Referenced by finish(), and write().
|
staticprivate |
Checks a single lane for a vehicle queue (micro)
Definition at line 128 of file MSQueueExport.cpp.
References OutputDevice::closeTag(), MSLane::empty(), MSLane::getEdge(), Named::getID(), MSVehicle::getLane(), MSLane::getLength(), MSVehicleType::getLength(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), MSVehicle::isOnRoad(), MAX2(), myEdgeSamples, MSLane::myVehicles, OutputDevice::openTag(), and OutputDevice::writeAttr().
Referenced by writeEdge().
|
staticprivate |
Checks a single segment queue (meso)
Definition at line 174 of file MSQueueExport.cpp.
References OutputDevice::closeTag(), MESegment::getCapacity(), MSVehicleType::getCarFollowModel(), MEVehicle::getEventTime(), MSCFModel::getHeadwayTime(), MESegment::getIndex(), MSEdge::getLanes(), MEVehicle::getLastEntryTimeSeconds(), MESegment::getLength(), MSVehicleType::getLength(), MSVehicleType::getLengthWithGap(), MESegment::getMinTauWithVehLength(), MEVehicle::getPositionOnLane(), MESegment::getQueue(), MESegment::getQueueBlockTime(), MEVehicle::getSpeed(), MESegment::getTauWithVehLength(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), MSGlobals::gMesoInterpolatePos, MAX2(), MIN2(), myEdgeSamples, MESegment::numQueues(), OutputDevice::openTag(), SIMTIME, STEPS2TIME, TS, and OutputDevice::writeAttr().
Referenced by writeEdge().
|
staticprivate |
Queue length samples (in vehicles, in meters) per edge, collected during the current aggregation interval.
Definition at line 100 of file MSQueueExport.h.
Referenced by finish(), writeInterval(), writeLane(), and writeMesoQueue().
|
staticprivate |
The begin of the current aggregation interval.
Definition at line 97 of file MSQueueExport.h.