MS_E2_ZS_CollectorOverLanes.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A detector which joins E2Collectors over consecutive lanes (backward)
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef MS_E2_ZS_CollectorOverLanes_h
00020 #define MS_E2_ZS_CollectorOverLanes_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <utils/common/PhysicalTypeDefs.h>
00033 #include "MSE2Collector.h"
00034 #include <utils/iodevices/OutputDevice.h>
00035 
00036 
00037 // ===========================================================================
00038 // class definitions
00039 // ===========================================================================
00054 class MS_E2_ZS_CollectorOverLanes :
00055             public MSDetectorFileOutput {
00056 public:
00058     typedef std::vector< MSE2Collector* > CollectorCont;
00059 
00072     MS_E2_ZS_CollectorOverLanes(const std::string &id,
00073                                 DetectorUsage usage, MSLane* lane, SUMOReal startPos,
00074                                 SUMOTime haltingTimeThreshold, MetersPerSecond haltingSpeedThreshold,
00075                                 SUMOReal jamDistThreshold) throw();
00076 
00077 
00086     void init(MSLane *lane, SUMOReal detLength) throw();
00087 
00088 
00090     virtual ~MS_E2_ZS_CollectorOverLanes() throw();
00091 
00092 
00097     const std::string &getID() const throw();
00098 
00099 
00105     const std::string &getStartLaneID() const throw();
00106 
00107 
00108 
00111 
00120     void writeXMLOutput(OutputDevice &dev,
00121                         SUMOTime startTime, SUMOTime stopTime) throw(IOError);
00122 
00123 
00131     void writeXMLDetectorProlog(OutputDevice &dev) const throw(IOError);
00133 
00134 
00135 
00140     SUMOReal getLength() const  throw() {
00141         return myLength;
00142     }
00143 
00144 protected:
00152     void extendTo(SUMOReal length) throw();
00153 
00154 
00162     std::string  makeID(const std::string &baseID,
00163                         size_t c, size_t r) const throw();
00164 
00165 
00174     virtual MSE2Collector *buildCollector(size_t c, size_t r,
00175                                           MSLane *l, SUMOReal start, SUMOReal end) throw();
00176 
00177 
00183     std::vector<MSLane*> getLanePredeccessorLanes(MSLane *l) throw();
00184 
00185 protected:
00187     SUMOReal startPosM;
00188 
00190     SUMOReal myLength;
00191 
00193     SUMOTime haltingTimeThresholdM;
00194 
00196     MetersPerSecond haltingSpeedThresholdM;
00197 
00199     SUMOReal jamDistThresholdM;
00200 
00202     typedef std::vector<MSLane*> LaneVector;
00203 
00205     typedef std::vector<LaneVector> LaneVectorVector;
00206 
00208     typedef std::vector<MSE2Collector*> DetectorVector;
00209 
00211     typedef std::vector<DetectorVector> DetectorVectorVector;
00212 
00214     typedef std::vector<SUMOReal> DoubleVector;
00215 
00217     typedef DoubleVector LengthVector;
00218 
00219 
00223     LaneVectorVector myLaneCombinations;
00224 
00225 
00229     DetectorVectorVector myDetectorCombinations;
00230 
00231 
00235     LengthVector myLengths;
00236 
00237 
00239     std::string myID;
00240 
00242     std::string myStartLaneID;
00243 
00245     typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
00246 
00248     LaneDetMap myAlreadyBuild;
00249 
00251     DetectorUsage myUsage;
00252 
00253 
00254 private:
00256     MS_E2_ZS_CollectorOverLanes(const MS_E2_ZS_CollectorOverLanes&);
00257 
00259     MS_E2_ZS_CollectorOverLanes& operator=(const MS_E2_ZS_CollectorOverLanes&);
00260 
00261 
00262 };
00263 
00264 
00265 #endif
00266 
00267 /****************************************************************************/
00268 

Generated on Wed May 5 00:06:30 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6