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 /****************************************************************************/
16 // A device which collects vehicular emissions
17 /****************************************************************************/
18 #ifndef MSDevice_Emissions_h
19 #define MSDevice_Emissions_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <set>
28 #include <vector>
29 #include <map>
30 #include <utils/common/SUMOTime.h>
33 #include <microsim/MSVehicle.h>
34 #include "MSVehicleDevice.h"
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class MSLane;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
59 public:
62  static void insertOptions();
63 
64 
77  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
78 
79 
80 public:
83 
98  bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed);
100 
102  const std::string deviceName() const {
103  return "emissions";
104  }
105 
112  void generateOutput() const;
113 
114 
117 
118 
119 private:
125  MSDevice_Emissions(SUMOVehicle& holder, const std::string& id);
126 
127 
128 private:
131 
132 
133 private:
136 
139 
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
MSDevice_Emissions(SUMOVehicle &holder, const std::string &id)
Constructor.
MSDevice_Emissions & operator=(const MSDevice_Emissions &)
Invalidated assignment operator.
PollutantsInterface::Emissions myEmissions
Internal storages for pollutant/fuel sum in mg or ml.
void generateOutput() const
Called on writing tripinfo output.
Storage for collected values of all emission types.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Computes current emission values and adds them to their sums.
~MSDevice_Emissions()
Destructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:61
Representation of a vehicle or person.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice *> &into)
Build devices for the given vehicle, if needed.
static void insertOptions()
Inserts MSDevice_Emissions-options.
Abstract in-vehicle device.
const std::string deviceName() const
return the name for this type of device
A device which collects vehicular emissions.
Representation of a lane in the micro simulation.
Definition: MSLane.h:83