SUMO - Simulation of Urban MObility
|
Writes positions of vehicles that have a certain (named) type. More...
#include <MSVTypeProbe.h>
Public Member Functions | |
const std::string & | getID () const |
Returns the id. | |
MSVTypeProbe (const std::string &id, const std::string &vType, OutputDevice &od, SUMOTime frequency) | |
Constructor. | |
void | setID (const std::string &newID) |
resets the id | |
virtual | ~MSVTypeProbe () |
Destructor. | |
Derived from Command | |
SUMOTime | execute (SUMOTime currentTime) |
Writes values into the given stream. |
Protected Attributes | |
std::string | myID |
The name of the object. |
Private Member Functions | |
MSVTypeProbe (const MSVTypeProbe &) | |
Invalidated copy constructor. | |
MSVTypeProbe & | operator= (const MSVTypeProbe &) |
Invalidated assignment operator. |
Private Attributes | |
SUMOTime | myFrequency |
The frequency of reporting. | |
OutputDevice & | myOutputDevice |
The device to write into. | |
std::string | myVType |
The id of the vehicle type vehicles must have to be reported. |
Writes positions of vehicles that have a certain (named) type.
This device allows to log the data of all running vehicles of the specified vehicle type, i.e. vehicle id, edge, lane=, position on lane, x/y coordinates and speed.
A frequency can be specified to generate the output in certain intervals, (e.g. every 10 seconds).
Definition at line 60 of file MSVTypeProbe.h.
MSVTypeProbe::MSVTypeProbe | ( | const std::string & | id, |
const std::string & | vType, | ||
OutputDevice & | od, | ||
SUMOTime | frequency | ||
) |
Constructor.
[in] | id | The id of the vehicle type probe |
[in] | vType | The vtype of which vehicles to report must be ("" for all vehicles) |
[in] | od | The output device to write into |
[in] | frequency | The output frequency [ms] |
Definition at line 52 of file MSVTypeProbe.cpp.
References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), MSNet::getInstance(), myOutputDevice, and OutputDevice::writeXMLHeader().
|
virtual |
Destructor.
Definition at line 61 of file MSVTypeProbe.cpp.
|
private |
Invalidated copy constructor.
Writes values into the given stream.
This method goes through all runing vehicles; if a vehicle has a type with the same id as the wished one, it is reported. When the type "" is wished, all vehicles are reported
[in] | currentTime | The current simulation time (unused) |
Implements Command.
Definition at line 66 of file MSVTypeProbe.cpp.
References GeoConvHelper::cartesian2geo(), GEO_OUTPUT_ACCURACY, GeoConvHelper::getFinal(), Named::getID(), MSBaseVehicle::getID(), MSVehicleType::getID(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getPositionOnLane(), MSLane::getShape(), MSVehicle::getSpeed(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), MSVehicle::isOnRoad(), MSVehicleControl::loadedVehBegin(), MSVehicleControl::loadedVehEnd(), myFrequency, myOutputDevice, myVType, PositionVector::positionAtLengthPosition(), OutputDevice::setPrecision(), time2string(), Position::x(), and Position::y().
|
inlineinherited |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 61 of file Named.h.
References Named::myID.
Referenced by MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::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(), 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(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), 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(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::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(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::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().
|
private |
Invalidated assignment operator.
|
inlineinherited |
resets the id
Definition at line 67 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
private |
|
protectedinherited |
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(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), RORouteDef_OrigDest::preComputeCurrentRoute(), RORouteDef_Alternatives::preComputeCurrentRoute(), RORouteDef_Complete::preComputeCurrentRoute(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSE3Collector::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
private |
The device to write into.
Definition at line 100 of file MSVTypeProbe.h.
Referenced by execute(), and MSVTypeProbe().
|
private |
The id of the vehicle type vehicles must have to be reported.
Definition at line 97 of file MSVTypeProbe.h.
Referenced by execute().