Eclipse 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-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 // Helper methods for PHEMlight-based emission computation
17 /****************************************************************************/
18 #ifndef HelpersPHEMlight_h
19 #define HelpersPHEMlight_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #define INTERNAL_PHEM
28 
29 #include <vector>
30 #include <limits>
31 #include <cmath>
32 #ifdef INTERNAL_PHEM
33 #include "PHEMCEPHandler.h"
34 #endif
38 #include <utils/common/StdDefs.h>
39 #include "PollutantsInterface.h"
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 public:
51  static const int PHEMLIGHT_BASE = 2 << 16;
52 
53 
57 
58 
63  SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
64 
65 
74  SUMOEmissionClass getClass(const SUMOEmissionClass base, const std::string& vClass, const std::string& fuel, const std::string& eClass, const double weight) const;
75 
80  std::string getAmitranVehicleClass(const SUMOEmissionClass c) const;
81 
86  std::string getFuel(const SUMOEmissionClass c) const;
87 
92  int getEuroClass(const SUMOEmissionClass c) const;
93 
99  double getWeight(const SUMOEmissionClass c) const;
100 
108  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;
109 
117  double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope) const;
118 
119 private:
127  double getEmission(const PHEMCEP* oldCep, PHEMlightdll::CEP* currCep, const std::string& e, const double p, const double v) const;
128 
130  int myIndex;
133  std::map<SUMOEmissionClass, PHEMlightdll::CEP*> myCEPs;
134 };
135 
136 
137 #endif
138 
139 /****************************************************************************/
140 
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
HelpersPHEMlight::getAmitranVehicleClass
std::string getAmitranVehicleClass(const SUMOEmissionClass c) const
Returns the vehicle class described by this emission class as described in the Amitran interface (Pas...
Definition: HelpersPHEMlight.cpp:158
PHEMCEPHandler.h
PHEMCEP
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:52
PollutantsInterface::EmissionType
EmissionType
Enumerating all emission types, including fuel.
Definition: PollutantsInterface.h:56
HelpersPHEMlight::getFuel
std::string getFuel(const SUMOEmissionClass c) const
Returns the fuel type described by this emission class as described in the Amitran interface (Gasolin...
Definition: HelpersPHEMlight.cpp:180
HelpersPHEMlight::myHelper
PHEMlightdll::Helpers myHelper
Definition: HelpersPHEMlight.h:132
PollutantsInterface::Helper
abstract superclass for the model helpers
Definition: PollutantsInterface.h:103
HelpersPHEMlight::myIndex
int myIndex
the index of the next class
Definition: HelpersPHEMlight.h:130
SUMOEmissionClass
int SUMOEmissionClass
Definition: SUMOVehicleClass.h:232
PHEMlightdll::CEPHandler
Definition: CEPHandler.h:36
HelpersPHEMlight
Helper methods for PHEMlight-based emission computation.
Definition: HelpersPHEMlight.h:49
HelpersPHEMlight::getClassByName
SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc)
Checks whether the string describes a known vehicle class.
Definition: HelpersPHEMlight.cpp:48
Helpers.h
HelpersPHEMlight::HelpersPHEMlight
HelpersPHEMlight()
Constructor.
Definition: HelpersPHEMlight.cpp:42
PollutantsInterface.h
HelpersPHEMlight::compute
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...
Definition: HelpersPHEMlight.cpp:256
HelpersPHEMlight::myCEPHandler
PHEMlightdll::CEPHandler myCEPHandler
Definition: HelpersPHEMlight.h:131
HelpersPHEMlight::getModifiedAccel
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.
Definition: HelpersPHEMlight.cpp:246
HelpersPHEMlight::getClass
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.
Definition: HelpersPHEMlight.cpp:95
HelpersPHEMlight::myCEPs
std::map< SUMOEmissionClass, PHEMlightdll::CEP * > myCEPs
Definition: HelpersPHEMlight.h:133
PHEMlightdll::Helpers
Definition: Helpers.h:29
HelpersPHEMlight::getWeight
double getWeight(const SUMOEmissionClass c) const
Returns a reference weight in kg described by this emission class as described in the Amitran interfa...
Definition: HelpersPHEMlight.cpp:214
CEPHandler.h
config.h
HelpersPHEMlight::getEuroClass
int getEuroClass(const SUMOEmissionClass c) const
Returns the Euro emission class described by this emission class as described in the Amitran interfac...
Definition: HelpersPHEMlight.cpp:194
HelpersPHEMlight::getEmission
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...
Definition: HelpersPHEMlight.cpp:237
StdDefs.h
PHEMlightdll::CEP
Definition: CEP.h:37
CEP.h
HelpersPHEMlight::PHEMLIGHT_BASE
static const int PHEMLIGHT_BASE
Definition: HelpersPHEMlight.h:51