|
SUMO - Simulation of Urban MObility
|
A device which collects info on the vehicle trip (mainly on departure and arrival) More...
#include <MSDevice_Tripinfo.h>
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. | |
| 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_Tripinfo () throw () | |
| Destructor. | |
Methods called on vehicle movement / state change, overwriting MSDevice | |
| bool | notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) throw () |
| Checks for waiting steps when the vehicle moves. | |
| bool | notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason) throw () |
| Saves departure info on insertion. | |
| bool | notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason) throw () |
| Saves arrival info. | |
Static Public Member Functions | |
| static void | buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into) throw () |
| Build devices for the given vehicle, if needed. | |
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 | |
| MSDevice_Tripinfo (SUMOVehicle &holder, const std::string &id) throw () | |
| Constructor. | |
| MSDevice_Tripinfo (const MSDevice_Tripinfo &) | |
| Invalidated copy constructor. | |
| MSDevice_Tripinfo & | operator= (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 |
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 47 of file MSDevice_Tripinfo.h.
enum MSMoveReminder::Notification [inherited] |
Definition of a vehicle state.
Definition at line 89 of file MSMoveReminder.h.
| MSDevice_Tripinfo::~MSDevice_Tripinfo | ( | ) | throw () |
Destructor.
Definition at line 64 of file MSDevice_Tripinfo.cpp.
| MSDevice_Tripinfo::MSDevice_Tripinfo | ( | SUMOVehicle & | holder, |
| const std::string & | id | ||
| ) | throw () [private] |
Constructor.
| [in] | holder | The vehicle that holds this device |
| [in] | id | The ID of the device |
Definition at line 58 of file MSDevice_Tripinfo.cpp.
| MSDevice_Tripinfo::MSDevice_Tripinfo | ( | const MSDevice_Tripinfo & | ) | [private] |
Invalidated copy constructor.
| void MSDevice_Tripinfo::buildVehicleDevices | ( | SUMOVehicle & | v, |
| std::vector< MSDevice * > & | into | ||
| ) | throw () [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.
| [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 47 of file MSDevice_Tripinfo.cpp.
References OptionsCont::getOptions().
Referenced by MSBaseVehicle::MSBaseVehicle().
| void MSDevice_Tripinfo::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 115 of file MSDevice_Tripinfo.cpp.
References SUMOVehicleParameter::depart, MSLane::dictionary(), MSRoute::end(), SUMOVehicle::getDeparture(), OutputDevice::getDeviceByOption(), SUMOVehicle::getDevices(), SUMOVehicle::getEdge(), MSVehicleType::getID(), SUMOVehicle::getID(), MSRoute::getLength(), SUMOVehicle::getNumberReroutes(), SUMOVehicle::getParameter(), SUMOVehicle::getRoute(), SUMOVehicle::getVehicleType(), myArrivalLane, myArrivalPos, myArrivalSpeed, myArrivalTime, myDepartLane, myDepartPos, myDepartSpeed, MSDevice::myHolder, myWaitingSteps, OutputDevice::openTag(), SUMOReal, and time2string().
| 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().
| bool MSDevice_Tripinfo::notifyEnter | ( | SUMOVehicle & | veh, |
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Saves departure info on insertion.
| [in] | veh | The entering vehicle. |
| [in] | reason | how the vehicle enters the lane |
Reimplemented from MSMoveReminder.
Definition at line 79 of file MSDevice_Tripinfo.cpp.
References MSBaseVehicle::getID(), and MSMoveReminder::NOTIFICATION_DEPARTED.
| bool MSDevice_Tripinfo::notifyLeave | ( | SUMOVehicle & | veh, |
| SUMOReal | lastPos, | ||
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Saves arrival info.
| [in] | veh | The leaving vehicle. |
| [in] | lastPos | Position on the lane when leaving. |
| [in] | isArrival | whether the vehicle arrived at its destination |
| [in] | isLaneChange | whether the vehicle changed from the lane |
Reimplemented from MSMoveReminder.
Definition at line 96 of file MSDevice_Tripinfo.cpp.
References MSNet::getCurrentTimeStep(), MSBaseVehicle::getID(), MSNet::getInstance(), and MSMoveReminder::NOTIFICATION_ARRIVED.
| bool MSDevice_Tripinfo::notifyMove | ( | SUMOVehicle & | veh, |
| SUMOReal | oldPos, | ||
| SUMOReal | newPos, | ||
| SUMOReal | newSpeed | ||
| ) | throw () [virtual] |
Checks for waiting steps when the vehicle moves.
| [in] | veh | Vehicle that asks this reminder. |
| [in] | oldPos | Position before move. |
| [in] | newPos | Position after move with newSpeed. |
| [in] | newSpeed | Moving speed. |
Reimplemented from MSMoveReminder.
Definition at line 69 of file MSDevice_Tripinfo.cpp.
| 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_Tripinfo& MSDevice_Tripinfo::operator= | ( | const MSDevice_Tripinfo & | ) | [private] |
Invalidated assignment operator.
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
std::string MSDevice_Tripinfo::myArrivalLane [private] |
Definition at line 132 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOReal MSDevice_Tripinfo::myArrivalPos [private] |
Definition at line 133 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOReal MSDevice_Tripinfo::myArrivalSpeed [private] |
Definition at line 134 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOTime MSDevice_Tripinfo::myArrivalTime [private] |
Definition at line 131 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
std::string MSDevice_Tripinfo::myDepartLane [private] |
Definition at line 127 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOReal MSDevice_Tripinfo::myDepartPos [private] |
Definition at line 128 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOReal MSDevice_Tripinfo::myDepartSpeed [private] |
Definition at line 129 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().
SUMOVehicle& MSDevice::myHolder [protected, inherited] |
The vehicle that stores the device.
Definition at line 106 of file MSDevice.h.
Referenced by MSDevice_Vehroutes::addRoute(), MSDevice_Vehroutes::generateOutput(), generateOutput(), MSDevice::getHolder(), MSDevice_Vehroutes::writeXMLRoute(), and MSDevice_Vehroutes::~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().
unsigned int MSDevice_Tripinfo::myWaitingSteps [private] |
Definition at line 130 of file MSDevice_Tripinfo.h.
Referenced by generateOutput().