SUMO - Simulation of Urban MObility
MSDevice_Vehroutes Class Reference

A device which collects info on the vehicle trip (mainly on departure and arrival) More...

#include <MSDevice_Vehroutes.h>

Inheritance diagram for MSDevice_Vehroutes:
MSDevice MSMoveReminder Named

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
 Called on writing tripinfo output.
SUMOVehiclegetHolder () const
 Returns the vehicle that holds this device.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane the reminder works on.
const MSRoutegetRoute (int index) const
 Called on route retrieval.
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves.
void setID (const std::string &newID)
 resets the id
 ~MSDevice_Vehroutes ()
 Destructor.
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Does nothing, returns true only if exit times should be collected.
bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
 Saves exit times if needed.
Interface methods, to be derived by subclasses
virtual bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Checks whether the reminder still has to be notified about the vehicle moves.

Static Public Member Functions

static MSDevice_VehroutesbuildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into, unsigned int maxRoutes=INT_MAX)
 Build devices for the given vehicle, if needed.
static void init ()
 Static intialization.

Protected Attributes

SUMOVehiclemyHolder
 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 (SUMOVehicle &holder, const std::string &id, unsigned int maxRoutes)
 Constructor.
 MSDevice_Vehroutes (const MSDevice_Vehroutes &)
 Invalidated copy constructor.
MSDevice_Vehroutesoperator= (const MSDevice_Vehroutes &)
 Invalidated assignment operator.
void writeXMLRoute (OutputDevice &os, int index=-1) const
 Called on route output.

Private Attributes

const MSRoutemyCurrentRoute
std::vector< SUMOTimemyExits
const MSEdgemyLastSavedAt
const unsigned int myMaxRoutes
std::vector< RouteReplaceInfomyReplacedRoutes

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".

Detailed Description

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.

See also:
MSDevice

Definition at line 57 of file MSDevice_Vehroutes.h.


Member Enumeration Documentation

enum MSMoveReminder::Notification [inherited]

Definition of a vehicle state.

Enumerator:
NOTIFICATION_DEPARTED 

The vehicle has departed (was inserted into the network)

NOTIFICATION_JUNCTION 

The vehicle arrived at a junction.

NOTIFICATION_SEGMENT 

The vehicle changes the segment (meso only)

NOTIFICATION_LANE_CHANGE 

The vehicle changes lanes (micro only)

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_VAPORIZED 

The vehicle got vaporized.

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

Definition at line 93 of file MSMoveReminder.h.


Constructor & Destructor Documentation

MSDevice_Vehroutes::MSDevice_Vehroutes ( SUMOVehicle holder,
const std::string &  id,
unsigned int  maxRoutes 
) [private]

Constructor.

Parameters:
[in]holderThe vehicle that holds this device
[in]idThe ID of the device

Definition at line 109 of file MSDevice_Vehroutes.cpp.

References MSRoute::addReference(), and myCurrentRoute.

Referenced by buildVehicleDevices().

Invalidated copy constructor.


Member Function Documentation

MSDevice_Vehroutes * MSDevice_Vehroutes::buildVehicleDevices ( SUMOVehicle v,
std::vector< MSDevice * > &  into,
unsigned int  maxRoutes = INT_MAX 
) [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.

Parameters:
[in]vThe vehicle for which a device may be built
in,filled]into The vector to store the built device in

Definition at line 79 of file MSDevice_Vehroutes.cpp.

References SUMOVehicle::getID(), OptionsCont::getOptions(), OptionsCont::isSet(), MSDevice_Vehroutes(), MSDevice_Vehroutes::StateListener::myDevices, myLastRouteOnly, and myStateListener.

Referenced by GUIVehicle::GUIVehicle(), and MSBaseVehicle::MSBaseVehicle().

SUMOVehicle& MSDevice::getHolder ( ) const [inline, inherited]

Returns the vehicle that holds this device.

Returns:
The vehicle that holds this device

Definition at line 85 of file MSDevice.h.

References MSDevice::myHolder.

const std::string& Named::getID ( ) const [inline, inherited]

Returns the id.

Returns:
The stored 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(), MSVTypeProbe::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().

const MSRoute * MSDevice_Vehroutes::getRoute ( int  index) const

Called on route retrieval.

