SUMO - Simulation of Urban MObility
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-2016 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  const std::string& vTypes);
86 
87 
96  void init(MSLane* lane, SUMOReal detLength);
97 
98 
101 
102 
107  const std::string& getStartLaneID() const;
108 
109 
110 
113 
122  void writeXMLOutput(OutputDevice& dev,
123  SUMOTime startTime, SUMOTime stopTime);
124 
125 
133  void writeXMLDetectorProlog(OutputDevice& dev) const;
135 
136 
137 
141  SUMOReal getLength() const {
142  return myLength;
143  }
144 
145 protected:
152  void extendTo(SUMOReal length);
153 
154 
162  std::string makeID(const std::string& baseID,
163  int c, int r) const;
164 
165 
174  virtual MSE2Collector* buildCollector(int c, int r,
175  MSLane* l, SUMOReal start, SUMOReal end,
176  const std::set<std::string>& vTypes);
177 
178 
184  std::vector<MSLane*> getLanePredeccessorLanes(MSLane* l);
185 
186 protected:
189 
192 
195 
198 
201 
203  typedef std::vector<MSLane*> LaneVector;
204 
206  typedef std::vector<LaneVector> LaneVectorVector;
207 
209  typedef std::vector<MSE2Collector*> DetectorVector;
210 
212  typedef std::vector<DetectorVector> DetectorVectorVector;
213 
215  typedef std::vector<SUMOReal> LengthVector;
216 
217 
221  LaneVectorVector myLaneCombinations;
222 
223 
227  DetectorVectorVector myDetectorCombinations;
228 
229 
233  LengthVector myLengths;
234 
235 
237  std::string myStartLaneID;
238 
240  typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
241 
243  LaneDetMap myAlreadyBuild;
244 
247 
248 
249 private:
252 
255 
256 
257 };
258 
259 
260 #endif
261 
262 /****************************************************************************/
263 
std::vector< SUMOReal > LengthVector
Definition of a storage for SUMOReal vectors.
MS_E2_ZS_CollectorOverLanes(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Constructor.
SUMOReal haltingSpeedThresholdM
Describes how slow a vehicle must be before being assigned to a jam.
std::vector< MSE2Collector * > DetectorVector
Definition of a detector storage.
long long int SUMOTime
Definition: SUMOTime.h:43
std::vector< MSE2Collector *> CollectorCont
Definition of a E2 collector storage.
virtual MSE2Collector * buildCollector(int c, int r, MSLane *l, SUMOReal start, SUMOReal end, const std::set< std::string > &vTypes)
Builds a single collector.
MS_E2_ZS_CollectorOverLanes & operator=(const MS_E2_ZS_CollectorOverLanes &)
Invalidated assignment operator.
An areal (along a single lane) detector.
Definition: MSE2Collector.h:83
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.
const std::string & getStartLaneID() const
Returns the id of the lane this detector starts at.
DetectorUsage myUsage
Information about how this detector is used.
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:66
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.
SUMOReal getLength() const
Returns this detector&#39;s length [m].
std::string makeID(const std::string &baseID, int c, int r) const
Builds an id for one of the E2 collectors this detector uses.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
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.
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:213
LaneVectorVector myLaneCombinations
Storage for lane combinations.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
Base of value-generating classes (detectors)