Eclipse SUMO - Simulation of Urban MObility
MSMeanData_Emissions.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-2024 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 // Emission data collector for edges/lanes
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <vector>
25 #include <set>
26 #include <limits>
28 #include "MSMeanData.h"
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class OutputDevice;
35 class MSLane;
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
54 public:
63  public:
65  MSLaneMeanDataValues(MSLane* const lane, const double length, const bool doAdd,
66  const MSMeanData_Emissions* parent);
67 
69  virtual ~MSLaneMeanDataValues();
70 
71 
74  void reset(bool afterWrite = false);
75 
76 
81  void addTo(MSMeanData::MeanDataValues& val) const;
82 
83 
92  void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period,
93  const int numLanes, const double speedLimit, const double defaultTravelTime,
94  const int numVehicles = -1) const;
95 
96 
97  protected:
101  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 */);
102 
112  bool notifyIdle(SUMOTrafficObject& veh);
113 
114 
115  private:
118  };
119 
120 
121 public:
136  MSMeanData_Emissions(const std::string& id,
137  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
138  const bool useLanes, const bool withEmpty,
139  const bool printDefaults, const bool withInternal,
140  const bool trackVehicles,
141  const double minSamples, const double maxTravelTime,
142  const std::string& vTypes,
143  const std::string& writeAttributes,
144  const std::vector<MSEdge*>& edges,
145  bool aggregate);
146 
147 
149  virtual ~MSMeanData_Emissions();
150 
151 
152 
153 protected:
159  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
160 
161 
162 
163 private:
166 
169 
170 };
long long int SUMOTime
Definition: GUI.h:35
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.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Emissions *parent)
Constructor.
bool notifyIdle(SUMOTrafficObject &veh)
Computes idling emission values and adds them to the aggregate emission sums.
PollutantsInterface::Emissions myEmissions
Collected values.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
void write(OutputDevice &dev, long long int 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.
void notifyMoveInternal(const SUMOTrafficObject &veh, const double, const double timeOnLane, const double, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves.
Emission data collector for edges/lanes.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
MSMeanData_Emissions & operator=(const MSMeanData_Emissions &)
Invalidated assignment operator.
virtual ~MSMeanData_Emissions()
Destructor.
MSMeanData_Emissions(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, const std::string &writeAttributes, const std::vector< MSEdge * > &edges, bool aggregate)
Constructor.
MSMeanData_Emissions(const MSMeanData_Emissions &)
Invalidated copy constructor.
Data collector for edges/lanes.
Definition: MSMeanData.h:57
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
Representation of a vehicle, person, or container.
Storage for collected values of all emission types.