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

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

#include <GUI_E2_ZS_Collector.h>

Inheritance diagram for GUI_E2_ZS_Collector:
MSE2Collector MSMoveReminder MSDetectorFileOutput Named

Data Structures

class  MyWrapper

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 GUIDetectorWrapperbuildDetectorGUIRepresentation ()
 Returns the wrapper for this detector.
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.
 GUI_E2_ZS_Collector (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
 ~GUI_E2_ZS_Collector ()
 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.

Protected Attributes

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

Detailed Description

The gui-version of the MS_E2_ZS_Collector.

Allows the building of a wrapper (also declared herein) which draws the detector on the gl-canvas. Beside this, the method "amVisible" is overridden to signalise that this detector is not used for simulation- -internal reasons, but is placed over the simulation by the user.

Definition at line 63 of file GUI_E2_ZS_Collector.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

GUI_E2_ZS_Collector::GUI_E2_ZS_Collector ( 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 62 of file GUI_E2_ZS_Collector.cpp.

GUI_E2_ZS_Collector::~GUI_E2_ZS_Collector ( )

Destructor.

Definition at line 71 of file GUI_E2_ZS_Collector.cpp.


Member Function Documentation

GUIDetectorWrapper * GUI_E2_ZS_Collector::buildDetectorGUIRepresentation ( )
virtual

Returns the wrapper for this detector.

Returns:
The wrapper representing the detector
See also:
MyWrapper

Reimplemented from MSDetectorFileOutput.

Definition at line 75 of file GUI_E2_ZS_Collector.cpp.

Referenced by GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper().

void MSE2Collector::detectorUpdate ( const SUMOTime  step)
virtualinherited

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 155 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(), MSE2Collector::myCurrentJamLengthInMeters, MSE2Collector::myCurrentJamLengthInVehicles, MSE2Collector::myCurrentJamNo, MSE2Collector::myCurrentMaxJamLengthInMeters, MSE2Collector::myCurrentMaxJamLengthInVehicles, MSE2Collector::myCurrentMeanLength, MSE2Collector::myCurrentMeanSpeed, MSE2Collector::myCurrentOccupancy, MSE2Collector::myCurrentStartedHalts, MSE2Collector::myEndPos, MSE2Collector::myHaltingVehicleDurations, MSE2Collector::myIntervalHaltingVehicleDurations, MSE2Collector::myJamDistanceThreshold, MSE2Collector::myJamHaltingSpeedThreshold, MSE2Collector::myJamHaltingTimeThreshold, MSE2Collector::myJamLengthInMetersSum, MSE2Collector::myJamLengthInVehiclesSum, MSE2Collector::myKnownVehicles, MSMoveReminder::myLane, MSE2Collector::myMaxJamInMeters, MSE2Collector::myMaxJamInVehicles, MSE2Collector::myMaxOccupancy, MSE2Collector::myMaxVehicleNumber, MSE2Collector::myMeanMaxJamInMeters, MSE2Collector::myMeanMaxJamInVehicles, MSE2Collector::myMeanVehicleNumber, MSE2Collector::myOccupancySum, MSE2Collector::myPastIntervalStandingDurations, MSE2Collector::myPastStandingDurations, MSE2Collector::mySpeedSum, MSE2Collector::myStartedHalts, MSE2Collector::myStartPos, MSE2Collector::myTimeSamples, MSE2Collector::myVehicleSamples, and SUMOReal.

SUMOReal MSE2Collector::getCurrentJamLengthInMeters ( ) const
inherited

Returns the length of all jams in meters.

Definition at line 444 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentJamLengthInMeters.

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

unsigned MSE2Collector::getCurrentJamLengthInVehicles ( ) const
inherited

Returns the length of all jams in vehicles.

Definition at line 438 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentJamLengthInVehicles.

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

unsigned MSE2Collector::getCurrentJamNumber ( ) const
inherited

Returns the current number of jams.

Definition at line 420 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentJamNo.

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

SUMOReal MSE2Collector::getCurrentMaxJamLengthInMeters ( ) const
inherited

Returns the length in meters of the currently largest jam.

Definition at line 432 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentMaxJamLengthInMeters.

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

unsigned MSE2Collector::getCurrentMaxJamLengthInVehicles ( ) const
inherited

Returns the length in vehicles of the currently largest jam.

Definition at line 426 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentMaxJamLengthInVehicles.

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

SUMOReal MSE2Collector::getCurrentMeanLength ( ) const
inherited

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

Definition at line 414 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentMeanLength.

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

SUMOReal MSE2Collector::getCurrentMeanSpeed ( ) const
inherited

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

Definition at line 408 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentMeanSpeed.

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

SUMOReal MSE2Collector::getCurrentOccupancy ( ) const
inherited

Returns the curent detector occupancy.

Definition at line 402 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentOccupancy, and SUMOReal.

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

unsigned MSE2Collector::getCurrentStartedHalts ( ) const
inherited

Returns the length of all jams in meters.

Definition at line 450 of file MSE2Collector.cpp.

References MSE2Collector::myCurrentStartedHalts.

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

unsigned MSE2Collector::getCurrentVehicleNumber ( ) const
inherited

Returns the number of vehicles currently on the detector.

Definition at line 396 of file MSE2Collector.cpp.

References MSE2Collector::myKnownVehicles.

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

SUMOReal MSE2Collector::getEndPos ( ) const
inlineinherited

Returns the end position of the detector.

Returns:
The detector's end position

Definition at line 214 of file MSE2Collector.h.

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

SUMOReal MSE2Collector::getStartPos ( ) const
inlineinherited

Returns the begin position of the detector.

Returns:
The detector's begin position

Definition at line 205 of file MSE2Collector.h.

References MSE2Collector::myStartPos.

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

virtual DetectorUsage MSE2Collector::getUsageType ( ) const
inlinevirtualinherited

Returns the detector's usage type.

See also:
DetectorUsage
Returns:
How the detector is used.

Definition at line 106 of file MSE2Collector.h.

References MSE2Collector::myUsage.

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

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

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

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

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

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

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

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

References MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), MSE2Collector::myEndPos, MSE2Collector::myKnownVehicles, and MSE2Collector::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.

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

void MSE2Collector::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 390 of file MSE2Collector.cpp.

References OutputDevice::writeXMLHeader().


Field Documentation

MSLane* const MSMoveReminder::myLane
protectedinherited

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