|
SUMO - Simulation of Urban MObility
|
A device which collects info on the vehicle trip (mainly on departure and arrival) More...
#include <MSDevice_Vehroutes.h>
Data Structures | |
| class | RouteReplaceInfo |
| Information about a replaced route. More... | |
| class | StateListener |
Public Types | |
| enum | Notification { NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE, NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED, NOTIFICATION_TELEPORT_ARRIVED } |
Definition of a vehicle state. More... | |
Public Member Functions | |
| void | generateOutput () const throw (IOError) |
| Called on writing tripinfo output. | |
| SUMOVehicle & | getHolder () const throw () |
| Returns the vehicle that holds this device. | |
| const std::string & | getID () const |
| Returns the id. | |
| const MSLane * | getLane () const throw () |
| Returns the lane the reminder works on. | |
| const MSRoute * | getRoute (int index) const |
| Called on route retrieval. | |
| virtual void | notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed) throw () |
| Internal notification about the vehicle moves. | |
| void | setID (const std::string &newID) |
| resets the id | |
| ~MSDevice_Vehroutes () throw () | |
| Destructor. | |
Methods called on vehicle movement / state change, overwriting MSDevice | |
| bool | notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason) throw () |
| Does nothing, returns true only if exit times should be collected. | |
| bool | notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason) throw () |
| Saves exit times if needed. | |
Interface methods, to be derived by subclasses | |
| virtual bool | notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) throw () |
| Checks whether the reminder still has to be notified about the vehicle moves. | |
Static Public Member Functions | |
| static MSDevice_Vehroutes * | buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into, unsigned int maxRoutes=INT_MAX) throw () |
| Build devices for the given vehicle, if needed. | |
| static void | init () throw (IOError) |
| Static intialization. | |
Protected Attributes | |
| SUMOVehicle & | myHolder |
| The vehicle that stores the device. | |
| std::string | myID |
| The name of the object. | |
| MSLane *const | myLane |
| Lane on which the reminder works. | |
Private Member Functions | |
| void | addRoute () |
| Called on route change. | |
| MSDevice_Vehroutes (const MSDevice_Vehroutes &) | |
| Invalidated copy constructor. | |
| MSDevice_Vehroutes (SUMOVehicle &holder, const std::string &id, unsigned int maxRoutes) throw () | |
| Constructor. | |
| MSDevice_Vehroutes & | operator= (const MSDevice_Vehroutes &) |
| Invalidated assignment operator. | |
| void | writeXMLRoute (OutputDevice &os, int index=-1) const |
| Called on route output. | |
Private Attributes | |
| const MSRoute * | myCurrentRoute |
| std::vector< SUMOTime > | myExits |
| const MSEdge * | myLastSavedAt |
| const unsigned int | myMaxRoutes |
| std::vector< RouteReplaceInfo > | myReplacedRoutes |
Static Private Attributes | |
| static std::map< const SUMOTime, int > | myDepartureCounts |
| static bool | myLastRouteOnly = false |
| A shortcut for the Option "vehroute-output.last-route". | |
| static std::map< const SUMOTime, std::string > | myRouteInfos |
| static bool | mySaveExits = false |
| A shortcut for the Option "vehroute-output.exit-times". | |
| static bool | mySorted = false |
| A shortcut for the Option "vehroute-output.sorted". | |
| static StateListener | myStateListener |
| static bool | myWithTaz = false |
| A shortcut for the Option "device.routing.with-taz". | |
A device which collects info on the vehicle trip (mainly on departure and arrival)
Each device collects departure time, lane and speed and the same for arrival.
Definition at line 55 of file MSDevice_Vehroutes.h.
enum MSMoveReminder::Notification [inherited] |
Definition of a vehicle state.
Definition at line 89 of file MSMoveReminder.h.
| MSDevice_Vehroutes::~MSDevice_Vehroutes | ( | ) | throw () |
Destructor.
Definition at line 108 of file MSDevice_Vehroutes.cpp.
References myCurrentRoute, MSDevice_Vehroutes::StateListener::myDevices, MSDevice::myHolder, myReplacedRoutes, myStateListener, and MSRoute::release().
| MSDevice_Vehroutes::MSDevice_Vehroutes | ( | SUMOVehicle & | holder, |
| const std::string & | id, | ||
| unsigned int | maxRoutes | ||
| ) | throw () [private] |
Constructor.
| [in] | holder | The vehicle that holds this device |
| [in] | id | The ID of the device |
Definition at line 102 of file MSDevice_Vehroutes.cpp.
References MSRoute::addReference(), and myCurrentRoute.
| MSDevice_Vehroutes::MSDevice_Vehroutes | ( | const MSDevice_Vehroutes & | ) | [private] |
Invalidated copy constructor.
| void MSDevice_Vehroutes::addRoute | ( | ) | [private] |
Called on route change.
Definition at line 241 of file MSDevice_Vehroutes.cpp.
References MSRoute::addReference(), MSNet::getCurrentTimeStep(), SUMOVehicle::getDeparture(), SUMOVehicle::getEdge(), MSNet::getInstance(), SUMOVehicle::getRoute(), myCurrentRoute, MSDevice::myHolder, myMaxRoutes, myReplacedRoutes, and MSRoute::release().
| MSDevice_Vehroutes * MSDevice_Vehroutes::buildVehicleDevices | ( | SUMOVehicle & | v, |
| std::vector< MSDevice * > & | into, | ||
| unsigned int | maxRoutes = INT_MAX |
||
| ) | throw () [static] |
Build devices for the given vehicle, if needed.
The options are read and evaluated whether a vehroutes-device shall be built for the given vehicle.
The built device is stored in the given vector.
| [in] | v | The vehicle for which a device may be built |
| in,filled] | into The vector to store the built device in |
Definition at line 72 of file MSDevice_Vehroutes.cpp.
References OptionsCont::getOptions(), and OptionsCont::isSet().
Referenced by GUIVehicle::GUIVehicle(), and MSBaseVehicle::MSBaseVehicle().
| void MSDevice_Vehroutes::generateOutput | ( | ) | const throw (IOError) [virtual] |
Called on writing tripinfo output.
| [in] | os | The stream to write the information into |
| IOError | not yet implemented |
Reimplemented from MSDevice.
Definition at line 194 of file MSDevice_Vehroutes.cpp.
References OutputDevice::closeTag(), DEFAULT_VTYPE_ID, SUMOVehicleParameter::fromTaz, SUMOVehicle::getDeparture(), OutputDevice::getDeviceByOption(), MSVehicleType::getID(), SUMOVehicle::getID(), MSNet::getInstance(), SUMOVehicle::getParameter(), OutputDevice_String::getString(), SUMOVehicle::getVehicleType(), myDepartureCounts, MSDevice::myHolder, myReplacedRoutes, myRouteInfos, mySorted, myWithTaz, OutputDevice::openTag(), SUMO_ATTR_DEPART, SUMO_ATTR_FROM_TAZ, SUMO_ATTR_ID, SUMO_ATTR_TO_TAZ, SUMO_ATTR_TYPE, time2string(), SUMOVehicleParameter::toTaz, OutputDevice::writeAttr(), and writeXMLRoute().
| SUMOVehicle& MSDevice::getHolder | ( | ) | const throw () [inline, inherited] |
Returns the vehicle that holds this device.
Definition at line 83 of file MSDevice.h.
References MSDevice::myHolder.
| const std::string& Named::getID | ( | ) | const [inline, inherited] |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 59 of file Named.h.
References Named::myID.
Referenced by RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), NIImporter_SUMO::addPhase(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), RORouteDef_Complete::buildCurrentRoute(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), 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(), NBNodeCont::remapEdge(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeDummyEdges(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), 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(), and MSRouteProbe::writeXMLOutput().
| const MSLane* MSMoveReminder::getLane | ( | ) | const throw () [inline, inherited] |
Returns the lane the reminder works on.
Definition at line 83 of file MSMoveReminder.h.
References MSMoveReminder::myLane.
Referenced by GUIInstantInductLoop::buildDetectorGUIRepresentation(), GUIInductLoop::buildDetectorGUIRepresentation(), TraCIServerAPI_InductionLoop::processGet(), and MSMeanData::writeEdge().
| const MSRoute * MSDevice_Vehroutes::getRoute | ( | int | index | ) | const |
Called on route retrieval.
| [in] | index | The index of the route to retrieve |
Definition at line 235 of file MSDevice_Vehroutes.cpp.
References myReplacedRoutes.
Referenced by GUIVehicle::drawRoute().
| void MSDevice_Vehroutes::init | ( | ) | throw (IOError) [static] |
Static intialization.
Definition at line 59 of file MSDevice_Vehroutes.cpp.
References MSNet::addVehicleStateListener(), OutputDevice::createDeviceByOption(), OptionsCont::getBool(), MSNet::getInstance(), OptionsCont::getOptions(), myLastRouteOnly, mySaveExits, mySorted, myStateListener, and myWithTaz.
Referenced by MSFrame::buildStreams().
| bool MSDevice_Vehroutes::notifyEnter | ( | SUMOVehicle & | veh, |
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Does nothing, returns true only if exit times should be collected.
| [in] | veh | The entering vehicle. |
| [in] | reason | how the vehicle enters the lane |
Reimplemented from MSMoveReminder.
Definition at line 118 of file MSDevice_Vehroutes.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), myDepartureCounts, MSDevice_Vehroutes::StateListener::myDevices, mySaveExits, mySorted, myStateListener, and MSMoveReminder::NOTIFICATION_DEPARTED.
| bool MSDevice_Vehroutes::notifyLeave | ( | SUMOVehicle & | veh, |
| SUMOReal | lastPos, | ||
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Saves exit times if needed.
The exit time is collected on all occasions except for lane change.
| [in] | veh | The leaving vehicle. |
| [in] | lastPos | Position on the lane when leaving. |
| [in] | reason | how the vehicle leaves the lane |
Reimplemented from MSMoveReminder.
Definition at line 127 of file MSDevice_Vehroutes.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), myExits, myLastSavedAt, mySaveExits, MSMoveReminder::NOTIFICATION_LANE_CHANGE, and MSMoveReminder::NOTIFICATION_TELEPORT.
| virtual bool MSMoveReminder::notifyMove | ( | SUMOVehicle & | veh, |
| SUMOReal | oldPos, | ||
| SUMOReal | newPos, | ||
| SUMOReal | newSpeed | ||
| ) | throw () [inline, virtual, inherited] |
Checks whether the reminder still has to be notified about the vehicle moves.
Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.
| [in] | veh | Vehicle that asks this reminder. |
| [in] | oldPos | Position before move. |
| [in] | newPos | Position after move with newSpeed. |
| [in] | newSpeed | Moving speed. |
Reimplemented in MSDevice_HBEFA, MSDevice_Person, MSDevice_Tripinfo, MSE2Collector, MSE3Collector::MSE3EntryReminder, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSInstantInductLoop, and MSMeanData::MeanDataValues.
Definition at line 144 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
| virtual void MSMoveReminder::notifyMoveInternal | ( | SUMOVehicle & | veh, |
| SUMOReal | timeOnLane, | ||
| SUMOReal | speed | ||
| ) | throw () [inline, virtual, inherited] |
Internal notification about the vehicle moves.
Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.
| [in] | veh | Vehicle that asks this reminder. |
| [in] | timeOnLane | time the vehicle spent on the lane. |
| [in] | speed | Moving speed. |
Reimplemented in MSMeanData::MeanDataValueTracker, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_HBEFA::MSLaneMeanDataValues, and MSMeanData_Net::MSLaneMeanDataValues.
Definition at line 196 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
| MSDevice_Vehroutes& MSDevice_Vehroutes::operator= | ( | const MSDevice_Vehroutes & | ) | [private] |
Invalidated assignment operator.
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
| void MSDevice_Vehroutes::writeXMLRoute | ( | OutputDevice & | os, |
| int | index = -1 |
||
| ) | const [private] |
Called on route output.
| [in] | os | the device to write into |
| [in] | index | The index of the route to write (-1 writes the current route) |
Definition at line 141 of file MSDevice_Vehroutes.cpp.
References SUMOVehicle::getNumberReroutes(), myCurrentRoute, myExits, MSDevice::myHolder, myReplacedRoutes, mySaveExits, OutputDevice::openTag(), time2string(), and MSRoute::writeEdgeIDs().
Referenced by generateOutput().
const MSRoute* MSDevice_Vehroutes::myCurrentRoute [private] |
Definition at line 211 of file MSDevice_Vehroutes.h.
Referenced by addRoute(), MSDevice_Vehroutes(), writeXMLRoute(), and ~MSDevice_Vehroutes().
std::map< const SUMOTime, int > MSDevice_Vehroutes::myDepartureCounts [static, private] |
Definition at line 178 of file MSDevice_Vehroutes.h.
Referenced by generateOutput(), and notifyEnter().
std::vector<SUMOTime> MSDevice_Vehroutes::myExits [private] |
Definition at line 213 of file MSDevice_Vehroutes.h.
Referenced by notifyLeave(), and writeXMLRoute().
SUMOVehicle& MSDevice::myHolder [protected, inherited] |
The vehicle that stores the device.
Definition at line 106 of file MSDevice.h.
Referenced by addRoute(), generateOutput(), MSDevice_Tripinfo::generateOutput(), MSDevice::getHolder(), writeXMLRoute(), and ~MSDevice_Vehroutes().
std::string Named::myID [protected, inherited] |
The name of the object.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 81 of file Named.h.
Referenced by RORouteDef_OrigDest::buildCurrentRoute(), RORouteDef_Complete::buildCurrentRoute(), RORouteDef_Alternatives::buildCurrentRoute(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), NBNode::writeLogic(), and MSMeanData::writeXMLOutput().
MSLane* const MSMoveReminder::myLane [protected, inherited] |
Lane on which the reminder works.
Definition at line 211 of file MSMoveReminder.h.
Referenced by MSMoveReminder::getLane().
bool MSDevice_Vehroutes::myLastRouteOnly = false [static, private] |
A shortcut for the Option "vehroute-output.last-route".
Definition at line 153 of file MSDevice_Vehroutes.h.
Referenced by init().
const MSEdge* MSDevice_Vehroutes::myLastSavedAt [private] |
Definition at line 215 of file MSDevice_Vehroutes.h.
Referenced by notifyLeave().
const unsigned int MSDevice_Vehroutes::myMaxRoutes [private] |
Definition at line 214 of file MSDevice_Vehroutes.h.
Referenced by addRoute().
std::vector<RouteReplaceInfo> MSDevice_Vehroutes::myReplacedRoutes [private] |
Definition at line 212 of file MSDevice_Vehroutes.h.
Referenced by addRoute(), generateOutput(), getRoute(), writeXMLRoute(), and ~MSDevice_Vehroutes().
std::map< const SUMOTime, std::string > MSDevice_Vehroutes::myRouteInfos [static, private] |
Definition at line 180 of file MSDevice_Vehroutes.h.
Referenced by generateOutput().
bool MSDevice_Vehroutes::mySaveExits = false [static, private] |
A shortcut for the Option "vehroute-output.exit-times".
Definition at line 150 of file MSDevice_Vehroutes.h.
Referenced by init(), notifyEnter(), notifyLeave(), and writeXMLRoute().
bool MSDevice_Vehroutes::mySorted = false [static, private] |
A shortcut for the Option "vehroute-output.sorted".
Definition at line 156 of file MSDevice_Vehroutes.h.
Referenced by generateOutput(), init(), and notifyEnter().
MSDevice_Vehroutes::StateListener MSDevice_Vehroutes::myStateListener [static, private] |
Definition at line 176 of file MSDevice_Vehroutes.h.
Referenced by init(), notifyEnter(), and ~MSDevice_Vehroutes().
bool MSDevice_Vehroutes::myWithTaz = false [static, private] |
A shortcut for the Option "device.routing.with-taz".
Definition at line 159 of file MSDevice_Vehroutes.h.
Referenced by generateOutput(), and init().