SUMO - Simulation of Urban MObility

MS_E2_ZS_CollectorOverLanes Class Reference

A detector which joins E2Collectors over consecutive lanes (backward) More...

#include <MS_E2_ZS_CollectorOverLanes.h>

Inheritance diagram for MS_E2_ZS_CollectorOverLanes:
MSDetectorFileOutput Named GUI_E2_ZS_CollectorOverLanes

Public Types

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

Public Member Functions

const std::string & getID () const throw ()
 Returns this detector's id.
SUMOReal getLength () const throw ()
 Returns this detector's length [m].
const std::string & getStartLaneID () const throw ()
 Returns the id of the lane this detector starts at.
void init (MSLane *lane, SUMOReal detLength) throw ()
 Builds the consecutive E2 detectors.
 MS_E2_ZS_CollectorOverLanes (const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold) throw ()
 Constructor.
void setID (const std::string &newID)
 resets the id
virtual ~MS_E2_ZS_CollectorOverLanes () throw ()
 Destructor.
Methods inherited from MSDetectorFileOutput.
void writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) throw (IOError)
 Writes collected values into the given stream.
void writeXMLDetectorProlog (OutputDevice &dev) const throw (IOError)
 Opens the XML-output using "detector" as root element.
Virtual methods to implement by derived classes
virtual void reset () throw ()
 Resets collected values.
virtual void detectorUpdate (const SUMOTime step) throw ()
 Updates the detector (computes values)
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation ()
 Builds the graphical representation.

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::vector< SUMOReal > DoubleVector
 Definition of a SUMOReal storage.
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< LaneVector > LaneVectorVector
 Definition of a storage for lane vectors.
typedef DoubleVector LengthVector
 Definition of a storage for SUMOReal vectors.

Protected Member Functions

virtual MSE2Collector * buildCollector (size_t c, size_t r, MSLane *l, SUMOReal start, SUMOReal end) throw ()
 Builds a single collector.
void extendTo (SUMOReal length) throw ()
 This method extends the current length up to the given.
std::vector< MSLane * > getLanePredeccessorLanes (MSLane *l) throw ()
 Returns the list of lanes predecessing the given one.
std::string makeID (const std::string &baseID, size_t c, size_t r) const throw ()
 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.

Private Member Functions

 MS_E2_ZS_CollectorOverLanes (const MS_E2_ZS_CollectorOverLanes &)
 Invalidated copy constructor.
MS_E2_ZS_CollectorOverLanes & operator= (const MS_E2_ZS_CollectorOverLanes &)
 Invalidated assignment operator.

Detailed Description

A detector which joins E2Collectors over consecutive lanes (backward)

This class is somekind of a wrapper over several MSE2Collectors.

For some reasons it may be necessary to use MSE2Collectors that are longer than the lane they begin at. In this case, this class should be used. MSE2Collectors are laid on consecutive lanes backwards, building a virtual detector for each lane combination.

There are still some problems with it: we do not know how the different combinations shall be treated.

Definition at line 62 of file MS_E2_ZS_CollectorOverLanes.h.


Member Typedef Documentation

Definition of a E2 collector storage.

Definition at line 66 of file MS_E2_ZS_CollectorOverLanes.h.

Definition of a detector storage.

Definition at line 212 of file MS_E2_ZS_CollectorOverLanes.h.

Definition of a storage for detector vectors.

Definition at line 215 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<SUMOReal> MS_E2_ZS_CollectorOverLanes::DoubleVector [protected]

Definition of a SUMOReal storage.

Definition at line 218 of file MS_E2_ZS_CollectorOverLanes.h.

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

Definition at line 249 of file MS_E2_ZS_CollectorOverLanes.h.

typedef std::vector<MSLane*> MS_E2_ZS_CollectorOverLanes::LaneVector [protected]

Definition of a lane storage.

Definition at line 206 of file MS_E2_ZS_CollectorOverLanes.h.

Definition of a storage for lane vectors.

Definition at line 209 of file MS_E2_ZS_CollectorOverLanes.h.

Definition of a storage for SUMOReal vectors.

Definition at line 221 of file MS_E2_ZS_CollectorOverLanes.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
[in]idThe id of the detector
[in]usageInformation how the detector is used
[in]laneThe lane the detector starts 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 42 of file MS_E2_ZS_CollectorOverLanes.cpp.

MS_E2_ZS_CollectorOverLanes::~MS_E2_ZS_CollectorOverLanes ( ) throw () [virtual]

Destructor.

Definition at line 78 of file MS_E2_ZS_CollectorOverLanes.cpp.

MS_E2_ZS_CollectorOverLanes::MS_E2_ZS_CollectorOverLanes ( const MS_E2_ZS_CollectorOverLanes &  ) [private]

Invalidated copy constructor.


Member Function Documentation

MSE2Collector * MS_E2_ZS_CollectorOverLanes::buildCollector ( size_t  c,
size_t  r,
MSLane *  l,
SUMOReal  start,
SUMOReal  end 
) throw () [protected, virtual]

Builds a single collector.

Parameters:
[in]c!!!
[in]r!!!
[in]start!!!
[in]end!!!
Todo:
Describe!

Reimplemented in GUI_E2_ZS_CollectorOverLanes.

Definition at line 195 of file MS_E2_ZS_CollectorOverLanes.cpp.

