SUMO - Simulation of Urban MObility
MS_E2_ZS_CollectorOverLanes.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A detector which joins E2Collectors over consecutive lanes (backward)
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef MS_E2_ZS_CollectorOverLanes_h
00022 #define MS_E2_ZS_CollectorOverLanes_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <microsim/output/MSDetectorFileOutput.h>
00035 #include <utils/common/UtilExceptions.h>
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class MSLane;
00042 class SUMOVehicle;
00043 class OutputDevice;
00044 class MSE2Collector;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00064 class MS_E2_ZS_CollectorOverLanes :
00065     public MSDetectorFileOutput {
00066 public:
00068     typedef std::vector< MSE2Collector* > CollectorCont;
00069 
00082     MS_E2_ZS_CollectorOverLanes(const std::string& id,
00083                                 DetectorUsage usage, MSLane* lane, SUMOReal startPos,
00084                                 SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
00085                                 SUMOReal jamDistThreshold) ;
00086 
00087 
00096     void init(MSLane* lane, SUMOReal detLength) ;
00097 
00098 
00100     virtual ~MS_E2_ZS_CollectorOverLanes() ;
00101 
00102 
00106     const std::string& getID() const ;
00107 
00108 
00113     const std::string& getStartLaneID() const ;
00114 
00115 
00116 
00119 
00128     void writeXMLOutput(OutputDevice& dev,
00129                         SUMOTime startTime, SUMOTime stopTime);
00130 
00131 
00139     void writeXMLDetectorProlog(OutputDevice& dev) const;
00141 
00142 
00143 
00147     SUMOReal getLength() const  {
00148         return myLength;
00149     }
00150 
00151 protected:
00158     void extendTo(SUMOReal length) ;
00159 
00160 
00168     std::string  makeID(const std::string& baseID,
00169                         size_t c, size_t r) const ;
00170 
00171 
00180     virtual MSE2Collector* buildCollector(size_t c, size_t r,
00181                                           MSLane* l, SUMOReal start, SUMOReal end) ;
00182 
00183 
00189     std::vector<MSLane*> getLanePredeccessorLanes(MSLane* l) ;
00190 
00191 protected:
00193     SUMOReal startPosM;
00194 
00196     SUMOReal myLength;
00197 
00199     SUMOTime haltingTimeThresholdM;
00200 
00202     SUMOReal haltingSpeedThresholdM;
00203 
00205     SUMOReal jamDistThresholdM;
00206 
00208     typedef std::vector<MSLane*> LaneVector;
00209 
00211     typedef std::vector<LaneVector> LaneVectorVector;
00212 
00214     typedef std::vector<MSE2Collector*> DetectorVector;
00215 
00217     typedef std::vector<DetectorVector> DetectorVectorVector;
00218 
00220     typedef std::vector<SUMOReal> LengthVector;
00221 
00222 
00226     LaneVectorVector myLaneCombinations;
00227 
00228 
00232     DetectorVectorVector myDetectorCombinations;
00233 
00234 
00238     LengthVector myLengths;
00239 
00240 
00242     std::string myID;
00243 
00245     std::string myStartLaneID;
00246 
00248     typedef std::map<MSLane*, MSE2Collector*> LaneDetMap;
00249 
00251     LaneDetMap myAlreadyBuild;
00252 
00254     DetectorUsage myUsage;
00255 
00256 
00257 private:
00259     MS_E2_ZS_CollectorOverLanes(const MS_E2_ZS_CollectorOverLanes&);
00260 
00262     MS_E2_ZS_CollectorOverLanes& operator=(const MS_E2_ZS_CollectorOverLanes&);
00263 
00264 
00265 };
00266 
00267 
00268 #endif
00269 
00270 /****************************************************************************/
00271 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines