|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Noise data collector for edges/lanes 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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 MSMeanData_Harmonoise_h 00020 #define MSMeanData_Harmonoise_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 <vector> 00033 #include <cassert> 00034 #include <limits> 00035 #include "MSMeanData.h" 00036 00037 00038 // =========================================================================== 00039 // class declarations 00040 // =========================================================================== 00041 class OutputDevice; 00042 class MSLane; 00043 00044 00045 // =========================================================================== 00046 // class definitions 00047 // =========================================================================== 00059 class MSMeanData_Harmonoise : public MSMeanData { 00060 public: 00068 class MSLaneMeanDataValues : public MSMeanData::MeanDataValues { 00069 public: 00071 MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd, 00072 const std::set<std::string>* const vTypes=0, 00073 const MSMeanData_Harmonoise* parent=0) throw(); 00074 00076 virtual ~MSLaneMeanDataValues() throw(); 00077 00078 00081 void reset(bool afterWrite=false) throw(); 00082 00085 void addTo(MSMeanData::MeanDataValues& val) const throw(); 00086 00087 00090 00103 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) throw(); 00105 00106 00112 void update() throw(); 00113 00122 void write(OutputDevice& dev, const SUMOTime period, 00123 const SUMOReal numLanes, 00124 const int numVehicles=-1) const throw(IOError); 00125 00126 00127 protected: 00138 void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, 00139 SUMOReal speed) throw(); 00140 00141 private: 00144 00146 SUMOReal currentTimeN; 00147 00149 SUMOReal meanNTemp; 00151 00152 00154 const MSMeanData_Harmonoise* myParent; 00155 }; 00156 00157 00158 public: 00172 MSMeanData_Harmonoise(const std::string& id, 00173 const SUMOTime dumpBegin, const SUMOTime dumpEnd, 00174 const bool useLanes, const bool withEmpty, const bool withInternal, 00175 const bool trackVehicles, 00176 const SUMOReal minSamples, const SUMOReal maxTravelTime, 00177 const std::set<std::string> vTypes) throw(); 00178 00179 00181 virtual ~MSMeanData_Harmonoise() throw(); 00182 00185 virtual void detectorUpdate(const SUMOTime step) throw(); 00186 00187 00188 protected: 00194 MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const throw(IOError); 00195 00196 private: 00198 MSMeanData_Harmonoise(const MSMeanData_Harmonoise&); 00199 00201 MSMeanData_Harmonoise& operator=(const MSMeanData_Harmonoise&); 00202 00203 }; 00204 00205 00206 #endif 00207 00208 /****************************************************************************/ 00209