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

The gui-version of a MS_E2_ZS_CollectorOverLanes. More...

#include <GUI_E2_ZS_CollectorOverLanes.h>

Inheritance diagram for GUI_E2_ZS_CollectorOverLanes:
MS_E2_ZS_CollectorOverLanes MSDetectorFileOutput Named

Data Structures

class  MyWrapper

Public Types

typedef std::vector
< MSE2Collector * > 
CollectorCont
 Definition of a E2 collector storage.
typedef std::vector
< GUI_E2_ZS_Collector * > 
CollectorVector

Public Member Functions

virtual GUIDetectorWrapperbuildDetectorGUIRepresentation ()
 Builds the graphical representation.
const std::string & getID () const
 Returns this detector's id.
SUMOReal getLength () const
 Returns this detector's length [m].
const std::string & getStartLaneID () const
 Returns the id of the lane this detector starts at.
 GUI_E2_ZS_CollectorOverLanes (std::string id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Constructor.
void init (MSLane *lane, SUMOReal detLength)
 Builds the consecutive E2 detectors.
void setID (const std::string &newID)
 resets the id
 ~GUI_E2_ZS_CollectorOverLanes ()
 Destructor.
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.
Virtual methods to implement by derived classes
virtual void reset ()
 Resets collected values.
virtual void detectorUpdate (const SUMOTime step)
 Updates the detector (computes values)

Protected Types

typedef std::vector
< MSE2Collector * > 
DetectorVector
 Definition of a detector storage.
typedef std::vector
< DetectorVector
DetectorVectorVector
 Definition of a storage for detector vectors.
typedef std::map< MSLane
*, MSE2Collector * > 
LaneDetMap
 Definition of a map from a lane to the detector lying on it.
typedef std::vector< MSLane * > LaneVector
 Definition of a lane storage.
typedef std::vector< LaneVectorLaneVectorVector
 Definition of a storage for lane vectors.
typedef std::vector< SUMORealLengthVector
 Definition of a storage for SUMOReal vectors.

Protected Member Functions

MSE2CollectorbuildCollector (size_t c, size_t r, MSLane *l, SUMOReal start, SUMOReal end)
 Builds a single collector.
void extendTo (SUMOReal length)
 This method extends the current length up to the given.
std::vector< MSLane * > getLanePredeccessorLanes (MSLane *l)
 Returns the list of lanes predecessing the given one.
std::string makeID (const std::string &baseID, size_t c, size_t r) const
 Builds an id for one of the E2 collectors this detector uses.

Protected Attributes

SUMOReal haltingSpeedThresholdM
 Describes how slow a vehicle must be before being assigned to a jam.
SUMOTime haltingTimeThresholdM
 Describes how long a vehicle shall stay before being assigned to a jam.
SUMOReal jamDistThresholdM
 Describes how long a jam must be before being recognized.
LaneDetMap myAlreadyBuild
 Storage for detectors which already have been build for a single lane.
DetectorVectorVector myDetectorCombinations
 Storage for detector combinations.
std::string myID
 The id of this detector.
LaneVectorVector myLaneCombinations
 Storage for lane combinations.
SUMOReal myLength
 The length of the collector.
LengthVector myLengths
 Storage for length combinations.
std::string myStartLaneID
 The id of the lane this detector starts at.
DetectorUsage myUsage
 Information about how this detector is used.
SUMOReal startPosM
 The position the collector starts at.

Detailed Description

The gui-version of a MS_E2_ZS_CollectorOverLanes.

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_CollectorOverLanes.h.

Member Typedef Documentation

typedef std::vector< MSE2Collector* > MS_E2_ZS_CollectorOverLanes::CollectorCont
inherited

Definition of a E2 collector storage.

Definition at line 68 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<MSE2Collector*> MS_E2_ZS_CollectorOverLanes::DetectorVector
protectedinherited

Definition of a detector storage.

Definition at line 214 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<DetectorVector> MS_E2_ZS_CollectorOverLanes::DetectorVectorVector
protectedinherited

Definition of a storage for detector vectors.

Definition at line 217 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::map<MSLane*, MSE2Collector*> MS_E2_ZS_CollectorOverLanes::LaneDetMap
protectedinherited

Definition of a map from a lane to the detector lying on it.

Definition at line 248 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<MSLane*> MS_E2_ZS_CollectorOverLanes::LaneVector
protectedinherited

Definition of a lane storage.

Definition at line 208 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<LaneVector> MS_E2_ZS_CollectorOverLanes::LaneVectorVector
protectedinherited

Definition of a storage for lane vectors.

Definition at line 211 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<SUMOReal> MS_E2_ZS_CollectorOverLanes::LengthVector
protectedinherited

Definition of a storage for SUMOReal vectors.

Definition at line 220 of file MS_E2_ZS_CollectorOverLanes.h.

Constructor & Destructor Documentation

GUI_E2_ZS_CollectorOverLanes::GUI_E2_ZS_CollectorOverLanes ( std::string  id,
DetectorUsage  usage,
MSLane lane,
SUMOReal  startPos,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)

Constructor.

Definition at line 60 of file GUI_E2_ZS_CollectorOverLanes.cpp.

GUI_E2_ZS_CollectorOverLanes::~GUI_E2_ZS_CollectorOverLanes ( )

Destructor.

Definition at line 70 of file GUI_E2_ZS_CollectorOverLanes.cpp.

Member Function Documentation

MSE2Collector * GUI_E2_ZS_CollectorOverLanes::buildCollector ( size_t  c,
size_t  r,
MSLane l,
SUMOReal  start,
SUMOReal  end 
)
protectedvirtual
GUIDetectorWrapper * GUI_E2_ZS_CollectorOverLanes::buildDetectorGUIRepresentation ( )
virtual

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 from MSDetectorFileOutput.

Definition at line 74 of file GUI_E2_ZS_CollectorOverLanes.cpp.

References MS_E2_ZS_CollectorOverLanes::myAlreadyBuild.

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 MS_E2_ZS_CollectorOverLanes::extendTo ( SUMOReal  length)
protectedinherited
const std::string & MS_E2_ZS_CollectorOverLanes::getID ( ) const
inherited

Returns this detector's id.

Returns
The id of this detector

Reimplemented from Named.

Definition at line 259 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MS_E2_ZS_CollectorOverLanes::myID.

std::vector< MSLane * > MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes ( MSLane l)
protectedinherited

Returns the list of lanes predecessing the given one.

Parameters
[in]lThe lane to return predecessors of
Returns
List of lanes predecessing the given one

Definition at line 168 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MSEdge::allowedLanes(), MSLane::getEdge(), MSEdge::getID(), MSEdge::getIncomingEdges(), and SVC_UNKNOWN.

Referenced by MS_E2_ZS_CollectorOverLanes::extendTo().

SUMOReal MS_E2_ZS_CollectorOverLanes::getLength ( ) const
inlineinherited

Returns this detector's length [m].

Returns
This detector's length in meters

Definition at line 147 of file MS_E2_ZS_CollectorOverLanes.h.

References MS_E2_ZS_CollectorOverLanes::myLength.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::buildCollector().

const std::string & MS_E2_ZS_CollectorOverLanes::getStartLaneID ( ) const
inherited

Returns the id of the lane this detector starts at.

Returns
The id of the lane this detector starts at
Todo:
Check whether this is needed

Definition at line 265 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MS_E2_ZS_CollectorOverLanes::myStartLaneID.

void MS_E2_ZS_CollectorOverLanes::init ( MSLane lane,
SUMOReal  detLength 
)
inherited

Builds the consecutive E2 detectors.

This is not done within the constructor to allow overriding of most functions but the building of detectors itself which in fact is depending on whether the normal or the gui-version is used

Parameters
[in]laneThe lane the detector starts at
[in]startPosBegin position of the detector

Definition at line 59 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MS_E2_ZS_CollectorOverLanes::buildCollector(), MS_E2_ZS_CollectorOverLanes::extendTo(), MSLane::getLength(), MS_E2_ZS_CollectorOverLanes::myAlreadyBuild, MS_E2_ZS_CollectorOverLanes::myDetectorCombinations, MS_E2_ZS_CollectorOverLanes::myLaneCombinations, MS_E2_ZS_CollectorOverLanes::myLength, MS_E2_ZS_CollectorOverLanes::myLengths, MS_E2_ZS_CollectorOverLanes::startPosM, and SUMOReal.

std::string MS_E2_ZS_CollectorOverLanes::makeID ( const std::string &  baseID,
size_t  c,
size_t  r 
) const
protectedinherited

Builds an id for one of the E2 collectors this detector uses.

Parameters
[in]baseIDThe id of the parent detector
[in]c!!!
[in]r!!!
Todo:
Describe!

Definition at line 237 of file MS_E2_ZS_CollectorOverLanes.cpp.

References bla, DU_SUMO_INTERNAL, DU_TL_CONTROL, DU_USER_DEFINED, and MS_E2_ZS_CollectorOverLanes::myUsage.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::buildCollector().

virtual void MSDetectorFileOutput::reset ( )
inlinevirtualinherited

Resets collected values.

Please note that this is only a "hack" for coupled-tls-outputs.

See Also
Command_SaveTLCoupledLaneDet
Todo:
Reckeck/refactor

Reimplemented in MSE2Collector, MSE3Collector, MSInductLoop, and GUIInductLoop.

Definition at line 106 of file MSDetectorFileOutput.h.

Referenced by Command_SaveTLCoupledLaneDet::execute().

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 MS_E2_ZS_CollectorOverLanes::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
Todo:
What happens with the additional information if several detectors use the same output?
Exceptions
IOErrorIf an error on writing occurs (!!! not yet implemented)

Implements MSDetectorFileOutput.

Definition at line 229 of file MS_E2_ZS_CollectorOverLanes.cpp.

References OutputDevice::writeXMLHeader().

void MS_E2_ZS_CollectorOverLanes::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 211 of file MS_E2_ZS_CollectorOverLanes.cpp.

Field Documentation

SUMOReal MS_E2_ZS_CollectorOverLanes::haltingSpeedThresholdM
protectedinherited

Describes how slow a vehicle must be before being assigned to a jam.

Definition at line 202 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::buildCollector().

SUMOTime MS_E2_ZS_CollectorOverLanes::haltingTimeThresholdM
protectedinherited

Describes how long a vehicle shall stay before being assigned to a jam.

Definition at line 199 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::buildCollector().

SUMOReal MS_E2_ZS_CollectorOverLanes::jamDistThresholdM
protectedinherited

Describes how long a jam must be before being recognized.

Definition at line 205 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::buildCollector().

LaneDetMap MS_E2_ZS_CollectorOverLanes::myAlreadyBuild
protectedinherited

Storage for detectors which already have been build for a single lane.

Definition at line 251 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildDetectorGUIRepresentation(), MS_E2_ZS_CollectorOverLanes::extendTo(), and MS_E2_ZS_CollectorOverLanes::init().

DetectorVectorVector MS_E2_ZS_CollectorOverLanes::myDetectorCombinations
protectedinherited

Storage for detector combinations.

Each detector combination is a vector of consecutive lanes (backwards)

Definition at line 232 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::extendTo(), and MS_E2_ZS_CollectorOverLanes::init().

std::string MS_E2_ZS_CollectorOverLanes::myID
protectedinherited

The id of this detector.

Definition at line 242 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildCollector(), and MS_E2_ZS_CollectorOverLanes::getID().

LaneVectorVector MS_E2_ZS_CollectorOverLanes::myLaneCombinations
protectedinherited

Storage for lane combinations.

Each lane combination is a vector of consecutive lanes (backwards)

Definition at line 226 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::extendTo(), and MS_E2_ZS_CollectorOverLanes::init().

SUMOReal MS_E2_ZS_CollectorOverLanes::myLength
protectedinherited

The length of the collector.

Definition at line 196 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::getLength(), and MS_E2_ZS_CollectorOverLanes::init().

LengthVector MS_E2_ZS_CollectorOverLanes::myLengths
protectedinherited

Storage for length combinations.

Each length combination is a vector of consecutive lanes (backwards)

Definition at line 238 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::extendTo(), and MS_E2_ZS_CollectorOverLanes::init().

std::string MS_E2_ZS_CollectorOverLanes::myStartLaneID
protectedinherited

The id of the lane this detector starts at.

Definition at line 245 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::getStartLaneID().

DetectorUsage MS_E2_ZS_CollectorOverLanes::myUsage
protectedinherited

Information about how this detector is used.

Definition at line 254 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by buildCollector(), MS_E2_ZS_CollectorOverLanes::buildCollector(), and MS_E2_ZS_CollectorOverLanes::makeID().

SUMOReal MS_E2_ZS_CollectorOverLanes::startPosM
protectedinherited

The position the collector starts at.

Definition at line 193 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by MS_E2_ZS_CollectorOverLanes::init().


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