|
SUMO - Simulation of Urban MObility
|
Network state mean data collector for edges/lanes. More...
#include <MSMeanData_Net.h>
Data Structures | |
| class | MSLaneMeanDataValues |
| Data structure for mean (aggregated) edge/lane values. More... | |
Public Member Functions | |
| virtual void | detectorUpdate (const SUMOTime step) |
| Updates the detector. | |
| const std::string & | getID () const |
| Returns the id. | |
| void | init () |
| Adds the value collectors to all relevant edges. | |
| MSMeanData_Net (const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool withInternal, const bool trackVehicles, const SUMOReal maxTravelTime, const SUMOReal minSamples, const SUMOReal haltSpeed, const std::set< std::string > vTypes) | |
| Constructor. | |
| void | setID (const std::string &newID) |
| resets the id | |
| virtual | ~MSMeanData_Net () |
| Destructor. | |
Methods inherited from MSDetectorFileOutput. | |
| void | writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) |
| Writes collected values into the given stream. | |
| void | writeXMLDetectorProlog (OutputDevice &dev) const |
| Opens the XML-output using "netstats" as root element. | |
Virtual methods to implement by derived classes | |
| virtual void | reset () |
| Resets collected values. | |
| virtual GUIDetectorWrapper * | buildDetectorGUIRepresentation () |
| Builds the graphical representation. | |
Protected Member Functions | |
| MSMeanData::MeanDataValues * | createValues (MSLane *const lane, const SUMOReal length, const bool doAdd) const |
| Create an instance of MeanDataValues. | |
| void | resetOnly (SUMOTime stopTime) |
| Resets network value in order to allow processing of the next interval. | |
| void | writeEdge (OutputDevice &dev, const std::vector< MeanDataValues * > &edgeValues, MSEdge *edge, SUMOTime startTime, SUMOTime stopTime) |
| Writes edge values into the given stream. | |
| bool | writePrefix (OutputDevice &dev, const MeanDataValues &values, const std::string prefix) const |
| Checks for emptiness and writes prefix into the given stream. | |
Protected Attributes | |
| std::string | myID |
| The name of the object. | |
| const SUMOReal | myMaxTravelTime |
| the maximum travel time to write | |
| std::vector< std::vector < MeanDataValues * > > | myMeasures |
| Value collectors; sorted by edge, then by lane. | |
| const SUMOReal | myMinSamples |
| the minimum sample seconds | |
| const std::set< std::string > | myVehicleTypes |
| The vehicle types to look for (empty means all) | |
Private Member Functions | |
| MSMeanData_Net (const MSMeanData_Net &) | |
| Invalidated copy constructor. | |
| MSMeanData_Net & | operator= (const MSMeanData_Net &) |
| Invalidated assignment operator. | |
Private Attributes | |
| const SUMOReal | myHaltSpeed |
| the minimum sample seconds | |
Network state mean data collector for edges/lanes.
This structure does not contain the data itself, it is stored within MSLaneMeanDataValues-MoveReminder objects. This class is used to build the output, optionally, in the case of edge-based dump, aggregated over the edge's lanes.
Definition at line 65 of file MSMeanData_Net.h.
| MSMeanData_Net::MSMeanData_Net | ( | const std::string & | id, |
| const SUMOTime | dumpBegin, | ||
| const SUMOTime | dumpEnd, | ||
| const bool | useLanes, | ||
| const bool | withEmpty, | ||
| const bool | withInternal, | ||
| const bool | trackVehicles, | ||
| const SUMOReal | maxTravelTime, | ||
| const SUMOReal | minSamples, | ||
| const SUMOReal | haltSpeed, | ||
| const std::set< std::string > | vTypes | ||
| ) |
Constructor.
| [in] | id | The id of the detector |
| [in] | dumpBegin | Begin time of dump |
| [in] | dumpEnd | End time of dump |
| [in] | useLanes | Information whether lane-based or edge-based dump shall be generated |
| [in] | withEmpty | Information whether empty lanes/edges shall be written |
| [in] | withInternal | Information whether internal lanes/edges shall be written |
| [in] | trackVehicles | Information whether vehicles shall be tracked |
| [in] | maxTravelTime | the maximum travel time to output |
| [in] | minSamples | the minimum number of sample seconds before the values are valid |
| [in] | haltSpeed | the maximum speed to consider a vehicle waiting |
| [in] | vTypes | the set of vehicle types to consider |
Definition at line 210 of file MSMeanData_Net.cpp.
| MSMeanData_Net::~MSMeanData_Net | ( | ) | [virtual] |
Destructor.
Definition at line 221 of file MSMeanData_Net.cpp.
| MSMeanData_Net::MSMeanData_Net | ( | const MSMeanData_Net & | ) | [private] |
Invalidated copy constructor.
| virtual GUIDetectorWrapper* MSDetectorFileOutput::buildDetectorGUIRepresentation | ( | ) | [inline, virtual, inherited] |
Builds the graphical representation.
Meant to be overridden by grahical versions of the detectors
Reimplemented in GUI_E2_ZS_Collector, GUI_E2_ZS_CollectorOverLanes, GUIE3Collector, GUIInductLoop, and GUIInstantInductLoop.
Definition at line 121 of file MSDetectorFileOutput.h.
| MSMeanData::MeanDataValues * MSMeanData_Net::createValues | ( | MSLane *const | lane, |
| const SUMOReal | length, | ||
| const bool | doAdd | ||
| ) | const [protected, virtual] |
Create an instance of MeanDataValues.
| [in] | lane | The lane to create for |
| [in] | doAdd | whether to add the values as reminder to the lane |
Implements MSMeanData.
Definition at line 225 of file MSMeanData_Net.cpp.
References MSMeanData::myVehicleTypes.
| void MSMeanData::detectorUpdate | ( | const SUMOTime | step | ) | [virtual, inherited] |
Updates the detector.
Reimplemented from MSDetectorFileOutput.
Reimplemented in MSMeanData_Harmonoise.
Definition at line 465 of file MSMeanData.cpp.
References DELTA_T, MSMeanData::init(), and MSMeanData::myDumpBegin.
| const std::string& Named::getID | ( | ) | const [inline, inherited] |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 61 of file Named.h.
References Named::myID.
Referenced by ShapeContainer::add(), MSDetectorControl::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), RORouteDef_Complete::buildCurrentRoute(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBNodeCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBDistrictCont::insert(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), Named::ComparatorIdLess::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), NBLoadedTLDef::SignalGroup::patchTYellow(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
| void MSMeanData::init | ( | ) | [inherited] |
Adds the value collectors to all relevant edges.
Definition at line 260 of file MSMeanData.cpp.
References MSMeanData::createValues(), MSEdge::EDGEFUNCTION_INTERNAL, MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getInstance(), MSMeanData::myAmEdgeBased, MSMeanData::myDumpInternal, MSMeanData::myEdges, MSMeanData::myMeasures, MSMeanData::myTrackVehicles, MSMeanData::myVehicleTypes, and MSMeanData::MeanDataValues::reset().
Referenced by MSDetectorControl::add(), and MSMeanData::detectorUpdate().
| MSMeanData_Net& MSMeanData_Net::operator= | ( | const MSMeanData_Net & | ) | [private] |
Invalidated assignment operator.
| virtual void MSDetectorFileOutput::reset | ( | ) | [inline, virtual, inherited] |
Resets collected values.
Please note that this is only a "hack" for coupled-tls-outputs.
Reimplemented in GUIInductLoop, MSE2Collector, MSE3Collector, and MSInductLoop.
Definition at line 106 of file MSDetectorFileOutput.h.
Referenced by Command_SaveTLCoupledLaneDet::execute().
| void MSMeanData_Net::resetOnly | ( | SUMOTime | stopTime | ) | [protected] |
Resets network value in order to allow processing of the next interval.
Goes through the lists of edges and starts "resetOnly" for each edge.
| [in] | edge | The last time step that is reported |
Reimplemented from MSMeanData.
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
| void MSMeanData::writeEdge | ( | OutputDevice & | dev, |
| const std::vector< MeanDataValues * > & | edgeValues, | ||
| MSEdge * | edge, | ||
| SUMOTime | startTime, | ||
| SUMOTime | stopTime | ||
| ) | [protected, inherited] |
Writes edge values into the given stream.
microsim: It is checked whether the dump shall be generated edge- or lane-wise. In the first case, the lane-data are collected and aggregated and written directly. In the second case, "writeLane" is used to write each lane's state.
| [in] | dev | The output device to write the data into |
| [in] | edgeValues | List of this edge's value collectors |
| [in] | edge | The edge to write the dump of |
| [in] | startTime | First time step the data were gathered |
| [in] | stopTime | Last time step the data were gathered |
| IOError | If an error on writing occurs (!!! not yet implemented) |
Definition at line 342 of file MSMeanData.cpp.
References MSMeanData::MeanDataValues::addTo(), OutputDevice::closeTag(), MSMeanData::createValues(), Named::getID(), MSEdge::getID(), MSMoveReminder::getLane(), MSEdge::getLanes(), MSMeanData::myAmEdgeBased, MSMeanData::myDumpEmpty, MSMeanData::myTrackVehicles, OutputDevice::openTag(), MSMeanData::MeanDataValues::reset(), SUMOReal, MSMeanData::MeanDataValues::write(), and MSMeanData::writePrefix().
Referenced by MSMeanData::writeXMLOutput().
| bool MSMeanData::writePrefix | ( | OutputDevice & | dev, |
| const MeanDataValues & | values, | ||
| const std::string | prefix | ||
| ) | const [protected, inherited] |
Checks for emptiness and writes prefix into the given stream.
| [in] | dev | The output device to write the data into |
| [in] | values | The values to check for emptiness |
| [in] | prefix | The xml prefix to write (mostly the lane / edge id) |
| IOError | If an error on writing occurs (!!! not yet implemented) |
Definition at line 409 of file MSMeanData.cpp.
References MSMeanData::MeanDataValues::getSamples(), OutputDevice::indent(), MSMeanData::MeanDataValues::isEmpty(), and MSMeanData::myDumpEmpty.
Referenced by MSMeanData::writeEdge().
| void MSMeanData::writeXMLDetectorProlog | ( | OutputDevice & | dev | ) | const [virtual, inherited] |
Opens the XML-output using "netstats" as root element.
| [in] | dev | The output device to write the root into |
| IOError | If an error on writing occurs (!!! not yet implemented) |
Implements MSDetectorFileOutput.
Definition at line 459 of file MSMeanData.cpp.
References OutputDevice::writeXMLHeader().
| void MSMeanData::writeXMLOutput | ( | OutputDevice & | dev, |
| SUMOTime | startTime, | ||
| SUMOTime | stopTime | ||
| ) | [virtual, inherited] |
Writes collected values into the given stream.
At first, it is checked whether the values for the current interval shall be written. If not, a reset is performed, only, using "resetOnly". Otherwise, both the list of single-lane edges and the list of multi-lane edges are gone through and each edge is written using "writeEdge".
| [in] | dev | The output device to write the data into |
| [in] | startTime | First time step the data were gathered |
| [in] | stopTime | Last time step the data were gathered |
| IOError | If an error on writing occurs (!!! not yet implemented) |
Implements MSDetectorFileOutput.
Definition at line 419 of file MSMeanData.cpp.
References OutputDevice::closeTag(), DELTA_T, MIN2(), MSMeanData::myDumpBegin, MSMeanData::myDumpEnd, MSMeanData::myEdges, Named::myID, MSMeanData::myMeasures, MSMeanData::myPendingIntervals, MSMeanData::myTrackVehicles, OutputDevice::openTag(), MSMeanData::resetOnly(), time2string(), and MSMeanData::writeEdge().
const SUMOReal MSMeanData_Net::myHaltSpeed [private] |
the minimum sample seconds
Definition at line 231 of file MSMeanData_Net.h.
Referenced by MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal().
std::string Named::myID [protected, inherited] |
The name of the object.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 83 of file Named.h.
Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), RORouteDef_OrigDest::buildCurrentRoute(), RORouteDef_Complete::buildCurrentRoute(), RORouteDef_Alternatives::buildCurrentRoute(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSMeanData::writeXMLOutput(), and MSE3Collector::writeXMLOutput().
const SUMOReal MSMeanData::myMaxTravelTime [protected, inherited] |
the maximum travel time to write
Definition at line 415 of file MSMeanData.h.
std::vector<std::vector<MeanDataValues*> > MSMeanData::myMeasures [protected, inherited] |
Value collectors; sorted by edge, then by lane.
Definition at line 421 of file MSMeanData.h.
Referenced by MSMeanData_Harmonoise::detectorUpdate(), MSMeanData::init(), MSMeanData::resetOnly(), MSMeanData::writeXMLOutput(), and MSMeanData::~MSMeanData().
const SUMOReal MSMeanData::myMinSamples [protected, inherited] |
the minimum sample seconds
Definition at line 412 of file MSMeanData.h.
const std::set<std::string> MSMeanData::myVehicleTypes [protected, inherited] |
The vehicle types to look for (empty means all)
Definition at line 418 of file MSMeanData.h.
Referenced by createValues(), MSMeanData_HBEFA::createValues(), MSMeanData_Harmonoise::createValues(), MSMeanData::init(), and MSMeanData::MeanDataValues::vehicleApplies().