Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Noise data collector for edges/lanes
17 /****************************************************************************/
18 #ifndef MSMeanData_Harmonoise_h
19 #define MSMeanData_Harmonoise_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
28 #include <limits>
29 #include "MSMeanData.h"
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class OutputDevice;
36 class MSLane;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
54 public:
63  public:
65  MSLaneMeanDataValues(MSLane* const lane, const double length, const bool doAdd,
66  const MSMeanData_Harmonoise* parent);
67 
69  virtual ~MSLaneMeanDataValues();
70 
71 
74  void reset(bool afterWrite = false);
75 
78  void addTo(MSMeanData::MeanDataValues& val) const;
79 
80 
86  void update();
87 
96  void write(OutputDevice& dev, const SUMOTime period,
97  const double numLanes, const double defaultTravelTime,
98  const int numVehicles = -1) const;
99 
100 
101  protected:
105  void notifyMoveInternal(const SUMOTrafficObject& veh, const double /* frontOnLane */, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double /* meanLengthOnLane */);
106 
107  private:
110 
112  double currentTimeN;
113 
115  double meanNTemp;
117 
118 
121  };
122 
123 
124 public:
139  MSMeanData_Harmonoise(const std::string& id,
140  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
141  const bool useLanes, const bool withEmpty,
142  const bool printDefaults, const bool withInternal,
143  const bool trackVehicles,
144  const double minSamples, const double maxTravelTime,
145  const std::string& vTypes);
146 
147 
149  virtual ~MSMeanData_Harmonoise();
150 
153  virtual void detectorUpdate(const SUMOTime step);
154 
155 
156 protected:
162  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
163 
164 private:
167 
170 
171 };
172 
173 
174 #endif
175 
176 /****************************************************************************/
177 
const MSMeanData_Harmonoise * myParent
The meandata parent.
Data collector for edges/lanes.
Definition: MSMeanData.h:60
long long int SUMOTime
Definition: SUMOTime.h:35
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
void notifyMoveInternal(const SUMOTrafficObject &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.
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.
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:69
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.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
Representation of a vehicle or person.
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:64
Representation of a lane in the micro simulation.
Definition: MSLane.h:83