Parameters:
[in]indexThe index of the route to retrieve
Returns:
the route at the index

Definition at line 243 of file MSDevice_Vehroutes.cpp.

References myReplacedRoutes.

Referenced by GUIVehicle::drawRoute().

Does nothing, returns true only if exit times should be collected.

Parameters:
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns:
True, if exit times are to be collected.
See also:
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented from MSMoveReminder.

Definition at line 125 of file MSDevice_Vehroutes.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), myDepartureCounts, MSDevice_Vehroutes::StateListener::myDevices, mySaveExits, mySorted, myStateListener, and MSMoveReminder::NOTIFICATION_DEPARTED.

Saves exit times if needed.

The exit time is collected on all occasions except for lane change.

Parameters:
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]reasonhow the vehicle leaves the lane
See also:
MSMoveReminder::notifyLeave
Returns:
True, if exit times are to be collected.

Reimplemented from MSMoveReminder.

Definition at line 134 of file MSDevice_Vehroutes.cpp.

References MSNet::getCurrentTimeStep(), SUMOVehicle::getEdge(), 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 
) [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.

Parameters:
[in]vehVehicle that asks this reminder.
[in]oldPosPosition before move.
[in]newPosPosition after move with newSpeed.
[in]newSpeedMoving speed.
Returns:
True if vehicle hasn't passed the reminder completely.

Reimplemented in MSE3Collector::MSE3LeaveReminder, MSE2Collector, MSInductLoop, MSMeanData::MeanDataValues, MSDevice_HBEFA, MSE3Collector::MSE3EntryReminder, MSInstantInductLoop, MSDevice_Person, and MSDevice_Tripinfo.

Definition at line 148 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

virtual void MSMoveReminder::notifyMoveInternal ( SUMOVehicle veh,
SUMOReal  timeOnLane,
SUMOReal  speed 
) [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.

Parameters:
[in]vehVehicle that asks this reminder.
[in]timeOnLanetime the vehicle spent on the lane.
[in]speedMoving speed.

Reimplemented in MSMeanData::MeanDataValueTracker, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_HBEFA::MSLaneMeanDataValues.

Definition at line 200 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]

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

void MSDevice_Vehroutes::writeXMLRoute ( OutputDevice os,
int  index = -1 
) const [private]

Called on route output.

Parameters:
[in]osthe device to write into
[in]indexThe index of the route to write (-1 writes the current route)

Definition at line 148 of file MSDevice_Vehroutes.cpp.

References SUMOVehicle::getNumberReroutes(), myCurrentRoute, myExits, MSDevice::myHolder, myReplacedRoutes, mySaveExits, OutputDevice::openTag(), time2string(), and MSRoute::writeEdgeIDs().

Referenced by generateOutput().


Field Documentation

std::map< const SUMOTime, int > MSDevice_Vehroutes::myDepartureCounts [static, private]

Definition at line 180 of file MSDevice_Vehroutes.h.

Referenced by generateOutput(), and notifyEnter().

std::vector<SUMOTime> MSDevice_Vehroutes::myExits [private]

Definition at line 215 of file MSDevice_Vehroutes.h.

Referenced by notifyLeave(), and writeXMLRoute().

MSLane* const MSMoveReminder::myLane [protected, inherited]
bool MSDevice_Vehroutes::myLastRouteOnly = false [static, private]

A shortcut for the Option "vehroute-output.last-route".

Definition at line 155 of file MSDevice_Vehroutes.h.

Referenced by buildVehicleDevices(), and init().

Definition at line 217 of file MSDevice_Vehroutes.h.

Referenced by notifyLeave().

const unsigned int MSDevice_Vehroutes::myMaxRoutes [private]

Definition at line 216 of file MSDevice_Vehroutes.h.

Referenced by addRoute().

std::map< const SUMOTime, std::string > MSDevice_Vehroutes::myRouteInfos [static, private]

Definition at line 182 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 152 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 158 of file MSDevice_Vehroutes.h.

Referenced by generateOutput(), init(), and notifyEnter().

bool MSDevice_Vehroutes::myWithTaz = false [static, private]

A shortcut for the Option "device.routing.with-taz".

Definition at line 161 of file MSDevice_Vehroutes.h.

Referenced by generateOutput(), and init().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines