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

The gui-version of the MSInductLoop. More...

#include <GUIInductLoop.h>

Inheritance diagram for GUIInductLoop:
MSInductLoop MSMoveReminder MSDetectorFileOutput Named

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

void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
virtual GUIDetectorWrapperbuildDetectorGUIRepresentation ()
 Returns this detector's visualisation-wrapper. More...
 
std::vector< VehicleDatacollectVehiclesOnDet (SUMOTime t) const
 Returns vehicle data for vehicles that have been on the detector starting at the given time. More...
 
const std::string & getDescription () const
 
const std::string & getID () const
 Returns the id. More...
 
const MSLanegetLane () const
 Returns the lane the reminder works on. More...
 
SUMOReal getPosition () const
 Returns the position of the detector on the lane. More...
 
 GUIInductLoop (const std::string &id, MSLane *const lane, SUMOReal position, bool splitByType)
 Constructor. More...
 
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves. More...
 
void reset ()
 Resets all generated values to allow computation of next interval. More...
 
void setID (const std::string &newID)
 resets the id More...
 
 ~GUIInductLoop ()
 Destructor. More...
 
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. More...
 
bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
 Dismisses the vehicle if it is on the detector due to a lane change. More...
 
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Returns whether the detector may has to be concerned during the vehicle's further movement. More...
 
Methods returning current values
SUMOReal getCurrentSpeed () const
 Returns the speed of the vehicle on the detector. More...
 
SUMOReal getCurrentLength () const
 Returns the length of the vehicle on the detector. More...
 
SUMOReal getCurrentOccupancy () const
 Returns the current occupancy. More...
 
unsigned int getCurrentPassedNumber () const
 Returns the number of vehicles that have passed the detector. More...
 
std::vector< std::string > getCurrentVehicleIDs () const
 Returns the ids of vehicles that have passed the detector. More...
 
SUMOReal getTimestepsSinceLastDetection () const
 Returns the time since the last vehicle left the detector. More...
 
Methods inherited from MSDetectorFileOutput.
void writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
 Writes collected values into the given stream. More...
 
void writeXMLDetectorProlog (OutputDevice &dev) const
 Opens the XML-output using "detector" as root element. More...
 
Virtual methods to implement by derived classes
virtual void detectorUpdate (const SUMOTime step)
 Updates the detector (computes values) More...
 

Data Fields

MFXMutex myLock
 Mutex preventing parallel read/write access to internal MSInductLoop state. More...
 

Protected Types

typedef std::deque< VehicleDataVehicleDataCont
 Type of myVehicleDataCont. More...
 
typedef std::map< SUMOVehicle
*, SUMOReal
VehicleMap
 Type of myVehiclesOnDet. More...
 

Protected Member Functions

void writeTypedXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime, const std::string &type, const VehicleDataCont &vdc, const VehicleMap &vm)
 
Methods that add and remove vehicles from internal container
void enterDetectorByMove (SUMOVehicle &veh, SUMOReal entryTimestep)
 Introduces a vehicle to the detector's map myVehiclesOnDet. More...
 
void leaveDetectorByMove (SUMOVehicle &veh, SUMOReal leaveTimestep)
 Processes a vehicle that leaves the detector. More...
 
void leaveDetectorByLaneChange (SUMOVehicle &veh)
 Removes a vehicle from the detector's map myVehiclesOnDet. More...
 

Static Protected Member Functions

Function for summing up values
static SUMOReal speedSum (SUMOReal sumSoFar, const MSInductLoop::VehicleData &data)
 Adds up VehicleData::speedM. More...
 
static SUMOReal lengthSum (SUMOReal sumSoFar, const MSInductLoop::VehicleData &data)
 Adds up VehicleData::lengthM. More...
 

Protected Attributes

const std::string myDescription
 a description of this moveReminder More...
 
unsigned myDismissedVehicleNumber
 The number of dismissed vehicles. More...
 
std::string myID
 The name of the object. More...
 
MSLane *const myLane
 Lane on which the reminder works. More...
 
SUMOReal myLastLeaveTime
 Leave-time of the last vehicle detected [s]. More...
 
SUMOReal myLastOccupancy
 Occupancy by the last vehicle detected. More...
 
VehicleDataCont myLastVehicleDataCont
 Data of vehicles that have completely passed the detector in the last time interval. More...
 
const SUMOReal myPosition
 Detector's position on lane [m]. More...
 
bool mySplitByType
 Whether additional information split by vehicle classes shall be generated. More...
 
VehicleDataCont myVehicleDataCont
 Data of vehicles that have completely passed the detector. More...
 
VehicleMap myVehiclesOnDet
 Data for vehicles that have entered the detector (vehicle -> enter time) More...
 

Detailed Description

The gui-version of the MSInductLoop.

Allows the building of a wrapper (also declared herein) which draws the detector on the gl-canvas. Uses a mutex to avoid parallel read/write operations. The mutex is only set within methods that change MSInductLoop-internal state and within "collectVehiclesOnDet". All other reading operations should be performed via the simulation loop only.

Definition at line 55 of file GUIInductLoop.h.

Member Typedef Documentation

typedef std::deque< VehicleData > MSInductLoop::VehicleDataCont
protectedinherited

Type of myVehicleDataCont.

Definition at line 356 of file MSInductLoop.h.

typedef std::map< SUMOVehicle*, SUMOReal > MSInductLoop::VehicleMap
protectedinherited

Type of myVehiclesOnDet.

Definition at line 366 of file MSInductLoop.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 94 of file MSMoveReminder.h.

Constructor & Destructor Documentation

GUIInductLoop::GUIInductLoop ( const std::string &  id,
MSLane *const  lane,
SUMOReal  position,
bool  splitByType 
)

Constructor.

Parameters
[in]idUnique id
[in]laneLane where detector woks on
[in]positionPosition of the detector within the lane
[in]splitByTypeWhether additional information split by vehicle classes shall be generated

Definition at line 57 of file GUIInductLoop.cpp.

GUIInductLoop::~GUIInductLoop ( )

Destructor.

Definition at line 62 of file GUIInductLoop.cpp.

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().

GUIDetectorWrapper * GUIInductLoop::buildDetectorGUIRepresentation ( )
virtual

Returns this detector's visualisation-wrapper.

Returns
The wrapper representing the detector

Reimplemented from MSDetectorFileOutput.

Definition at line 66 of file GUIInductLoop.cpp.

References MSInductLoop::myPosition.

std::vector< MSInductLoop::VehicleData > GUIInductLoop::collectVehiclesOnDet ( SUMOTime  t) const
virtual

Returns vehicle data for vehicles that have been on the detector starting at the given time.

This method uses a mutex to prevent parallel read/write access to the vehicle buffer

Parameters
[in]tThe time from which vehicles shall be counted
Returns
The list of vehicles
See Also
MSInductLoop::collectVehiclesOnDet()

Reimplemented from MSInductLoop.

Definition at line 98 of file GUIInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), and myLock.

virtual void MSDetectorFileOutput::detectorUpdate ( const SUMOTime  step)
inlinevirtualinherited

Updates the detector (computes values)

Parameters
[in]stepThe current time step

Reimplemented in MSMeanData, MSE3Collector, MSMeanData_Harmonoise, and MSE2Collector.

Definition at line 113 of file MSDetectorFileOutput.h.

References UNUSED_PARAMETER.

void GUIInductLoop::enterDetectorByMove ( SUMOVehicle veh,
SUMOReal  entryTimestep 
)
protectedvirtual

Introduces a vehicle to the detector's map myVehiclesOnDet.

Locks the internal mutex before calling MSInductLoop::enterDetectorByMove()

See Also
MSInductLoop::enterDetectorByMove()
Parameters
vehThe entering vehicle.
entryTimestepTimestep (not necessary integer) of entrance.
See Also
MSInductLoop::enterDetectorByMove()

Reimplemented from MSInductLoop.

Definition at line 79 of file GUIInductLoop.cpp.

References MSInductLoop::enterDetectorByMove(), and myLock.

SUMOReal MSInductLoop::getCurrentLength ( ) const
inherited

Returns the length of the vehicle on the detector.

If no vehicle is on the detector, -1 is returned, otherwise this vehicle's length.

Returns
The length [m] of the vehicle if one is on the detector, -1 otherwise

Definition at line 140 of file MSInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), DELTA_T, MSNet::getInstance(), MSInductLoop::lengthSum(), and SUMOReal.

Referenced by GUIInductLoop::MyWrapper::getParameterWindow(), and TraCIServerAPI_InductionLoop::processGet().

SUMOReal MSInductLoop::getCurrentOccupancy ( ) const
inherited

Returns the current occupancy.

If a vehicle is on the detector, 1 is returned. If a vehicle has passed the detector in this timestep, its occupancy value is returned. If no vehicle has passed, 0 is returned.

Returns
This detector's current occupancy
Todo:
recheck (especially if more than one vehicle has passed)

Definition at line 149 of file MSInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), DELTA_T, MSNet::getCurrentTimeStep(), MSNet::getInstance(), MAX2(), MIN2(), STEPS2TIME, SUMOReal, and TS.

Referenced by GUIInductLoop::MyWrapper::getParameterWindow(), and TraCIServerAPI_InductionLoop::processGet().

unsigned int MSInductLoop::getCurrentPassedNumber ( ) const
inherited

Returns the number of vehicles that have passed the detector.

If a vehicle is on the detector, 1 is returned. If a vehicle has passed the detector in this timestep, 1 is returned. If no vehicle has passed, 0 is returned.

Returns
The number of vehicles that have passed the detector
Todo:
recheck (especially if more than one vehicle has passed)

Definition at line 166 of file MSInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), DELTA_T, and MSNet::getInstance().

Referenced by GUIInductLoop::MyWrapper::getParameterWindow(), and TraCIServerAPI_InductionLoop::processGet().

SUMOReal MSInductLoop::getCurrentSpeed ( ) const
inherited

Returns the speed of the vehicle on the detector.

If no vehicle is on the detector, -1 is returned, otherwise this vehicle's current speed.

Returns
The speed [m/s] of the vehicle if one is on the detector, -1 otherwise

Definition at line 131 of file MSInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), DELTA_T, MSNet::getInstance(), MSInductLoop::speedSum(), and SUMOReal.

Referenced by GUIInductLoop::MyWrapper::getParameterWindow(), and TraCIServerAPI_InductionLoop::processGet().

std::vector< std::string > MSInductLoop::getCurrentVehicleIDs ( ) const
inherited

Returns the ids of vehicles that have passed the detector.

Returns
The ids of vehicles that have passed the detector
Todo:
recheck (especially if more than one vehicle has passed)

Definition at line 173 of file MSInductLoop.cpp.

References MSInductLoop::collectVehiclesOnDet(), DELTA_T, and MSNet::getInstance().

Referenced by TraCIServerAPI_InductionLoop::processGet().

const std::string& MSMoveReminder::getDescription ( ) const
inlineinherited

Definition at line 210 of file MSMoveReminder.h.

