SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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.sourceforge.net/
11 // Copyright (C) 2001-2012 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 MSDetectorFileOutput {
66 public:
68  typedef std::vector< MSE2Collector* > CollectorCont;
69 
82  MS_E2_ZS_CollectorOverLanes(const std::string& id,
83  DetectorUsage usage, MSLane* lane, SUMOReal startPos,
84  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
85  SUMOReal jamDistThreshold) ;
86 
87 
96  void init(MSLane* lane, SUMOReal detLength) ;
97 
98 
100  virtual ~MS_E2_ZS_CollectorOverLanes() ;
101 
102 
106  const std::string& getID() const ;
107 
108 
113  const std::string& getStartLaneID() const ;
114 
115 
116 
119 
128  void writeXMLOutput(OutputDevice& dev,
129  SUMOTime startTime, SUMOTime stopTime);
130 
131 
139  void writeXMLDetectorProlog(OutputDevice& dev) const;
141 
142 
143 
147  SUMOReal getLength() const {
148  return myLength;
149  }
150 
151 protected:
158  void extendTo(SUMOReal length) ;
159 
160 
168  std::string makeID(const std::string& baseID,
169  size_t c, size_t r) const ;
170 
171 
180  virtual MSE2Collector* buildCollector(size_t c, size_t r,
181  MSLane* l, SUMOReal start, SUMOReal end) ;
182 
183 
189  std::vector<MSLane*> getLanePredeccessorLanes(MSLane* l) ;
190 
191 protected:
194 
197 
200 
203 
206 
208  typedef std::vector<MSLane*> LaneVector;
209 
211  typedef std::vector<LaneVector> LaneVectorVector;
212 
214  typedef std::vector<MSE2Collector*> DetectorVector;
215 
217  typedef std::vector<DetectorVector> DetectorVectorVector;
218 
220  typedef std::vector<SUMOReal> LengthVector;
221 
222 
227 
228 
233 
234 
239 
240 
242  std::string myID;
243 
245  std::string myStartLaneID;
246 
248  typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
249 
252 
255 
256 
257 private:
260 
263 
264 
265 };
266 
267 
268 #endif
269 
270 /****************************************************************************/
271