SUMO - Simulation of Urban MObility
|
A detector which joins E2Collectors over consecutive lanes (backward) More...
#include <MS_E2_ZS_CollectorOverLanes.h>
Public Types | |
typedef std::vector < MSE2Collector * > | CollectorCont |
Definition of a E2 collector storage. |
Public Member Functions | |
void | addTo (const StoringVisitor &cont) const |
Adds this object to the given container. | |
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. | |
void | init (MSLane *lane, SUMOReal detLength) |
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) | |
Constructor. | |
void | setID (const std::string &newID) |
resets the id | |
virtual | ~MS_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) | |
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::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 std::vector< SUMOReal > | 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) |
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. |
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. |
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 64 of file MS_E2_ZS_CollectorOverLanes.h.
typedef std::vector< MSE2Collector* > MS_E2_ZS_CollectorOverLanes::CollectorCont |
Definition of a E2 collector storage.
Definition at line 68 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a detector storage.
Definition at line 214 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a storage for detector vectors.
Definition at line 217 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a map from a lane to the detector lying on it.
Definition at line 248 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a lane storage.
Definition at line 208 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a storage for lane vectors.
Definition at line 211 of file MS_E2_ZS_CollectorOverLanes.h.
|
protected |
Definition of a storage for SUMOReal vectors.
Definition at line 220 of file MS_E2_ZS_CollectorOverLanes.h.
MS_E2_ZS_CollectorOverLanes::MS_E2_ZS_CollectorOverLanes | ( | const std::string & | id, |
DetectorUsage | usage, | ||
MSLane * | lane, | ||
SUMOReal | startPos, | ||
SUMOTime | haltingTimeThreshold, | ||
SUMOReal | haltingSpeedThreshold, | ||
SUMOReal | jamDistThreshold | ||
) |
Constructor.
[in] | id | The id of the detector |
[in] | usage | Information how the detector is used |
[in] | lane | The lane the detector starts at |
[in] | startPos | Begin position of the detector |
[in] | detLength | Length of the detector |
[in] | haltingTimeThreshold | The time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed |
[in] | haltingSpeedThreshold | The speed a vehicle's speed must be below to be assigned as jammed |
[in] | jamDistThreshold | The distance between two vehicles in order to not count them to one jam |
Definition at line 46 of file MS_E2_ZS_CollectorOverLanes.cpp.
|
virtual |
Destructor.
Definition at line 82 of file MS_E2_ZS_CollectorOverLanes.cpp.
|
private |
Invalidated copy constructor.
|
inlineinherited |
Adds this object to the given container.
in,filled] | cont The container to add this item to |
Definition at line 114 of file Named.h.
References Named::StoringVisitor::add().
|
protectedvirtual |
Builds a single collector.
[in] | c | !!! |
[in] | r | !!! |
[in] | start | !!! |
[in] | end | !!! |
Reimplemented in GUI_E2_ZS_CollectorOverLanes.
Definition at line 199 of file MS_E2_ZS_CollectorOverLanes.cpp.
References Named::getID(), getLength(), MSLane::getLength(), haltingSpeedThresholdM, haltingTimeThresholdM, jamDistThresholdM, makeID(), myUsage, and SUMOReal.
Referenced by extendTo(), and init().
|
inlinevirtualinherited |
Builds the graphical representation.
Meant to be overridden by graphical versions of the detectors
Reimplemented in GUI_E2_ZS_Collector, GUIInductLoop, GUIE3Collector, GUI_E2_ZS_CollectorOverLanes, and GUIInstantInductLoop.
Definition at line 123 of file MSDetectorFileOutput.h.
|
inlinevirtualinherited |
Updates the detector (computes values)
[in] | step | The current time step |
Reimplemented in MSMeanData, MSE3Collector, MSMeanData_Harmonoise, and MSE2Collector.
Definition at line 113 of file MSDetectorFileOutput.h.
References UNUSED_PARAMETER.
|
protected |
This method extends the current length up to the given.
This method is called consecutively until all paths have the desired length
[in] | length | !!! |
Definition at line 86 of file MS_E2_ZS_CollectorOverLanes.cpp.
References buildCollector(), MSLane::getEdge(), getLanePredeccessorLanes(), MSEdge::getLanes(), MSLane::getLength(), myAlreadyBuild, myDetectorCombinations, myLaneCombinations, myLengths, and SUMOReal.
Referenced by init().
const std::string & MS_E2_ZS_CollectorOverLanes::getID | ( | ) | const |
Returns this detector's id.
Reimplemented from Named.
Definition at line 260 of file MS_E2_ZS_CollectorOverLanes.cpp.
References myID.
|
protected |
Returns the list of lanes predecessing the given one.
[in] | l | The lane to return predecessors of |
Definition at line 169 of file MS_E2_ZS_CollectorOverLanes.cpp.
References MSEdge::allowedLanes(), MSLane::getEdge(), Named::getID(), MSEdge::getIncomingEdges(), and SVC_UNKNOWN.
Referenced by extendTo().
|
inline |
Returns this detector's length [m].
Definition at line 147 of file MS_E2_ZS_CollectorOverLanes.h.
References myLength.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), and buildCollector().
const std::string & MS_E2_ZS_CollectorOverLanes::getStartLaneID | ( | ) | const |
Returns the id of the lane this detector starts at.
Definition at line 266 of file MS_E2_ZS_CollectorOverLanes.cpp.
References myStartLaneID.
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
[in] | lane | The lane the detector starts at |
[in] | startPos | Begin position of the detector |
Definition at line 60 of file MS_E2_ZS_CollectorOverLanes.cpp.
References buildCollector(), extendTo(), MSLane::getLength(), myAlreadyBuild, myDetectorCombinations, myLaneCombinations, myLength, myLengths, startPosM, and SUMOReal.
|
protected |
Builds an id for one of the E2 collectors this detector uses.
[in] | baseID | The id of the parent detector |
[in] | c | !!! |
[in] | r | !!! |
Definition at line 238 of file MS_E2_ZS_CollectorOverLanes.cpp.
References bla, DU_SUMO_INTERNAL, DU_TL_CONTROL, DU_USER_DEFINED, and myUsage.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), and buildCollector().
|
private |
Invalidated assignment operator.
|
inlinevirtualinherited |
Resets collected values.
Please note that this is only a "hack" for coupled-tls-outputs.
Reimplemented in MSE2Collector, MSE3Collector, MSInductLoop, and GUIInductLoop.
Definition at line 106 of file MSDetectorFileOutput.h.
Referenced by Command_SaveTLCoupledLaneDet::execute().
|
inlineinherited |
resets the id
[in] | newID | The new id of this object |
Definition at line 68 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
virtual |
Opens the XML-output using "detector" as root element.
[in] | dev | The output device to write the root into |
IOError | If an error on writing occurs (!!! not yet implemented) |
Implements MSDetectorFileOutput.
Definition at line 230 of file MS_E2_ZS_CollectorOverLanes.cpp.
References OutputDevice::writeXMLHeader().
|
virtual |
Writes collected values into the given stream.
[in] | dev | The output device to write the data into |
[in] | startTime | First time step the data were gathered |
[in] | stopTime | Last time step the data were gathered |
IOError | If an error on writing occurs (!!! not yet implemented) |
Implements MSDetectorFileOutput.
Definition at line 212 of file MS_E2_ZS_CollectorOverLanes.cpp.
|
protected |
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 GUI_E2_ZS_CollectorOverLanes::buildCollector(), and buildCollector().
|
protected |
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 GUI_E2_ZS_CollectorOverLanes::buildCollector(), and buildCollector().
|
protected |
Describes how long a jam must be before being recognized.
Definition at line 205 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), and buildCollector().
|
protected |
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 GUI_E2_ZS_CollectorOverLanes::buildDetectorGUIRepresentation(), extendTo(), and init().
|
protected |
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 extendTo(), and init().
|
protected |
The id of this detector.
Definition at line 242 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), and getID().
|
protected |
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 extendTo(), and init().
|
protected |
The length of the collector.
Definition at line 196 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by getLength(), and init().
|
protected |
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 extendTo(), and init().
|
protected |
The id of the lane this detector starts at.
Definition at line 245 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by getStartLaneID().
|
protected |
Information about how this detector is used.
Definition at line 254 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), buildCollector(), and makeID().
|
protected |
The position the collector starts at.
Definition at line 193 of file MS_E2_ZS_CollectorOverLanes.h.
Referenced by init().