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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // A device which collects vehicular emissions
19 /****************************************************************************/
20 #ifndef MSDevice_Emissions_h
21 #define MSDevice_Emissions_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <set>
34 #include <vector>
35 #include <map>
36 #include <utils/common/SUMOTime.h>
39 #include <microsim/MSVehicle.h>
40 #include "MSDevice.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class MSLane;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
64 class MSDevice_Emissions : public MSDevice {
65 public:
68  static void insertOptions();
69 
70 
83  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
84 
85 
86 public:
89 
104  bool notifyMove(SUMOVehicle& veh, double oldPos, double newPos, double newSpeed);
106 
108  const std::string deviceName() const {
109  return "emissions";
110  }
111 
118  void generateOutput() const;
119 
120 
123 
124 
125 private:
131  MSDevice_Emissions(SUMOVehicle& holder, const std::string& id);
132 
133 
134 private:
137 
138 
139 private:
142 
145 
146 
147 };
148 
149 
150 #endif
151 
152 /****************************************************************************/
153 
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into)
Build devices for the given vehicle, if needed.
MSDevice_Emissions(SUMOVehicle &holder, const std::string &id)
Constructor.
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Computes current emission values and adds them to their sums.
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.
~MSDevice_Emissions()
Destructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
Abstract in-vehicle device.
Definition: MSDevice.h:70
static void insertOptions()
Inserts MSDevice_Emissions-options.
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:77