References MSMoveReminder::myDescription.

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), GUITrafficLightLogicWrapper::begin2TrackPhases(), 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(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), 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(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NBEdge::connections_sorter(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), GUINet::createTLWrapper(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), RODFNet::getDetectorEdge(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), RODFDetectorCon::guessEmptyFlows(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), 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(), MSDevice_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Person::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Example::notifyMove(), GUIViewTraffic::onGamingClick(), 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_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::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(), RODFNet::revalidateFlows(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), GUITrafficLightLogicWrapper::switchTLSLogic(), 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(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_SUMO::writeRoundabout(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_DlrNavteq::writeTrafficSignals(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

SUMOReal MSInductLoop::getPosition ( ) const
inlineinherited

Returns the position of the detector on the lane.

Returns
The detector's position in meters

Definition at line 99 of file MSInductLoop.h.

References MSInductLoop::myPosition.

Referenced by TraCIServerAPI_InductionLoop::getPosition(), TraCIServerAPI_InductionLoop::getTree(), and TraCIServerAPI_InductionLoop::processGet().

SUMOReal MSInductLoop::getTimestepsSinceLastDetection ( ) const
inherited

Returns the time since the last vehicle left the detector.

Returns
Timesteps from last leaving (detection) of the detector

Definition at line 184 of file MSInductLoop.cpp.

References MSNet::getInstance(), MSInductLoop::myLastLeaveTime, MSInductLoop::myVehiclesOnDet, and STEPS2TIME.

Referenced by GUIInductLoop::MyWrapper::getParameterWindow(), and TraCIServerAPI_InductionLoop::processGet().

void GUIInductLoop::leaveDetectorByLaneChange ( SUMOVehicle veh)
protectedvirtual

Removes a vehicle from the detector's map myVehiclesOnDet.

Locks the internal mutex before calling MSInductLoop::leaveDetectorByLaneChange()

See Also
MSInductLoop::leaveDetectorByLaneChange()
Parameters
vehThe leaving vehicle.

Reimplemented from MSInductLoop.

Definition at line 91 of file GUIInductLoop.cpp.

References MSInductLoop::leaveDetectorByLaneChange(), and myLock.

void GUIInductLoop::leaveDetectorByMove ( SUMOVehicle veh,
SUMOReal  leaveTimestep 
)
protectedvirtual

Processes a vehicle that leaves the detector.

Locks the internal mutex before calling MSInductLoop::leaveDetectorByMove()

See Also
MSInductLoop::leaveDetectorByMove()
Parameters
vehThe leaving vehicle.
leaveTimestepTimestep (not necessary integer) of leaving.
See Also
MSInductLoop::leaveDetectorByMove()

Reimplemented from MSInductLoop.

Definition at line 85 of file GUIInductLoop.cpp.

References MSInductLoop::leaveDetectorByMove(), and myLock.

static SUMOReal MSInductLoop::lengthSum ( SUMOReal  sumSoFar,
const MSInductLoop::VehicleData data 
)
inlinestaticprotectedinherited
bool MSInductLoop::notifyEnter ( SUMOVehicle veh,
MSMoveReminder::Notification  reason 
)
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.

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
True if vehicle is on or in front of the detector.
See Also
MSMoveReminder
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented from MSMoveReminder.

Definition at line 125 of file MSInductLoop.cpp.

bool MSInductLoop::notifyLeave ( SUMOVehicle veh,
SUMOReal  lastPos,
MSMoveReminder::Notification  reason 
)
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.

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
See Also
leaveDetectorByLaneChange
MSMoveReminder
MSMoveReminder::notifyLeave

Reimplemented from MSMoveReminder.

Definition at line 114 of file MSInductLoop.cpp.

References MSInductLoop::leaveDetectorByLaneChange(), and MSMoveReminder::NOTIFICATION_JUNCTION.

bool MSInductLoop::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
)
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.

Parameters
[in]vehVehicle that asks this remider.
[in]oldPosPosition before move.
[in]newPosPosition after move with newSpeed.
[in]newSpeedMoving speed.
Returns
True if vehicle hasn't passed the detector completely.
See Also
MSMoveReminder
MSMoveReminder::notifyMove
enterDetectorByMove
leaveDetectorByMove

Reimplemented from MSMoveReminder.

Definition at line 85 of file MSInductLoop.cpp.

References MSInductLoop::enterDetectorByMove(), MSNet::getInstance(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), MSInductLoop::leaveDetectorByMove(), MSInductLoop::myPosition, STEPS2TIME, and SUMOReal.

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 201 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

void GUIInductLoop::reset ( )
virtual

Resets all generated values to allow computation of next interval.

Locks the internal mutex before calling MSInductLoop::reset()

See Also
MSInductLoop::reset()

Reimplemented from MSInductLoop.

Definition at line 72 of file GUIInductLoop.cpp.

References myLock, and MSInductLoop::reset().

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().

static SUMOReal MSInductLoop::speedSum ( SUMOReal  sumSoFar,
const MSInductLoop::VehicleData data 
)
inlinestaticprotectedinherited
void MSInductLoop::writeTypedXMLOutput ( OutputDevice dev,
SUMOTime  startTime,
SUMOTime  stopTime,
const std::string &  type,
const VehicleDataCont vdc,
const VehicleMap vm 
)
protectedinherited
void MSInductLoop::writeXMLDetectorProlog ( OutputDevice dev) const
virtualinherited

Opens the XML-output using "detector" as root element.

Parameters
[in]devThe output device to write the root into
See Also
MSDetectorFileOutput::writeXMLDetectorProlog
Exceptions
IOErrorIf an error on writing occurs (!!! not yet implemented)

Implements MSDetectorFileOutput.

Definition at line 194 of file MSInductLoop.cpp.

References OutputDevice::writeXMLHeader().

void MSInductLoop::writeXMLOutput ( OutputDevice dev,
SUMOTime  startTime,
SUMOTime  stopTime 
)
virtualinherited

Writes collected values into the given stream.

Parameters
[in]devThe output device to write the data into
[in]startTimeFirst time step the data were gathered
[in]stopTimeLast time step the data were gathered
See Also
MSDetectorFileOutput::writeXMLOutput
Exceptions
IOErrorIf an error on writing occurs (!!! not yet implemented)

Implements MSDetectorFileOutput.

Definition at line 200 of file MSInductLoop.cpp.

References MSInductLoop::mySplitByType, MSInductLoop::myVehicleDataCont, MSInductLoop::myVehiclesOnDet, MSInductLoop::reset(), and MSInductLoop::writeTypedXMLOutput().

Field Documentation

const std::string MSMoveReminder::myDescription
protectedinherited

a description of this moveReminder

Definition at line 219 of file MSMoveReminder.h.

Referenced by MSMoveReminder::getDescription().

unsigned MSInductLoop::myDismissedVehicleNumber
protectedinherited

The number of dismissed vehicles.

Definition at line 352 of file MSInductLoop.h.

Referenced by MSInductLoop::leaveDetectorByLaneChange(), MSInductLoop::reset(), and MSInductLoop::writeTypedXMLOutput().

MSLane* const MSMoveReminder::myLane
protectedinherited
SUMOReal MSInductLoop::myLastLeaveTime
protectedinherited

Leave-time of the last vehicle detected [s].

Definition at line 346 of file MSInductLoop.h.

Referenced by MSInductLoop::getTimestepsSinceLastDetection(), and MSInductLoop::leaveDetectorByMove().

SUMOReal MSInductLoop::myLastOccupancy
protectedinherited

Occupancy by the last vehicle detected.

Definition at line 349 of file MSInductLoop.h.

Referenced by MSInductLoop::leaveDetectorByMove().

VehicleDataCont MSInductLoop::myLastVehicleDataCont
protectedinherited

Data of vehicles that have completely passed the detector in the last time interval.

Definition at line 362 of file MSInductLoop.h.

Referenced by MSInductLoop::collectVehiclesOnDet(), and MSInductLoop::reset().

MFXMutex GUIInductLoop::myLock
mutable

Mutex preventing parallel read/write access to internal MSInductLoop state.

Definition at line 209 of file GUIInductLoop.h.

Referenced by collectVehiclesOnDet(), enterDetectorByMove(), leaveDetectorByLaneChange(), leaveDetectorByMove(), and reset().

const SUMOReal MSInductLoop::myPosition
protectedinherited
bool MSInductLoop::mySplitByType
protectedinherited

Whether additional information split by vehicle classes shall be generated.

Definition at line 343 of file MSInductLoop.h.

Referenced by MSInductLoop::writeXMLOutput().

VehicleDataCont MSInductLoop::myVehicleDataCont
protectedinherited

Data of vehicles that have completely passed the detector.

Definition at line 359 of file MSInductLoop.h.

Referenced by MSInductLoop::collectVehiclesOnDet(), MSInductLoop::leaveDetectorByMove(), MSInductLoop::reset(), and MSInductLoop::writeXMLOutput().

VehicleMap MSInductLoop::myVehiclesOnDet
protectedinherited

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