Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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// ===========================================================================
34class OutputDevice;
35class MSLane;
36
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
54public:
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
121public:
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
153protected:
159 MSMeanData::MeanDataValues* createValues(MSLane* const lane, const double length, const bool doAdd) const;
160
161
162
163private:
166
169
170};
long long int SUMOTime
Definition GUI.h:36
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.
bool notifyIdle(SUMOTrafficObject &veh)
Computes idling emission values and adds them to the aggregate emission sums.
PollutantsInterface::Emissions myEmissions
Collected values.
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.
virtual ~MSMeanData_Emissions()
Destructor.
MSMeanData_Emissions & operator=(const MSMeanData_Emissions &)
Invalidated assignment operator.
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.
Representation of a vehicle, person, or container.
Storage for collected values of all emission types.