SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSMeanData_Emissions.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Emission data collector for edges/lanes
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSMeanData_Emissions_h
22 #define MSMeanData_Emissions_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <set>
36 #include "MSMeanData.h"
37 #include <limits>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class OutputDevice;
44 class MSLane;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
63 public:
72  public:
74  MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd,
75  const std::set<std::string>* const vTypes = 0,
76  const MSMeanData_Emissions* parent = 0);
77 
79  virtual ~MSLaneMeanDataValues();
80 
81 
84  void reset(bool afterWrite = false);
85 
86 
91  void addTo(MSMeanData::MeanDataValues& val) const;
92 
93 
102  void write(OutputDevice& dev, const SUMOTime period,
103  const SUMOReal numLanes, const SUMOReal defaultTravelTime,
104  const int numVehicles = -1) const;
105 
106 
107  protected:
118  void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane,
119  SUMOReal speed);
120 
121 
122  private:
140 
141  };
142 
143 
144 public:
159  MSMeanData_Emissions(const std::string& id,
160  const SUMOTime dumpBegin, const SUMOTime dumpEnd,
161  const bool useLanes, const bool withEmpty,
162  const bool printDefaults, const bool withInternal,
163  const bool trackVehicles,
164  const SUMOReal minSamples, const SUMOReal maxTravelTime,
165  const std::set<std::string> vTypes);
166 
167 
169  virtual ~MSMeanData_Emissions();
170 
171 
172 
173 protected:
179  MSMeanData::MeanDataValues* createValues(MSLane* const lane, const SUMOReal length, const bool doAdd) const;
180 
181 
182 
183 private:
186 
189 
190 };
191 
192 
193 #endif
194 
195 /****************************************************************************/
196 
Data collector for edges/lanes.
Definition: MSMeanData.h:66
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 SUMOReal minSamples, const SUMOReal maxTravelTime, const std::set< std::string > vTypes)
Constructor.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
MSMeanData_Emissions & operator=(const MSMeanData_Emissions &)
Invalidated assignment operator.
SUMOReal CO
Sum of CO emissions in mg.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
Data structure for mean (aggregated) edge/lane values.
Definition: MSMeanData.h:75
SUMOReal fuel
Sum of consumed fuel in ml.
const MSMeanData_Emissions * myParent
The meandata parent.
SUMOReal NOx
Sum of NOx emissions in mg.
Emission data collector for edges/lanes.
SUMOReal HC
Sum of HC emissions in mg.
SUMOReal PMx
Sum of PMx emissions in mg.
void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
virtual ~MSMeanData_Emissions()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:215
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const std::set< std::string > *const vTypes=0, const MSMeanData_Emissions *parent=0)
Constructor.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
void write(OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
Data structure for mean (aggregated) edge/lane values.