SUMO - Simulation of Urban MObility
MSMeanData_Harmonoise.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Noise data collector for edges/lanes
19 /****************************************************************************/
20 #ifndef MSMeanData_Harmonoise_h
21 #define MSMeanData_Harmonoise_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <vector>
34 #include <limits>
35 #include "MSMeanData.h"
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class OutputDevice;
42 class MSLane;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
60 public:
69  public:
71  MSLaneMeanDataValues(MSLane* const lane, const double length, const bool doAdd,
72  const MSMeanData_Harmonoise* parent);
73 
75  virtual ~MSLaneMeanDataValues();
76 
77 
80  void reset(bool afterWrite = false);
81 
84  void addTo(MSMeanData::MeanDataValues& val) const;
85 
86 
92  void update();
93 
102  void write(OutputDevice& dev, const SUMOTime period,
103  const double numLanes, const double defaultTravelTime,
104  const int numVehicles = -1) const;
105 
106 
107  protected:
111  void notifyMoveInternal(const SUMOVehicle& veh, const double /* frontOnLane */, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double /* meanLengthOnLane */);
112 
113  private:
116 
118  double currentTimeN;
119 
121  double meanNTemp;
123 
124 
127  };
128 
129 
130 public:
145  MSMeanData_Harmonoise(const std::string& id,
146  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
147  const bool useLanes, const bool withEmpty,
148  const bool printDefaults, const bool withInternal,
149  const bool trackVehicles,
150  const double minSamples, const double maxTravelTime,
151  const std::string& vTypes);
152 
153 
155  virtual ~MSMeanData_Harmonoise();
156 
159  virtual void detectorUpdate(const SUMOTime step);
160 
161 
162 protected:
168  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
169 
170 private:
173 
176 
177 };
178 
179 
180 #endif
181 
182 /****************************************************************************/
183 
const MSMeanData_Harmonoise * myParent
The meandata parent.
Data collector for edges/lanes.
Definition: MSMeanData.h:66
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
void write(OutputDevice &dev, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
virtual ~MSMeanData_Harmonoise()
Destructor.
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 double minSamples, const double maxTravelTime, const std::string &vTypes)
Constructor.
Noise data collector for edges/lanes.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Harmonoise *parent)
Constructor.
void update()
Computes the noise in the last time step.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:75
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
Data structure for mean (aggregated) edge/lane values.
void notifyMoveInternal(const SUMOVehicle &veh, const double, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
double meanNTemp
Sum of produced noise over time (pow(10, (<NOISE>/10.)))
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
double currentTimeN
Sum of produced noise at this time step(pow(10, (<NOISE>/10.)))
MSMoveReminder & operator=(const MSMoveReminder &)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
long long int SUMOTime
Definition: TraCIDefs.h:51
Representation of a lane in the micro simulation.
Definition: MSLane.h:77