|
SUMO - Simulation of Urban MObility
|
An instantaneous induction loop. More...
#include <MSInstantInductLoop.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 | |
| const std::string & | getID () const |
| Returns the id. | |
| const MSLane * | getLane () const throw () |
| Returns the lane the reminder works on. | |
| MSInstantInductLoop (const std::string &id, OutputDevice &od, MSLane *const lane, SUMOReal positionInMeters) throw () | |
| Constructor. | |
| 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 | |
| void | writeXMLDetectorProlog (OutputDevice &dev) const throw (IOError) |
| Open the XML-output. | |
| void | writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) throw (IOError) |
| Write the generated output to the given device. | |
| ~MSInstantInductLoop () throw () | |
| Destructor. | |
Methods inherited from MSMoveReminder | |
| bool | notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) throw () |
| Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder. | |
| bool | notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason) throw () |
| Dismisses the vehicle if it is on the detector due to a lane change. | |
| bool | notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason) throw () |
| Returns whether the detector may has to be concerned during the vehicle's further movement. | |
Virtual methods to implement by derived classes | |
| virtual void | reset () throw () |
| Resets collected values. | |
| virtual void | detectorUpdate (const SUMOTime step) throw () |
| Updates the detector (computes values) | |
| virtual GUIDetectorWrapper * | buildDetectorGUIRepresentation () |
| Builds the graphical representation. | |
Protected Member Functions | |
| void | write (const char *state, SUMOReal t, SUMOVehicle &veh, SUMOReal speed, const char *add=0, SUMOReal addValue=-1) |
| Writes an event line. | |
Protected Attributes | |
| std::map< SUMOVehicle *, SUMOReal > | myEntryTimes |
| The last exit time. | |
| std::string | myID |
| The name of the object. | |
| MSLane *const | myLane |
| Lane on which the reminder works. | |
| SUMOReal | myLastExitTime |
| The last exit time. | |
| OutputDevice & | myOutputDevice |
| The output device to use. | |
| const SUMOReal | myPosition |
| Detector's position on lane [m]. | |
Private Member Functions | |
| MSInstantInductLoop (const MSInstantInductLoop &) | |
| Invalidated copy constructor. | |
| MSInstantInductLoop & | operator= (const MSInstantInductLoop &) |
| Invalidated assignment operator. | |
An instantaneous induction loop.
Definition at line 58 of file MSInstantInductLoop.h.
enum MSMoveReminder::Notification [inherited] |
Definition of a vehicle state.
Definition at line 89 of file MSMoveReminder.h.
| MSInstantInductLoop::MSInstantInductLoop | ( | const std::string & | id, |
| OutputDevice & | od, | ||
| MSLane *const | lane, | ||
| SUMOReal | positionInMeters | ||
| ) | throw () |
Constructor.
| [in] | id | Unique id |
| [in] | od | The device to write to |
| [in] | lane | Lane where detector woks on. |
| [in] | position | Position of the detector within the lane. |
Definition at line 51 of file MSInstantInductLoop.cpp.
| MSInstantInductLoop::~MSInstantInductLoop | ( | ) | throw () |
Destructor.
Definition at line 60 of file MSInstantInductLoop.cpp.
| MSInstantInductLoop::MSInstantInductLoop | ( | const MSInstantInductLoop & | ) | [private] |
Invalidated copy constructor.
| virtual GUIDetectorWrapper* MSDetectorFileOutput::buildDetectorGUIRepresentation | ( | ) | [inline, virtual, inherited] |
Builds the graphical representation.
Meant to be overridden by grahical versions of the detectors
Reimplemented in GUI_E2_ZS_Collector, GUI_E2_ZS_CollectorOverLanes, GUIE3Collector, GUIInductLoop, and GUIInstantInductLoop.
Definition at line 117 of file MSDetectorFileOutput.h.
| virtual void MSDetectorFileOutput::detectorUpdate | ( | const SUMOTime | step | ) | throw () [inline, virtual, inherited] |
Updates the detector (computes values)
| [in] | step | The current time step |
Reimplemented in MSE2Collector, MSE3Collector, MSMeanData, and MSMeanData_Harmonoise.
Definition at line 109 of file MSDetectorFileOutput.h.
| 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(), 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 MSInstantInductLoop::notifyEnter | ( | SUMOVehicle & | veh, |
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Returns whether the detector may has to be concerned during the vehicle's further movement.
If the detector is in front of the vehicle, true is returned. If the vehicle's front has passed the detector, false, because the vehicle is no longer relevant for the detector.
| [in] | veh | The entering vehicle. |
| [in] | reason | how the vehicle enters the lane |
Reimplemented from MSMoveReminder.
Definition at line 135 of file MSInstantInductLoop.cpp.
References MSVehicleType::getLengthWithGap(), SUMOVehicle::getPositionOnLane(), SUMOVehicle::getVehicleType(), and myPosition.
| bool MSInstantInductLoop::notifyLeave | ( | SUMOVehicle & | veh, |
| SUMOReal | lastPos, | ||
| MSMoveReminder::Notification | reason | ||
| ) | throw () [virtual] |
Dismisses the vehicle if it is on the detector due to a lane change.
If the vehicle is on the detector, it will be dismissed by incrementing myDismissedVehicleNumber and removing this vehicle's entering time from myVehiclesOnDet.
| [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 121 of file MSInstantInductLoop.cpp.
References MSNet::getInstance(), MSMoveReminder::NOTIFICATION_JUNCTION, and STEPS2TIME.
| bool MSInstantInductLoop::notifyMove | ( | SUMOVehicle & | veh, |
| SUMOReal | oldPos, | ||
| SUMOReal | newPos, | ||
| SUMOReal | newSpeed | ||
| ) | throw () [virtual] |
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
As soon a vehicle enters the detector, its entry time is computed and stored in myVehiclesOnDet via enterDetectorByMove. If it passes the detector, the according leaving time is computed and stored, too, using leaveDetectorByMove.
| [in] | veh | Vehicle that asks this remider. |
| [in] | oldPos | Position before move. |
| [in] | newPos | Position after move with newSpeed. |
| [in] | newSpeed | Moving speed. |
Reimplemented from MSMoveReminder.
Definition at line 65 of file MSInstantInductLoop.cpp.
References MSNet::getInstance(), STEPS2TIME, and SUMOReal.
| 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.
| MSInstantInductLoop& MSInstantInductLoop::operator= | ( | const MSInstantInductLoop & | ) | [private] |
Invalidated assignment operator.
| virtual void MSDetectorFileOutput::reset | ( | ) | throw () [inline, virtual, inherited] |
Resets collected values.
Please note that this is only a "hack" for coupled-tls-outputs.
Reimplemented in GUIInductLoop, MSE2Collector, MSE3Collector, and MSInductLoop.
Definition at line 102 of file MSDetectorFileOutput.h.
Referenced by Command_SaveTLCoupledLaneDet::execute().
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
| void MSInstantInductLoop::write | ( | const char * | state, |
| SUMOReal | t, | ||
| SUMOVehicle & | veh, | ||
| SUMOReal | speed, | ||
| const char * | add = 0, |
||
| SUMOReal | addValue = -1 |
||
| ) | [protected] |
Writes an event line.
| [in] | state | The current state to report |
| [in] | t | The event time |
| [in] | veh | The vehicle responsible for the event |
| [in] | speed | The speed of the vehicle |
| [in] | add | An optional attribute to report |
| [in] | addValue | The value of the optional attribute |
Definition at line 107 of file MSInstantInductLoop.cpp.
References OutputDevice::closeTag(), MSVehicleType::getID(), SUMOVehicle::getID(), Named::getID(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), myOutputDevice, OutputDevice::openTag(), toString(), and OutputDevice::writeAttr().
| void MSInstantInductLoop::writeXMLDetectorProlog | ( | OutputDevice & | dev | ) | const throw (IOError) [virtual] |
Open the XML-output.
The implementing function should open an xml element using OutputDevice::writeXMLHeader.
| [in] | dev | The output device to write the root into |
| IOError | If an error on writing occurs |
Implements MSDetectorFileOutput.
Definition at line 146 of file MSInstantInductLoop.cpp.
| void MSInstantInductLoop::writeXMLOutput | ( | OutputDevice & | dev, |
| SUMOTime | startTime, | ||
| SUMOTime | stopTime | ||
| ) | throw (IOError) [inline, virtual] |
Write the generated output to the given device.
This method is not used - output is written as soon as a vehicle visits the detector.
| [in] | dev | The output device to write the data into |
| [in] | startTime | First time step the data were gathered |
| [in] | stopTime | Last time step the data were gathered |
| IOError | If an error on writing occurs |
Implements MSDetectorFileOutput.
Definition at line 144 of file MSInstantInductLoop.h.
std::map<SUMOVehicle*, SUMOReal> MSInstantInductLoop::myEntryTimes [protected] |
The last exit time.
Definition at line 182 of file MSInstantInductLoop.h.
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().
SUMOReal MSInstantInductLoop::myLastExitTime [protected] |
The last exit time.
Definition at line 179 of file MSInstantInductLoop.h.
OutputDevice& MSInstantInductLoop::myOutputDevice [protected] |
The output device to use.
Definition at line 173 of file MSInstantInductLoop.h.
Referenced by write().
const SUMOReal MSInstantInductLoop::myPosition [protected] |
Detector's position on lane [m].
Definition at line 176 of file MSInstantInductLoop.h.
Referenced by GUIInstantInductLoop::buildDetectorGUIRepresentation(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), and notifyEnter().