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 /****************************************************************************/
15 // Helper methods for PHEMlight-based emission computation
16 /****************************************************************************/
17 #ifndef HelpersPHEMlight_h
18 #define HelpersPHEMlight_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #define INTERNAL_PHEM
27 
28 #include <vector>
29 #include <limits>
30 #include <cmath>
31 #ifdef INTERNAL_PHEM
32 #include "PHEMCEPHandler.h"
33 #endif
37 #include <utils/common/StdDefs.h>
38 #include "PollutantsInterface.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
50  static const int PHEMLIGHT_BASE = 2 << 16;
51 
52 
56 
57 
62  SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
63 
64 
73  SUMOEmissionClass getClass(const SUMOEmissionClass base, const std::string& vClass, const std::string& fuel, const std::string& eClass, const double weight) const;
74 
79  std::string getAmitranVehicleClass(const SUMOEmissionClass c) const;
80 
85  std::string getFuel(const SUMOEmissionClass c) const;
86 
91  int getEuroClass(const SUMOEmissionClass c) const;
92 
98  double getWeight(const SUMOEmissionClass c) const;
99 
107  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;
108 
116  double getModifiedAccel(const SUMOEmissionClass c, const double v, const double a, const double slope) const;
117 
118 private:
126  double getEmission(const PHEMCEP* oldCep, PHEMlightdll::CEP* currCep, const std::string& e, const double p, const double v) const;
127 
129  int myIndex;
132  std::map<SUMOEmissionClass, PHEMlightdll::CEP*> myCEPs;
133 };
134 
135 
136 #endif
137 
138 /****************************************************************************/
139 
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
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:157
PHEMCEPHandler.h
PHEMCEP
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:51
PollutantsInterface::EmissionType
EmissionType
Enumerating all emission types, including fuel.
Definition: PollutantsInterface.h:55
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:179
HelpersPHEMlight::myHelper
PHEMlightdll::Helpers myHelper
Definition: HelpersPHEMlight.h:131
PollutantsInterface::Helper
abstract superclass for the model helpers
Definition: PollutantsInterface.h:102
HelpersPHEMlight::myIndex
int myIndex
the index of the next class
Definition: HelpersPHEMlight.h:129
SUMOEmissionClass
int SUMOEmissionClass
Definition: SUMOVehicleClass.h:231
PHEMlightdll::CEPHandler
Definition: CEPHandler.h:35
HelpersPHEMlight
Helper methods for PHEMlight-based emission computation.
Definition: HelpersPHEMlight.h:48
HelpersPHEMlight::getClassByName
SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc)
Checks whether the string describes a known vehicle class.
Definition: HelpersPHEMlight.cpp:47
Helpers.h
HelpersPHEMlight::HelpersPHEMlight
HelpersPHEMlight()
Constructor.
Definition: HelpersPHEMlight.cpp:41
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:255
HelpersPHEMlight::myCEPHandler
PHEMlightdll::CEPHandler myCEPHandler
Definition: HelpersPHEMlight.h:130
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:245
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:94
HelpersPHEMlight::myCEPs
std::map< SUMOEmissionClass, PHEMlightdll::CEP * > myCEPs
Definition: HelpersPHEMlight.h:132
PHEMlightdll::Helpers
Definition: Helpers.h:28
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:213
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:193
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:236
StdDefs.h
PHEMlightdll::CEP
Definition: CEP.h:36
CEP.h
HelpersPHEMlight::PHEMLIGHT_BASE
static const int PHEMLIGHT_BASE
Definition: HelpersPHEMlight.h:50