SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MS_E2_ZS_CollectorOverLanes.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A detector which joins E2Collectors over consecutive lanes (backward)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MS_E2_ZS_CollectorOverLanes_h
22 #define MS_E2_ZS_CollectorOverLanes_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class MSLane;
42 class SUMOVehicle;
43 class OutputDevice;
44 class MSE2Collector;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
65 public:
67  typedef std::vector< MSE2Collector* > CollectorCont;
68 
81  MS_E2_ZS_CollectorOverLanes(const std::string& id,
82  DetectorUsage usage, MSLane* lane, SUMOReal startPos,
83  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
84  SUMOReal jamDistThreshold);
85 
86 
95  void init(MSLane* lane, SUMOReal detLength);
96 
97 
100 
101 
106  const std::string& getStartLaneID() const;
107 
108 
109 
112 
121  void writeXMLOutput(OutputDevice& dev,
122  SUMOTime startTime, SUMOTime stopTime);
123 
124 
132  void writeXMLDetectorProlog(OutputDevice& dev) const;
134 
135 
136 
140  SUMOReal getLength() const {
141  return myLength;
142  }
143 
144 protected:
151  void extendTo(SUMOReal length);
152 
153 
161  std::string makeID(const std::string& baseID,
162  size_t c, size_t r) const;
163 
164 
173  virtual MSE2Collector* buildCollector(size_t c, size_t r,
174  MSLane* l, SUMOReal start, SUMOReal end);
175 
176 
182  std::vector<MSLane*> getLanePredeccessorLanes(MSLane* l);
183 
184 protected:
187 
190 
193 
196 
199 
201  typedef std::vector<MSLane*> LaneVector;
202 
204  typedef std::vector<LaneVector> LaneVectorVector;
205 
207  typedef std::vector<MSE2Collector*> DetectorVector;
208 
210  typedef std::vector<DetectorVector> DetectorVectorVector;
211 
213  typedef std::vector<SUMOReal> LengthVector;
214 
215 
219  LaneVectorVector myLaneCombinations;
220 
221 
225  DetectorVectorVector myDetectorCombinations;
226 
227 
231  LengthVector myLengths;
232 
233 
235  std::string myStartLaneID;
236 
238  typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
239 
241  LaneDetMap myAlreadyBuild;
242 
245 
246 
247 private:
250 
253 
254 
255 };
256 
257 
258 #endif
259 
260 /****************************************************************************/
261 
std::vector< SUMOReal > LengthVector
Definition of a storage for SUMOReal vectors.
SUMOReal haltingSpeedThresholdM
Describes how slow a vehicle must be before being assigned to a jam.
std::vector< MSE2Collector * > DetectorVector
Definition of a detector storage.
std::vector< MSE2Collector * > CollectorCont
Definition of a E2 collector storage.
const std::string & getStartLaneID() const
Returns the id of the lane this detector starts at.
MS_E2_ZS_CollectorOverLanes & operator=(const MS_E2_ZS_CollectorOverLanes &)
Invalidated assignment operator.
An areal (along a single lane) detector.
Definition: MSE2Collector.h:79
A detector which joins E2Collectors over consecutive lanes (backward)
SUMOTime haltingTimeThresholdM
Describes how long a vehicle shall stay before being assigned to a jam.
LengthVector myLengths
Storage for length combinations.
std::vector< MSLane * > getLanePredeccessorLanes(MSLane *l)
Returns the list of lanes predecessing the given one.
std::vector< MSLane * > LaneVector
Definition of a lane storage.
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.
DetectorUsage myUsage
Information about how this detector is used.
virtual MSE2Collector * buildCollector(size_t c, size_t r, MSLane *l, SUMOReal start, SUMOReal end)
Builds a single collector.
SUMOReal jamDistThresholdM
Describes how long a jam must be before being recognized.
std::string myStartLaneID
The id of the lane this detector starts at.
Representation of a vehicle.
Definition: SUMOVehicle.h:65
MS_E2_ZS_CollectorOverLanes(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Constructor.
std::vector< LaneVector > LaneVectorVector
Definition of a storage for lane vectors.
SUMOReal myLength
The length of the collector.
virtual ~MS_E2_ZS_CollectorOverLanes()
Destructor.
SUMOReal startPosM
The position the collector starts at.
DetectorVectorVector myDetectorCombinations
Storage for detector combinations.
std::map< MSLane *, MSE2Collector * > LaneDetMap
Definition of a map from a lane to the detector lying on it.
void extendTo(SUMOReal length)
This method extends the current length up to the given.
void init(MSLane *lane, SUMOReal detLength)
Builds the consecutive E2 detectors.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
int SUMOTime
Definition: SUMOTime.h:43
std::vector< DetectorVector > DetectorVectorVector
Definition of a storage for detector vectors.
LaneDetMap myAlreadyBuild
Storage for detectors which already have been build for a single lane.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:218
LaneVectorVector myLaneCombinations
Storage for lane combinations.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
Base of value-generating classes (detectors)
SUMOReal getLength() const
Returns this detector's length [m].