SUMO - Simulation of Urban MObility
MSMeanData_Harmonoise.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Noise data collector for edges/lanes
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 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 MSMeanData_Harmonoise_h
22 #define MSMeanData_Harmonoise_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 
34 #include <vector>
35 #include <limits>
36 #include "MSMeanData.h"
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class OutputDevice;
43 class MSLane;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
61 public:
70  public:
72  MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd,
73  const std::set<std::string>* const vTypes = 0,
74  const MSMeanData_Harmonoise* parent = 0);
75 
77  virtual ~MSLaneMeanDataValues();
78 
79 
82  void reset(bool afterWrite = false);
83 
86  void addTo(MSMeanData::MeanDataValues& val) const;
87 
88 
91 
106 
107 
113  void update();
114 
123  void write(OutputDevice& dev, const SUMOTime period,
124  const SUMOReal numLanes, const SUMOReal defaultTravelTime,
125  const int numVehicles = -1) const;
126 
127 
128  protected:
139  void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane,
140  SUMOReal speed);
141 
142  private:
145 
148 
152 
153 
156  };
157 
158 
159 public:
174  MSMeanData_Harmonoise(const std::string& id,
175  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
176  const bool useLanes, const bool withEmpty,
177  const bool printDefaults, const bool withInternal,
178  const bool trackVehicles,
179  const SUMOReal minSamples, const SUMOReal maxTravelTime,
180  const std::set<std::string> vTypes);
181 
182 
184  virtual ~MSMeanData_Harmonoise();
185 
188  virtual void detectorUpdate(const SUMOTime step);
189 
190 
191 protected:
197  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
198 
199 private:
202 
205 
206 };
207 
208 
209 #endif
210 
211 /****************************************************************************/
212 
const MSMeanData_Harmonoise * myParent
The meandata parent.
Data collector for edges/lanes.
Definition: MSMeanData.h:66
void write(OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
MSMeanData_Harmonoise(const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal minSamples, const SUMOReal maxTravelTime, const std::set< std::string > vTypes)
Constructor.
SUMOReal currentTimeN
Sum of produced noise at this time step(pow(10, (/10.)))
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
SUMOReal meanNTemp
Sum of produced noise over time (pow(10, (/10.)))
Notification
Definition of a vehicle state.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes current emission values and adds them to their sums.
MSMeanData_Harmonoise & operator=(const MSMeanData_Harmonoise &)
Invalidated assignment operator.
virtual ~MSMeanData_Harmonoise()
Destructor.
Noise data collector for edges/lanes.
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const std::set< std::string > *const vTypes=0, const MSMeanData_Harmonoise *parent=0)
Constructor.
void update()
Computes the noise in the last time step.
Representation of a vehicle.
Definition: SUMOVehicle.h:64
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:75
Data structure for mean (aggregated) edge/lane values.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:215
Representation of a lane in the micro simulation.
Definition: MSLane.h:77