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.dlr.de/
11 // Copyright (C) 2001-2017 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 double length, const bool doAdd,
73  const MSMeanData_Harmonoise* parent);
74 
76  virtual ~MSLaneMeanDataValues();
77 
78 
81  void reset(bool afterWrite = false);
82 
85  void addTo(MSMeanData::MeanDataValues& val) const;
86 
87 
93  void update();
94 
103  void write(OutputDevice& dev, const SUMOTime period,
104  const double numLanes, const double defaultTravelTime,
105  const int numVehicles = -1) const;
106 
107 
108  protected:
112  void notifyMoveInternal(const SUMOVehicle& veh, const double /* frontOnLane */, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane);
113 
114  private:
117 
119  double currentTimeN;
120 
122  double meanNTemp;
124 
125 
128  };
129 
130 
131 public:
146  MSMeanData_Harmonoise(const std::string& id,
147  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
148  const bool useLanes, const bool withEmpty,
149  const bool printDefaults, const bool withInternal,
150  const bool trackVehicles,
151  const double minSamples, const double maxTravelTime,
152  const std::string& vTypes);
153 
154 
156  virtual ~MSMeanData_Harmonoise();
157 
160  virtual void detectorUpdate(const SUMOTime step);
161 
162 
163 protected:
169  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
170 
171 private:
174 
177 
178 };
179 
180 
181 #endif
182 
183 /****************************************************************************/
184 
const MSMeanData_Harmonoise * myParent
The meandata parent.
Data collector for edges/lanes.
Definition: MSMeanData.h:67
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:67
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:76
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.
void notifyMoveInternal(const SUMOVehicle &veh, const double, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
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:71
long long int SUMOTime
Definition: TraCIDefs.h:52
Representation of a lane in the micro simulation.
Definition: MSLane.h:79