SUMO - Simulation of Urban MObility
MSMeanData_Harmonoise.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // Noise data collector for edges/lanes
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 MSMeanData_Harmonoise_h
00022 #define MSMeanData_Harmonoise_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 <vector>
00035 #include <cassert>
00036 #include <limits>
00037 #include "MSMeanData.h"
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class OutputDevice;
00044 class MSLane;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00061 class MSMeanData_Harmonoise : public MSMeanData {
00062 public:
00070     class MSLaneMeanDataValues : public MSMeanData::MeanDataValues {
00071     public:
00073         MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd,
00074                              const std::set<std::string>* const vTypes = 0,
00075                              const MSMeanData_Harmonoise* parent = 0) ;
00076 
00078         virtual ~MSLaneMeanDataValues() ;
00079 
00080 
00083         void reset(bool afterWrite = false) ;
00084 
00087         void addTo(MSMeanData::MeanDataValues& val) const ;
00088 
00089 
00092 
00105         bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ;
00107 
00108 
00114         void update() ;
00115 
00124         void write(OutputDevice& dev, const SUMOTime period,
00125                    const SUMOReal numLanes, const SUMOReal defaultTravelTime,
00126                    const int numVehicles = -1) const;
00127 
00128 
00129     protected:
00140         void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane,
00141                                 SUMOReal speed) ;
00142 
00143     private:
00146 
00148         SUMOReal currentTimeN;
00149 
00151         SUMOReal meanNTemp;
00153 
00154 
00156         const MSMeanData_Harmonoise* myParent;
00157     };
00158 
00159 
00160 public:
00175     MSMeanData_Harmonoise(const std::string& id,
00176                           const SUMOTime dumpBegin, const SUMOTime dumpEnd,
00177                           const bool useLanes, const bool withEmpty,
00178                           const bool printDefaults, const bool withInternal,
00179                           const bool trackVehicles,
00180                           const SUMOReal minSamples, const SUMOReal maxTravelTime,
00181                           const std::set<std::string> vTypes) ;
00182 
00183 
00185     virtual ~MSMeanData_Harmonoise() ;
00186 
00189     virtual void detectorUpdate(const SUMOTime step) ;
00190 
00191 
00192 protected:
00198     MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
00199 
00200 private:
00202     MSMeanData_Harmonoise(const MSMeanData_Harmonoise&);
00203 
00205     MSMeanData_Harmonoise& operator=(const MSMeanData_Harmonoise&);
00206 
00207 };
00208 
00209 
00210 #endif
00211 
00212 /****************************************************************************/
00213 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines