SUMO - Simulation of Urban MObility
HelpersPHEMlight.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-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 // Helper methods for PHEMlight-based emission computation
19 /****************************************************************************/
20 #ifndef HelpersPHEMlight_h
21 #define HelpersPHEMlight_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 #define INTERNAL_PHEM
34 
35 #include <vector>
36 #include <limits>
37 #include <cmath>
38 #ifdef INTERNAL_PHEM
39 #include "PHEMCEPHandler.h"
40 #endif
44 #include <utils/common/StdDefs.h>
45 #include "PollutantsInterface.h"
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
56 public:
57  static const int PHEMLIGHT_BASE = 2 << 16;
58 
59 
63 
64 
69  SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
70 
71 
80  SUMOEmissionClass getClass(const SUMOEmissionClass base, const std::string& vClass, const std::string& fuel, const std::string& eClass, const double weight) const;
81 
86  std::string getAmitranVehicleClass(const SUMOEmissionClass c) const;
87 
92  std::string getFuel(const SUMOEmissionClass c) const;
93 
98  int getEuroClass(const SUMOEmissionClass c) const;
99 
105  double getWeight(const SUMOEmissionClass c) const;
106 
114  double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map<int, double>* param) const;
115 
123  double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope) const;
124 
125 private:
133  double getEmission(const PHEMCEP* oldCep, PHEMlightdll::CEP* currCep, const std::string& e, const double p, const double v) const;
134 
136  int myIndex;
139  std::map<SUMOEmissionClass, PHEMlightdll::CEP*> myCEPs;
140 };
141 
142 
143 #endif
144 
145 /****************************************************************************/
146 
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:58
double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope) const
Returns the adapted acceleration value, useful for comparing with external PHEMlight references...
double getWeight(const SUMOEmissionClass c) const
Returns a reference weight in kg described by this emission class as described in the Amitran interfa...
double getEmission(const PHEMCEP *oldCep, PHEMlightdll::CEP *currCep, const std::string &e, const double p, const double v) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
int myIndex
the index of the next class
HelpersPHEMlight()
Constructor.
EmissionType
Enumerating all emission types, including fuel.
std::string getFuel(const SUMOEmissionClass c) const
Returns the fuel type described by this emission class as described in the Amitran interface (Gasolin...
Helper methods for PHEMlight-based emission computation.
std::map< SUMOEmissionClass, PHEMlightdll::CEP * > myCEPs
abstract superclass for the model helpers
int SUMOEmissionClass
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
static const int PHEMLIGHT_BASE
SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc)
Checks whether the string describes a known vehicle class.
int getEuroClass(const SUMOEmissionClass c) const
Returns the Euro emission class described by this emission class as described in the Amitran interfac...
PHEMlightdll::Helpers myHelper
PHEMlightdll::CEPHandler myCEPHandler
std::string getAmitranVehicleClass(const SUMOEmissionClass c) const
Returns the vehicle class described by this emission class as described in the Amitran interface (Pas...
SUMOEmissionClass getClass(const SUMOEmissionClass base, const std::string &vClass, const std::string &fuel, const std::string &eClass, const double weight) const
Returns the emission class described by the given parameters.