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-2016 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 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 SUMOReal numLanes, const SUMOReal defaultTravelTime,
105  const int numVehicles = -1) const;
106 
107 
108  protected:
112  void notifyMoveInternal(const SUMOVehicle& veh, const SUMOReal /* frontOnLane */, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane);
113 
114  private:
117 
120 
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 SUMOReal minSamples, const SUMOReal 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 SUMOReal 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
long long int SUMOTime
Definition: SUMOTime.h:43
SUMOReal currentTimeN
Sum of produced noise at this time step(pow(10, (<NOISE>/10.)))
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
SUMOReal meanNTemp
Sum of produced noise over time (pow(10, (<NOISE>/10.)))
virtual ~MSMeanData_Harmonoise()
Destructor.
Noise data collector for edges/lanes.
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:76
Data structure for mean (aggregated) edge/lane values.
void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
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.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
MSMoveReminder & operator=(const MSMoveReminder &)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const MSMeanData_Harmonoise *parent)
Constructor.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
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::string &vTypes)
Constructor.