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

An areal (along a single lane) detector. More...

#include <MSE2Collector.h>

Inheritance diagram for MSE2Collector:
MSMoveReminder MSDetectorFileOutput Named GUI_E2_ZS_Collector

Data Structures

class  by_vehicle_position_sorter
 A class used to sort known vehicles by their position. More...
struct  JamInfo
 Internal representation of a jam. 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.
void detectorUpdate (const SUMOTime step)
 Computes the detector values in each time step.
SUMOReal getEndPos () const
 Returns the end position of the detector.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane the reminder works on.
SUMOReal getStartPos () const
 Returns the begin position of the detector.
virtual DetectorUsage getUsageType () const
 Returns the detector's usage type.
 MSE2Collector (const std::string &id, DetectorUsage usage, MSLane *const lane, SUMOReal startPos, SUMOReal detLength, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Constructor.
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves.
void reset ()
 Resets all values.
void setID (const std::string &newID)
 resets the id
virtual ~MSE2Collector ()
 Destructor.
Methods inherited from MSMoveReminder
bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Adds/removes vehicles from the list of vehicles to regard.
bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
 Removes a known vehicle due to its lane-change.
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Adds the vehicle to known vehicles if not beyond the dector.
Methods inherited from MSDetectorFileOutput.
void writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
 Writes collected values into the given stream.
void writeXMLDetectorProlog (OutputDevice &dev) const
 Opens the XML-output using "detector" as root element.
Methods returning current values
unsigned getCurrentVehicleNumber () const
 Returns the number of vehicles currently on the detector.
SUMOReal getCurrentOccupancy () const
 Returns the curent detector occupancy.
SUMOReal getCurrentMeanSpeed () const
 Returns the mean vehicle speed of vehicles currently on the detector.
SUMOReal getCurrentMeanLength () const
 Returns the mean vehicle length of vehicles currently on the detector.
unsigned getCurrentJamNumber () const
 Returns the current number of jams.
unsigned getCurrentMaxJamLengthInVehicles () const
 Returns the length in vehicles of the currently largest jam.
SUMOReal getCurrentMaxJamLengthInMeters () const
 Returns the length in meters of the currently largest jam.
unsigned getCurrentJamLengthInVehicles () const
 Returns the length of all jams in vehicles.
SUMOReal getCurrentJamLengthInMeters () const
 Returns the length of all jams in meters.
unsigned getCurrentStartedHalts () const
 Returns the length of all jams in meters.
Virtual methods to implement by derived classes
virtual GUIDetectorWrapperbuildDetectorGUIRepresentation ()
 Builds the graphical representation.

Protected Attributes

std::string myID
 The name of the object.
MSLane *const myLane
 Lane on which the reminder works.

Private Member Functions

 MSE2Collector (const MSE2Collector &)
 Invalidated copy constructor.
MSE2Collectoroperator= (const MSE2Collector &)
 Invalidated assignment operator.

Private Attributes

std::map< SUMOVehicle *, SUMOTimemyHaltingVehicleDurations
 Storage for halting durations of known vehicles (for halting vehicles)
std::map< SUMOVehicle *, SUMOTimemyIntervalHaltingVehicleDurations
 Storage for halting durations of known vehicles (current interval)
std::list< SUMOVehicle * > myKnownVehicles
 List of known vehicles.
std::vector< SUMOTimemyPastIntervalStandingDurations
 Halting durations of ended halts for the current interval [s].
std::vector< SUMOTimemyPastStandingDurations
 Halting durations of ended halts [s].
DetectorUsage myUsage
 Information about how this detector is used.
Detector parameter
SUMOReal myJamHaltingSpeedThreshold
 A vehicle must driver slower than this to be counted as a part of a jam.
SUMOTime myJamHaltingTimeThreshold
 A vehicle must be that long beyond myJamHaltingSpeedThreshold to be counted as a part of a jam.
SUMOReal myJamDistanceThreshold
 Two standing vehicles must be closer than this to be counted into the same jam.
SUMOReal myStartPos
 The position the detector starts at.
SUMOReal myEndPos
 The position the detector ends at.
Values generated for aggregated file output
SUMOReal mySpeedSum
 The sum of collected vehicle speeds [m/s].
SUMOReal myStartedHalts
 The number of started halts [#].
SUMOReal myJamLengthInMetersSum
 The sum of jam lengths [m].
unsigned myJamLengthInVehiclesSum
 The sum of jam lengths [#veh].
unsigned myVehicleSamples
 The number of collected samples [#].
unsigned myTimeSamples
 The current aggregation duration [#steps].
SUMOReal myOccupancySum
 The sum of occupancies [%].
SUMOReal myMaxOccupancy
 The maximum occupancy [%].
unsigned myMeanMaxJamInVehicles
 The mean jam length [#veh].
SUMOReal myMeanMaxJamInMeters
 The mean jam length [m].
unsigned myMaxJamInVehicles
 The max jam length [#veh].
SUMOReal myMaxJamInMeters
 The max jam length [m].
unsigned myMeanVehicleNumber
 The mean number of vehicles [#veh].
unsigned myMaxVehicleNumber
 The max number of vehicles [#veh].
Values generated describing the current state
SUMOReal myCurrentOccupancy
 The current occupancy.
SUMOReal myCurrentMeanSpeed
 The current mean speed.
SUMOReal myCurrentMeanLength
 The current mean length.
unsigned myCurrentJamNo
 The current jam number.
SUMOReal myCurrentMaxJamLengthInMeters
 the current maximum jam length in meters
unsigned myCurrentMaxJamLengthInVehicles
 The current maximum jam length in vehicles.
SUMOReal myCurrentJamLengthInMeters
 The overall jam length in meters.
unsigned myCurrentJamLengthInVehicles
 The overall jam length in vehicles.
unsigned myCurrentStartedHalts
 The number of started halts in the last step.

Detailed Description

An areal (along a single lane) detector.

This detector traces vehicles which are at a part of a single lane. A vehicle that enters the detector is stored and the stored vehicles' speeds are used within each timestep to compute the detector values. As soon as the vehicle leaves the detector, it is no longer tracked.

Determining entering and leaving vehicles is done via the MSMoveReminder interface. The values are computed by an event-callback (at the end of a time step).

Jams are determined as following: A vehicle must at least drive haltingTimeThreshold at a speed lesser than haltingSpeedThreshold to be a "halting" vehicle. Two or more vehicles are "in jam" if they are halting and their distance is lesser than jamDistThreshold.

See Also
Named
MSMoveReminder
MSDetectorFileOutput
Command

Definition at line 77 of file MSE2Collector.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

MSE2Collector::MSE2Collector ( const std::string &  id,
DetectorUsage  usage,
MSLane *const  lane,
SUMOReal  startPos,
SUMOReal  detLength,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)

Constructor.

Parameters
[in]idThe detector's unique id.
[in]usageInformation how the detector is used
[in]laneThe lane to place the detector at
[in]startPosBegin position of the detector
[in]detLengthLength of the detector
[in]haltingTimeThresholdThe time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed
[in]haltingSpeedThresholdThe speed a vehicle's speed must be below to be assigned as jammed
[in]jamDistThresholdThe distance between two vehicles in order to not count them to one jam
Todo:
The lane should not be given as a pointer

Definition at line 50 of file MSE2Collector.cpp.

References myEndPos, MSMoveReminder::myLane, myStartPos, and reset().

MSE2Collector::~MSE2Collector ( )
virtual

Destructor.

Definition at line 73 of file MSE2Collector.cpp.

References myKnownVehicles.

MSE2Collector::MSE2Collector ( const MSE2Collector )
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().

virtual GUIDetectorWrapper* MSDetectorFileOutput::buildDetectorGUIRepresentation ( )
inlinevirtualinherited

Builds the graphical representation.

Meant to be overridden by graphical versions of the detectors

Returns
A wrapper for the detector which performs the user I/O within the GUI

Reimplemented in GUI_E2_ZS_Collector, GUIInductLoop, GUIE3Collector, GUI_E2_ZS_CollectorOverLanes, and GUIInstantInductLoop.

Definition at line 123 of file MSDetectorFileOutput.h.

void MSE2Collector::detectorUpdate ( const SUMOTime  step)
virtual

Computes the detector values in each time step.

This method should be called at the end of a simulation step, when all vehicles have moved. The current values are computed and summed up with the previous.

Parameters
[in]currentTimeThe current simulation time

Reimplemented from MSDetectorFileOutput.

Definition at line 156 of file MSE2Collector.cpp.

References DELTA_T, MSE2Collector::JamInfo::firstStandingVehicle, MSMoveReminder::getLane(), MSVehicle::getLane(), MSVehicleType::getLength(), MSVehicleType::getLengthWithGap(), MSLane::getPartialOccupator(), MSLane::getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSE2Collector::JamInfo::lastStandingVehicle, MAX2(), myCurrentJamLengthInMeters, myCurrentJamLengthInVehicles, myCurrentJamNo, myCurrentMaxJamLengthInMeters, myCurrentMaxJamLengthInVehicles, myCurrentMeanLength, myCurrentMeanSpeed, myCurrentOccupancy, myCurrentStartedHalts, myEndPos, myHaltingVehicleDurations, myIntervalHaltingVehicleDurations, myJamDistanceThreshold, myJamHaltingSpeedThreshold, myJamHaltingTimeThreshold, myJamLengthInMetersSum, myJamLengthInVehiclesSum, myKnownVehicles, MSMoveReminder::myLane, myMaxJamInMeters, myMaxJamInVehicles, myMaxOccupancy, myMaxVehicleNumber, myMeanMaxJamInMeters, myMeanMaxJamInVehicles, myMeanVehicleNumber, myOccupancySum, myPastIntervalStandingDurations, myPastStandingDurations, mySpeedSum, myStartedHalts, myStartPos, myTimeSamples, myVehicleSamples, and SUMOReal.

SUMOReal MSE2Collector::getCurrentJamLengthInMeters ( ) const

Returns the length of all jams in meters.

Definition at line 445 of file MSE2Collector.cpp.

References myCurrentJamLengthInMeters.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

unsigned MSE2Collector::getCurrentJamLengthInVehicles ( ) const

Returns the length of all jams in vehicles.

Definition at line 439 of file MSE2Collector.cpp.

References myCurrentJamLengthInVehicles.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

unsigned MSE2Collector::getCurrentJamNumber ( ) const

Returns the current number of jams.

Definition at line 421 of file MSE2Collector.cpp.

References myCurrentJamNo.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

SUMOReal MSE2Collector::getCurrentMaxJamLengthInMeters ( ) const

Returns the length in meters of the currently largest jam.

Definition at line 433 of file MSE2Collector.cpp.

References myCurrentMaxJamLengthInMeters.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

unsigned MSE2Collector::getCurrentMaxJamLengthInVehicles ( ) const

Returns the length in vehicles of the currently largest jam.

Definition at line 427 of file MSE2Collector.cpp.

References myCurrentMaxJamLengthInVehicles.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

SUMOReal MSE2Collector::getCurrentMeanLength ( ) const

Returns the mean vehicle length of vehicles currently on the detector.

Definition at line 415 of file MSE2Collector.cpp.

References myCurrentMeanLength.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

SUMOReal MSE2Collector::getCurrentMeanSpeed ( ) const

Returns the mean vehicle speed of vehicles currently on the detector.

Definition at line 409 of file MSE2Collector.cpp.

References myCurrentMeanSpeed.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

SUMOReal MSE2Collector::getCurrentOccupancy ( ) const

Returns the curent detector occupancy.

Definition at line 403 of file MSE2Collector.cpp.

References myCurrentOccupancy, and SUMOReal.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

unsigned MSE2Collector::getCurrentStartedHalts ( ) const

Returns the length of all jams in meters.

Definition at line 451 of file MSE2Collector.cpp.

References myCurrentStartedHalts.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

unsigned MSE2Collector::getCurrentVehicleNumber ( ) const

Returns the number of vehicles currently on the detector.

Definition at line 397 of file MSE2Collector.cpp.

References myKnownVehicles.

Referenced by GUI_E2_ZS_Collector::MyWrapper::getParameterWindow().

SUMOReal MSE2Collector::getEndPos ( ) const
inline

Returns the end position of the detector.

Returns
The detector's end position

Definition at line 214 of file MSE2Collector.h.

References myEndPos.

Referenced by GUI_E2_ZS_Collector::MyWrapper::MyWrapper().

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(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::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 writeXMLOutput().

SUMOReal MSE2Collector::getStartPos ( ) const
inline

Returns the begin position of the detector.

Returns
The detector's begin position

Definition at line 205 of file MSE2Collector.h.

References myStartPos.

Referenced by GUI_E2_ZS_Collector::MyWrapper::MyWrapper().

virtual DetectorUsage MSE2Collector::getUsageType ( ) const
inlinevirtual

Returns the detector's usage type.

See Also
DetectorUsage
Returns
How the detector is used.

Definition at line 106 of file MSE2Collector.h.

References myUsage.

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

Adds the vehicle to known vehicles if not beyond the dector.

If the vehicles is within the detector are, it is added to the list of known vehicles. The method returns true as long as the vehicle is not beyond the detector.

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
False, if vehicle passed the detector entirely, else true.
See Also
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented from MSMoveReminder.

Definition at line 115 of file MSE2Collector.cpp.

References MSVehicleType::getLength(), SUMOVehicle::getPositionOnLane(), SUMOVehicle::getVehicleType(), myEndPos, myKnownVehicles, and myStartPos.

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

Removes a known vehicle due to its lane-change.

If the reported vehicle is known, it is removed from the list of vehicles to regard (myKnownVehicles).

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
MSMoveReminder::notifyLeave

Reimplemented from MSMoveReminder.

Definition at line 102 of file MSE2Collector.cpp.

References MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), myEndPos, myKnownVehicles, myStartPos, and MSMoveReminder::NOTIFICATION_JUNCTION.

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

Adds/removes vehicles from the list of vehicles to regard.

As soon as the reported vehicle enters the detector area (position>myStartPos) it is added to the list of vehicles to regard (myKnownVehicles). It is removed from this list if it leaves the detector (position<lengt>myEndPos). The method returns true as long as the vehicle is not beyond the detector.

Parameters
[in]vehThe vehicle in question.
[in]oldPosPosition before the move-micro-timestep.
[in]newPosPosition after the move-micro-timestep.
[in]newSpeedUnused here.
Returns
False, if vehicle passed the detector entierly, else true.
See Also
MSMoveReminder
MSMoveReminder::notifyMove

Reimplemented from MSMoveReminder.

Definition at line 79 of file MSE2Collector.cpp.

References MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), myEndPos, myKnownVehicles, and myStartPos.

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.

MSE2Collector& MSE2Collector::operator= ( const MSE2Collector )
private

Invalidated assignment operator.

void MSE2Collector::reset ( )
virtual

Resets all values.

This method is called on initialisation and as soon as the values were written. Values for the next interval may be collected, then. The list of known vehicles stays untouched.

Reimplemented from MSDetectorFileOutput.

Definition at line 131 of file MSE2Collector.cpp.

References myIntervalHaltingVehicleDurations, myJamLengthInMetersSum, myJamLengthInVehiclesSum, myMaxJamInMeters, myMaxJamInVehicles, myMaxOccupancy, myMaxVehicleNumber, myMeanMaxJamInMeters, myMeanMaxJamInVehicles, myMeanVehicleNumber, myOccupancySum, myPastIntervalStandingDurations, myPastStandingDurations, mySpeedSum, myStartedHalts, myTimeSamples, and myVehicleSamples.

Referenced by MSE2Collector(), and writeXMLOutput().

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

void MSE2Collector::writeXMLDetectorProlog ( OutputDevice dev) const
virtual

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 391 of file MSE2Collector.cpp.

References OutputDevice::writeXMLHeader().

void MSE2Collector::writeXMLOutput ( OutputDevice dev,
SUMOTime  startTime,
SUMOTime  stopTime 
)
virtual

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 327 of file MSE2Collector.cpp.

References Named::getID(), MAX2(), myHaltingVehicleDurations, myIntervalHaltingVehicleDurations, myJamLengthInMetersSum, myJamLengthInVehiclesSum, myMaxJamInMeters, myMaxJamInVehicles, myMaxOccupancy, myMaxVehicleNumber, myMeanMaxJamInMeters, myMeanMaxJamInVehicles, myMeanVehicleNumber, myOccupancySum, myPastIntervalStandingDurations, myPastStandingDurations, mySpeedSum, myStartedHalts, myTimeSamples, myVehicleSamples, reset(), STEPS2TIME, SUMOReal, and time2string().

Field Documentation

SUMOReal MSE2Collector::myCurrentJamLengthInMeters
private

The overall jam length in meters.

Definition at line 407 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentJamLengthInMeters().

unsigned MSE2Collector::myCurrentJamLengthInVehicles
private

The overall jam length in vehicles.

Definition at line 409 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentJamLengthInVehicles().

unsigned MSE2Collector::myCurrentJamNo
private

The current jam number.

Definition at line 401 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentJamNumber().

SUMOReal MSE2Collector::myCurrentMaxJamLengthInMeters
private

the current maximum jam length in meters

Definition at line 403 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentMaxJamLengthInMeters().

unsigned MSE2Collector::myCurrentMaxJamLengthInVehicles
private

The current maximum jam length in vehicles.

Definition at line 405 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentMaxJamLengthInVehicles().

SUMOReal MSE2Collector::myCurrentMeanLength
private

The current mean length.

Definition at line 399 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentMeanLength().

SUMOReal MSE2Collector::myCurrentMeanSpeed
private

The current mean speed.

Definition at line 397 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentMeanSpeed().

SUMOReal MSE2Collector::myCurrentOccupancy
private

The current occupancy.

Definition at line 395 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentOccupancy().

unsigned MSE2Collector::myCurrentStartedHalts
private

The number of started halts in the last step.

Definition at line 411 of file MSE2Collector.h.

Referenced by detectorUpdate(), and getCurrentStartedHalts().

SUMOReal MSE2Collector::myEndPos
private

The position the detector ends at.

Definition at line 335 of file MSE2Collector.h.

Referenced by detectorUpdate(), getEndPos(), MSE2Collector(), notifyEnter(), notifyLeave(), and notifyMove().

std::map<SUMOVehicle*, SUMOTime> MSE2Collector::myHaltingVehicleDurations
private

Storage for halting durations of known vehicles (for halting vehicles)

Definition at line 345 of file MSE2Collector.h.

Referenced by detectorUpdate(), and writeXMLOutput().

std::map<SUMOVehicle*, SUMOTime> MSE2Collector::myIntervalHaltingVehicleDurations
private

Storage for halting durations of known vehicles (current interval)

Definition at line 348 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myJamDistanceThreshold
private

Two standing vehicles must be closer than this to be counted into the same jam.

Definition at line 331 of file MSE2Collector.h.

Referenced by detectorUpdate().

SUMOReal MSE2Collector::myJamHaltingSpeedThreshold
private

A vehicle must driver slower than this to be counted as a part of a jam.

Definition at line 327 of file MSE2Collector.h.

Referenced by detectorUpdate().

SUMOTime MSE2Collector::myJamHaltingTimeThreshold
private

A vehicle must be that long beyond myJamHaltingSpeedThreshold to be counted as a part of a jam.

Definition at line 329 of file MSE2Collector.h.

Referenced by detectorUpdate().

SUMOReal MSE2Collector::myJamLengthInMetersSum
private

The sum of jam lengths [m].

Definition at line 365 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

unsigned MSE2Collector::myJamLengthInVehiclesSum
private

The sum of jam lengths [#veh].

Definition at line 367 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

std::list<SUMOVehicle*> MSE2Collector::myKnownVehicles
private

List of known vehicles.

Definition at line 342 of file MSE2Collector.h.

Referenced by detectorUpdate(), getCurrentVehicleNumber(), notifyEnter(), notifyLeave(), notifyMove(), and ~MSE2Collector().

MSLane* const MSMoveReminder::myLane
protectedinherited

Lane on which the reminder works.

Definition at line 215 of file MSMoveReminder.h.

Referenced by detectorUpdate(), MSMoveReminder::getLane(), MSE2Collector(), and MSMoveReminder::MSMoveReminder().

SUMOReal MSE2Collector::myMaxJamInMeters
private

The max jam length [m].

Definition at line 383 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

unsigned MSE2Collector::myMaxJamInVehicles
private

The max jam length [#veh].

Definition at line 381 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myMaxOccupancy
private

The maximum occupancy [%].

Definition at line 375 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

unsigned MSE2Collector::myMaxVehicleNumber
private

The max number of vehicles [#veh].

Definition at line 387 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myMeanMaxJamInMeters
private

The mean jam length [m].

Definition at line 379 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

unsigned MSE2Collector::myMeanMaxJamInVehicles
private

The mean jam length [#veh].

Definition at line 377 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

unsigned MSE2Collector::myMeanVehicleNumber
private

The mean number of vehicles [#veh].

Definition at line 385 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myOccupancySum
private

The sum of occupancies [%].

Definition at line 373 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

std::vector<SUMOTime> MSE2Collector::myPastIntervalStandingDurations
private

Halting durations of ended halts for the current interval [s].

Definition at line 354 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

std::vector<SUMOTime> MSE2Collector::myPastStandingDurations
private

Halting durations of ended halts [s].

Definition at line 351 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::mySpeedSum
private

The sum of collected vehicle speeds [m/s].

Definition at line 361 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myStartedHalts
private

The number of started halts [#].

Definition at line 363 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

SUMOReal MSE2Collector::myStartPos
private

The position the detector starts at.

Definition at line 333 of file MSE2Collector.h.

Referenced by detectorUpdate(), getStartPos(), MSE2Collector(), notifyEnter(), notifyLeave(), and notifyMove().

unsigned MSE2Collector::myTimeSamples
private

The current aggregation duration [#steps].

Definition at line 371 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().

DetectorUsage MSE2Collector::myUsage
private

Information about how this detector is used.

Definition at line 339 of file MSE2Collector.h.

Referenced by getUsageType().

unsigned MSE2Collector::myVehicleSamples
private

The number of collected samples [#].

Definition at line 369 of file MSE2Collector.h.

Referenced by detectorUpdate(), reset(), and writeXMLOutput().


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