Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSMeanData_Harmonoise.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// Noise data collector for edges/lanes
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include <vector>
25#include <limits>
26#include "MSMeanData.h"
27
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32class OutputDevice;
33class MSLane;
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
51public:
60 public:
62 MSLaneMeanDataValues(MSLane* const lane, const double length, const bool doAdd,
63 const MSMeanData_Harmonoise* parent);
64
66 virtual ~MSLaneMeanDataValues();
67
68
71 void reset(bool afterWrite = false);
72
75 void addTo(MSMeanData::MeanDataValues& val) const;
76
77
83 void update();
84
93 void write(OutputDevice& dev, const SumoXMLAttrMask& attributeMask, const SUMOTime period,
94 const int numLanes, const double speedLimit, const double defaultTravelTime,
95 const int numVehicles = -1) const;
96
97
98 protected:
102 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 */);
103
104 private:
107
110
112 double meanNTemp;
114
115
118 };
119
120
121public:
135 MSMeanData_Harmonoise(const std::string& id,
136 const SUMOTime dumpBegin, const SUMOTime dumpEnd,
137 const bool useLanes, const std::string& excludeEmpty, const bool withInternal,
138 const bool trackVehicles,
139 const double minSamples, const double maxTravelTime,
140 const std::string& vTypes,
141 const std::string& writeAttributes,
142 const std::vector<MSEdge*>& edges,
143 AggregateType aggregate);
144
145
147 virtual ~MSMeanData_Harmonoise();
148
151 virtual void detectorUpdate(const SUMOTime step);
152
153
154protected:
160 MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
161
162private:
165
168
169};
long long int SUMOTime
Definition GUI.h:36
std::bitset< 96 > SumoXMLAttrMask
AggregateType
Numbers representing special SUMO-XML-attribute values Information on edgeData/laneData output should...
virtual void reset()
Resets collected values.
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Data structure for mean (aggregated) edge/lane values.
Definition MSMeanData.h:66
Data structure for mean (aggregated) edge/lane values.
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.
double currentTimeN
Sum of produced noise at this time step(pow(10, (<NOISE>/10.)))
double meanNTemp
Sum of produced noise over time (pow(10, (<NOISE>/10.)))
void update()
Computes the noise in the last time step.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
void write(OutputDevice &dev, const SumoXMLAttrMask &attributeMask, const SUMOTime period, const int numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
const MSMeanData_Harmonoise * myParent
The meandata parent.
Noise data collector for edges/lanes.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
MSMeanData_Harmonoise(const MSMeanData_Harmonoise &)
Invalidated copy constructor.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
MSMeanData_Harmonoise & operator=(const MSMeanData_Harmonoise &)
Invalidated assignment operator.
virtual ~MSMeanData_Harmonoise()
Destructor.
Data collector for edges/lanes.
Definition MSMeanData.h:57
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle, person, or container.