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-sim.org/
11 // Copyright (C) 2001-2013 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 
220 
221 
226 
227 
232 
233 
235  std::string myStartLaneID;
236 
238  typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
239 
242 
245 
246 
247 private:
250 
253 
254 
255 };
256 
257 
258 #endif
259 
260 /****************************************************************************/
261