Eclipse SUMO - Simulation of Urban MObility
MSDevice_Emissions.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A device which collects vehicular emissions
16 /****************************************************************************/
17 #ifndef MSDevice_Emissions_h
18 #define MSDevice_Emissions_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <set>
27 #include <vector>
28 #include <map>
29 #include <utils/common/SUMOTime.h>
32 #include <microsim/MSVehicle.h>
33 #include "MSVehicleDevice.h"
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSLane;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
58 public:
61  static void insertOptions();
62 
63 
76  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
77 
78 
79 public:
82 
97  bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed);
99 
101  const std::string deviceName() const {
102  return "emissions";
103  }
104 
111  void generateOutput() const;
112 
113 
116 
117 protected:
121  void notifyMoveInternal(const SUMOTrafficObject& veh,
122  const double frontOnLane,
123  const double timeOnLane,
124  const double meanSpeedFrontOnLane,
125  const double meanSpeedVehicleOnLane,
126  const double travelledDistanceFrontOnLane,
127  const double travelledDistanceVehicleOnLane,
128  const double meanLengthOnLane);
129 
130 private:
136  MSDevice_Emissions(SUMOVehicle& holder, const std::string& id);
137 
138 
139 private:
142 
143 
144 private:
147 
150 
151 
152 };
153 
154 
155 #endif
156 
157 /****************************************************************************/
158 
MSDevice_Emissions::insertOptions
static void insertOptions()
Inserts MSDevice_Emissions-options.
Definition: MSDevice_Emissions.cpp:40
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSVehicleDevice.h
MSDevice_Emissions::~MSDevice_Emissions
~MSDevice_Emissions()
Destructor.
Definition: MSDevice_Emissions.cpp:63
WrappingCommand.h
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSDevice_Emissions::notifyMove
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Computes current emission values and adds them to their sums.
Definition: MSDevice_Emissions.cpp:68
MSDevice_Emissions::MSDevice_Emissions
MSDevice_Emissions(SUMOVehicle &holder, const std::string &id)
Constructor.
Definition: MSDevice_Emissions.cpp:58
MSVehicle.h
PollutantsInterface.h
MSDevice_Emissions::deviceName
const std::string deviceName() const
return the name for this type of device
Definition: MSDevice_Emissions.h:101
PollutantsInterface::Emissions
Storage for collected values of all emission types.
Definition: PollutantsInterface.h:61
MSDevice_Emissions::notifyMoveInternal
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)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal()
Definition: MSDevice_Emissions.cpp:79
MSDevice_Emissions
A device which collects vehicular emissions.
Definition: MSDevice_Emissions.h:57
config.h
MSDevice_Emissions::buildVehicleDevices
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSDevice_Emissions.cpp:46
MSDevice_Emissions::operator=
MSDevice_Emissions & operator=(const MSDevice_Emissions &)
Invalidated assignment operator.
MSDevice_Emissions::myEmissions
PollutantsInterface::Emissions myEmissions
Internal storages for pollutant/fuel sum in mg or ml.
Definition: MSDevice_Emissions.h:141
MSDevice_Emissions::generateOutput
void generateOutput() const
Called on writing tripinfo output.
Definition: MSDevice_Emissions.cpp:98
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:54