References SUMOReal.

virtual GUIDetectorWrapper* MSDetectorFileOutput::buildDetectorGUIRepresentation ( ) [inline, virtual, inherited]

Builds the graphical representation.

Meant to be overridden by grahical 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, GUI_E2_ZS_CollectorOverLanes, GUIE3Collector, GUIInductLoop, and GUIInstantInductLoop.

Definition at line 117 of file MSDetectorFileOutput.h.

virtual void MSDetectorFileOutput::detectorUpdate ( const SUMOTime  step) throw () [inline, virtual, inherited]

Updates the detector (computes values)

Parameters:
[in]stepThe current time step

Reimplemented in MSE2Collector, MSE3Collector, MSMeanData, and MSMeanData_Harmonoise.

Definition at line 109 of file MSDetectorFileOutput.h.

void MS_E2_ZS_CollectorOverLanes::extendTo ( SUMOReal  length) throw () [protected]

This method extends the current length up to the given.

This method is called consecutively until all paths have the desired length

Parameters:
[in]length!!!
Todo:
Describe length's usage

Definition at line 82 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MSLane::getEdge(), MSEdge::getLanes(), MSLane::getLength(), and SUMOReal.

const std::string & MS_E2_ZS_CollectorOverLanes::getID ( ) const throw ()

Returns this detector's id.

Returns:
The id of this detector

Reimplemented from Named.

Definition at line 256 of file MS_E2_ZS_CollectorOverLanes.cpp.

References myID.

std::vector< MSLane * > MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes ( MSLane *  l) throw () [protected]

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 165 of file MS_E2_ZS_CollectorOverLanes.cpp.

References MSEdge::allowedLanes(), and SVC_UNKNOWN.

SUMOReal MS_E2_ZS_CollectorOverLanes::getLength ( ) const throw () [inline]

Returns this detector's length [m].

Returns:
This detector's length in meters

Definition at line 145 of file MS_E2_ZS_CollectorOverLanes.h.

References myLength.

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

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 262 of file MS_E2_ZS_CollectorOverLanes.cpp.

References myStartLaneID.

void MS_E2_ZS_CollectorOverLanes::init ( MSLane *  lane,
SUMOReal  detLength 
) throw ()

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 56 of file MS_E2_ZS_CollectorOverLanes.cpp.

References SUMOReal.

std::string MS_E2_ZS_CollectorOverLanes::makeID ( const std::string &  baseID,
size_t  c,
size_t  r 
) const throw () [protected]

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 234 of file MS_E2_ZS_CollectorOverLanes.cpp.

References DU_SUMO_INTERNAL, DU_TL_CONTROL, DU_USER_DEFINED, and myUsage.

MS_E2_ZS_CollectorOverLanes& MS_E2_ZS_CollectorOverLanes::operator= ( const MS_E2_ZS_CollectorOverLanes &  ) [private]

Invalidated assignment operator.

virtual void MSDetectorFileOutput::reset ( ) throw () [inline, virtual, inherited]

Resets collected values.

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

See also:
Command_SaveTLCoupledLaneDet
Todo:
Reckeck/refactor

Reimplemented in GUIInductLoop, MSE2Collector, MSE3Collector, and MSInductLoop.

Definition at line 102 of file MSDetectorFileOutput.h.

Referenced by Command_SaveTLCoupledLaneDet::execute().

void Named::setID ( const std::string &  newID) [inline, inherited]

resets the id

Definition at line 65 of file Named.h.

References Named::myID.

void MS_E2_ZS_CollectorOverLanes::writeXMLDetectorProlog ( OutputDevice &  dev) const throw (IOError) [virtual]

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 226 of file MS_E2_ZS_CollectorOverLanes.cpp.

void MS_E2_ZS_CollectorOverLanes::writeXMLOutput ( OutputDevice &  dev,
SUMOTime  startTime,
SUMOTime  stopTime 
) throw (IOError) [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 208 of file MS_E2_ZS_CollectorOverLanes.cpp.


Field Documentation

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

Definition at line 200 of file MS_E2_ZS_CollectorOverLanes.h.

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

Definition at line 197 of file MS_E2_ZS_CollectorOverLanes.h.

Describes how long a jam must be before being recognized.

Definition at line 203 of file MS_E2_ZS_CollectorOverLanes.h.

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

Definition at line 252 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by GUI_E2_ZS_CollectorOverLanes::buildDetectorGUIRepresentation().

Storage for detector combinations.

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

Definition at line 233 of file MS_E2_ZS_CollectorOverLanes.h.

std::string MS_E2_ZS_CollectorOverLanes::myID [protected]

The id of this detector.

Reimplemented from Named.

Definition at line 243 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by getID().

Storage for lane combinations.

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

Definition at line 227 of file MS_E2_ZS_CollectorOverLanes.h.

The length of the collector.

Definition at line 194 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by getLength().

Storage for length combinations.

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

Definition at line 239 of file MS_E2_ZS_CollectorOverLanes.h.

The id of the lane this detector starts at.

Definition at line 246 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by getStartLaneID().

Information about how this detector is used.

Definition at line 255 of file MS_E2_ZS_CollectorOverLanes.h.

Referenced by makeID().

The position the collector starts at.

Definition at line 191 of file MS_E2_ZS_CollectorOverLanes.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines