SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_Tripinfo Class Reference

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

#include <MSDevice_Tripinfo.h>

Inheritance diagram for MSDevice_Tripinfo:
MSDevice MSMoveReminder Named

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 addTo (const StoringVisitor &cont) const
 Adds this object to the given container.
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.
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_Tripinfo ()
 Destructor.
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Checks for waiting steps when the vehicle moves.
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Saves departure info on insertion.
bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
 Saves arrival info.

Static Public Member Functions

static void buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into)
 Build devices for the given vehicle, if needed.

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

 MSDevice_Tripinfo (SUMOVehicle &holder, const std::string &id)
 Constructor.
 MSDevice_Tripinfo (const MSDevice_Tripinfo &)
 Invalidated copy constructor.
MSDevice_Tripinfooperator= (const MSDevice_Tripinfo &)
 Invalidated assignment operator.

Private Attributes

std::string myArrivalLane
SUMOReal myArrivalPos
SUMOReal myArrivalSpeed
SUMOTime myArrivalTime
std::string myDepartLane
SUMOReal myDepartPos
SUMOReal myDepartSpeed
unsigned int myWaitingSteps

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 53 of file MSDevice_Tripinfo.h.

Member Enumeration Documentation

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_Tripinfo::~MSDevice_Tripinfo ( )

Destructor.

Definition at line 68 of file MSDevice_Tripinfo.cpp.

MSDevice_Tripinfo::MSDevice_Tripinfo ( SUMOVehicle holder,
const std::string &  id 
)
private

Constructor.

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

Definition at line 62 of file MSDevice_Tripinfo.cpp.

Referenced by buildVehicleDevices().

MSDevice_Tripinfo::MSDevice_Tripinfo ( const MSDevice_Tripinfo )
private

Invalidated copy constructor.

Member Function Documentation

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 114 of file Named.h.

References Named::StoringVisitor::add().

void MSDevice_Tripinfo::buildVehicleDevices ( SUMOVehicle v,
std::vector< MSDevice * > &  into 
)
static

Build devices for the given vehicle, if needed.

The options are read and evaluated whether a tripinfo-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 51 of file MSDevice_Tripinfo.cpp.

References SUMOVehicle::getID(), OptionsCont::getOptions(), and MSDevice_Tripinfo().

Referenced by MSBaseVehicle::MSBaseVehicle().

SUMOVehicle& MSDevice::getHolder ( ) const
inlineinherited

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
inlineinherited

Returns the id.

Returns
The stored id

Reimplemented in MS_E2_ZS_CollectorOverLanes.

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NBEdge::connections_sorter(), NLDetectorBuilder::convUncontE2PosLength(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), 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(), NBRampsComputer::moveRampRight(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), MSVehicle::MSVehicle(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), notifyEnter(), notifyLeave(), MSDevice_Person::notifyLeave(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::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()(), MSEdge::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(), AGStreet::print(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), NIXMLConnectionsHandler::validateLaneInfo(), TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), MSInductLoop::writeTypedXMLOutput(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

bool MSDevice_Tripinfo::notifyEnter ( SUMOVehicle veh,
MSMoveReminder::Notification  reason 
)
virtual

Saves departure info on insertion.

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
Always true
See Also
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented from MSMoveReminder.

Definition at line 83 of file MSDevice_Tripinfo.cpp.

References Named::getID(), MSMoveReminder::getLane(), SUMOVehicle::getPositionOnLane(), SUMOVehicle::getSpeed(), MSGlobals::gUseMesoSim, myDepartLane, myDepartPos, myDepartSpeed, and MSMoveReminder::NOTIFICATION_DEPARTED.

bool MSDevice_Tripinfo::notifyLeave ( SUMOVehicle veh,
SUMOReal  lastPos,
MSMoveReminder::Notification  reason 
)
virtual

Saves arrival info.

Parameters
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]isArrivalwhether the vehicle arrived at its destination
[in]isLaneChangewhether the vehicle changed from the lane
Returns
True if it did not leave the net.

Reimplemented from MSMoveReminder.

Definition at line 96 of file MSDevice_Tripinfo.cpp.

References SUMOVehicle::getArrivalPos(), MSNet::getCurrentTimeStep(), Named::getID(), MSNet::getInstance(), MSMoveReminder::getLane(), SUMOVehicle::getSpeed(), MSGlobals::gUseMesoSim, myArrivalLane, myArrivalPos, myArrivalSpeed, myArrivalTime, MSDevice::myHolder, and MSMoveReminder::NOTIFICATION_ARRIVED.

bool MSDevice_Tripinfo::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
)
virtual

Checks for waiting steps when the vehicle moves.

Parameters
[in]vehVehicle that asks this reminder.
[in]oldPosPosition before move.
[in]newPosPosition after move with newSpeed.
[in]newSpeedMoving speed.
Returns
True (always).

Reimplemented from MSMoveReminder.

Definition at line 73 of file MSDevice_Tripinfo.cpp.

References myWaitingSteps.

virtual void MSMoveReminder::notifyMoveInternal ( SUMOVehicle veh,
SUMOReal  timeOnLane,
SUMOReal  speed 
)
inlinevirtualinherited

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_Tripinfo& MSDevice_Tripinfo::operator= ( const MSDevice_Tripinfo )
private

Invalidated assignment operator.

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

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

Field Documentation

std::string MSDevice_Tripinfo::myArrivalLane
private

Definition at line 138 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyLeave().

SUMOReal MSDevice_Tripinfo::myArrivalPos
private

Definition at line 139 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyLeave().

SUMOReal MSDevice_Tripinfo::myArrivalSpeed
private

Definition at line 140 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyLeave().

SUMOTime MSDevice_Tripinfo::myArrivalTime
private

Definition at line 137 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyLeave().

std::string MSDevice_Tripinfo::myDepartLane
private

Definition at line 133 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyEnter().

SUMOReal MSDevice_Tripinfo::myDepartPos
private

Definition at line 134 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyEnter().

SUMOReal MSDevice_Tripinfo::myDepartSpeed
private

Definition at line 135 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyEnter().

MSLane* const MSMoveReminder::myLane
protectedinherited
unsigned int MSDevice_Tripinfo::myWaitingSteps
private

Definition at line 136 of file MSDevice_Tripinfo.h.

Referenced by generateOutput(), and notifyMove().


The documentation for this class was generated from the following files: