SUMO - Simulation of Urban MObility
|
The gui-version of the MSInstantInductLoop. More...
#include <GUIInstantInductLoop.h>
Data Structures | |
class | MyWrapper |
A MSInductLoop-visualiser. More... |
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 | |
virtual GUIDetectorWrapper * | buildDetectorGUIRepresentation () |
Returns this detector's visualisation-wrapper. | |
const std::string & | getID () const |
Returns the id. | |
const MSLane * | getLane () const |
Returns the lane the reminder works on. | |
GUIInstantInductLoop (const std::string &id, OutputDevice &od, MSLane *const lane, SUMOReal positionInMeters) | |
Constructor. | |
virtual void | notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed) |
Internal notification about the vehicle moves. | |
void | setID (const std::string &newID) |
resets the id | |
void | writeXMLDetectorProlog (OutputDevice &dev) const |
Open the XML-output. | |
void | writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) |
Write the generated output to the given device. | |
~GUIInstantInductLoop () | |
Destructor. | |
Methods inherited from MSMoveReminder | |
bool | notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) |
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder. | |
bool | notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason) |
Dismisses the vehicle if it is on the detector due to a lane change. | |
bool | notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason) |
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 () |
Resets collected values. | |
virtual void | detectorUpdate (const SUMOTime step) |
Updates the detector (computes values) |
Data Fields | |
MFXMutex | myLock |
Mutex preventing parallel read/write access to internal MSInductLoop state. |
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]. |
The gui-version of the MSInstantInductLoop.
Definition at line 52 of file GUIInstantInductLoop.h.
|
inherited |
Definition of a vehicle state.
Definition at line 93 of file MSMoveReminder.h.
GUIInstantInductLoop::GUIInstantInductLoop | ( | const std::string & | id, |
OutputDevice & | od, | ||
MSLane *const | lane, | ||
SUMOReal | positionInMeters | ||
) |
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 61 of file GUIInstantInductLoop.cpp.
GUIInstantInductLoop::~GUIInstantInductLoop | ( | ) |
Destructor.
Definition at line 66 of file GUIInstantInductLoop.cpp.
|
virtual |
Returns this detector's visualisation-wrapper.
Reimplemented from MSDetectorFileOutput.
Definition at line 70 of file GUIInstantInductLoop.cpp.
References MSMoveReminder::getLane(), and MSInstantInductLoop::myPosition.
|
inlinevirtualinherited |
Updates the detector (computes values)
[in] | step | The current time step |
Reimplemented in MSMeanData, MSE3Collector, MSMeanData_Harmonoise, and MSE2Collector.
Definition at line 113 of file MSDetectorFileOutput.h.
References UNUSED_PARAMETER.
|
inlineinherited |
Returns the 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_Lane::processGet(), TraCIServerAPI_TLS::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().
|
inlineinherited |
Returns the lane the reminder works on.
Definition at line 87 of file MSMoveReminder.h.
References MSMoveReminder::myLane.
Referenced by buildDetectorGUIRepresentation(), GUIInductLoop::buildDetectorGUIRepresentation(), MSE2Collector::detectorUpdate(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), TraCIServerAPI_InductionLoop::processGet(), and MSMeanData::writeEdge().
|
virtualinherited |
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 138 of file MSInstantInductLoop.cpp.
References MSVehicleType::getLength(), SUMOVehicle::getPositionOnLane(), SUMOVehicle::getVehicleType(), and MSInstantInductLoop::myPosition.
|
virtualinherited |
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 124 of file MSInstantInductLoop.cpp.
References MSNet::getInstance(), SUMOVehicle::getSpeed(), MSInstantInductLoop::myEntryTimes, MSMoveReminder::NOTIFICATION_JUNCTION, STEPS2TIME, and MSInstantInductLoop::write().
|
virtualinherited |
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 68 of file MSInstantInductLoop.cpp.
References MSNet::getInstance(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), MSInstantInductLoop::myEntryTimes, MSInstantInductLoop::myLastExitTime, MSInstantInductLoop::myPosition, STEPS2TIME, SUMOReal, and MSInstantInductLoop::write().
|
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.
[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_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_HBEFA::MSLaneMeanDataValues.
Definition at line 200 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
|
inlinevirtualinherited |
Resets collected values.
Please note that this is only a "hack" for coupled-tls-outputs.
Reimplemented in MSE2Collector, MSE3Collector, MSInductLoop, and GUIInductLoop.
Definition at line 106 of file MSDetectorFileOutput.h.
Referenced by Command_SaveTLCoupledLaneDet::execute().
|
inlineinherited |
resets the id
Definition at line 67 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
protectedinherited |
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 110 of file MSInstantInductLoop.cpp.
References OutputDevice::closeTag(), Named::getID(), SUMOVehicle::getID(), MSVehicleType::getID(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), MSInstantInductLoop::myOutputDevice, OutputDevice::openTag(), toString(), and OutputDevice::writeAttr().
Referenced by MSInstantInductLoop::notifyLeave(), and MSInstantInductLoop::notifyMove().
|
virtualinherited |
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 149 of file MSInstantInductLoop.cpp.
References OutputDevice::writeXMLHeader().
Referenced by MSInstantInductLoop::MSInstantInductLoop().
|
inlinevirtualinherited |
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 145 of file MSInstantInductLoop.h.
References UNUSED_PARAMETER.
|
protectedinherited |
The last exit time.
Definition at line 187 of file MSInstantInductLoop.h.
Referenced by MSInstantInductLoop::notifyLeave(), and MSInstantInductLoop::notifyMove().
|
protectedinherited |
The name of the object.
Definition at line 83 of file Named.h.
Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), RORouteDef_OrigDest::preComputeCurrentRoute(), RORouteDef_Alternatives::preComputeCurrentRoute(), RORouteDef_Complete::preComputeCurrentRoute(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSE3Collector::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
protectedinherited |
Lane on which the reminder works.
Definition at line 215 of file MSMoveReminder.h.
Referenced by MSE2Collector::detectorUpdate(), MSMoveReminder::getLane(), MSE2Collector::MSE2Collector(), and MSMoveReminder::MSMoveReminder().
|
protectedinherited |
The last exit time.
Definition at line 184 of file MSInstantInductLoop.h.
Referenced by MSInstantInductLoop::notifyMove().
|
mutable |
Mutex preventing parallel read/write access to internal MSInductLoop state.
Definition at line 153 of file GUIInstantInductLoop.h.
|
protectedinherited |
The output device to use.
Definition at line 178 of file MSInstantInductLoop.h.
Referenced by MSInstantInductLoop::write().
|
protectedinherited |
Detector's position on lane [m].
Definition at line 181 of file MSInstantInductLoop.h.
Referenced by buildDetectorGUIRepresentation(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), MSInstantInductLoop::MSInstantInductLoop(), MSInstantInductLoop::notifyEnter(), and MSInstantInductLoop::notifyMove().