![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Helper methods for PHEMlight-based emission computation. More...
#include <HelpersPHEMlight.h>
Public Member Functions | |
| void | addAllClassesInto (std::vector< SUMOEmissionClass > &list) const |
| Add all known emission classes of this model to the given container. More... | |
| 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) More... | |
| std::string | getAmitranVehicleClass (const SUMOEmissionClass c) const |
| Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...) More... | |
| 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. More... | |
| SUMOEmissionClass | getClassByName (const std::string &eClass, const SUMOVehicleClass vc) |
| Checks whether the string describes a known vehicle class. More... | |
| const std::string | getClassName (const SUMOEmissionClass c) const |
| Returns the complete name of the emission class including the model. More... | |
| int | getEuroClass (const SUMOEmissionClass c) const |
| Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6) More... | |
| std::string | getFuel (const SUMOEmissionClass c) const |
| Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) More... | |
| 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. More... | |
| const std::string & | getName () const |
| Returns the name of the model. More... | |
| double | getWeight (const SUMOEmissionClass c) const |
| Returns a reference weight in kg described by this emission class as described in the Amitran interface This implementation returns only meaningful values for Solo_LKW (truck without trailer) and LNF (light duty vehicles). More... | |
| HelpersPHEMlight () | |
| Constructor. More... | |
| virtual bool | isSilent (const SUMOEmissionClass c) |
| Returns whether the class denotes a silent vehicle for interfacing with the noise model. By default the first class in each model is the silent class. More... | |
Static Public Attributes | |
| static const int | PHEMLIGHT_BASE = 2 << 16 |
Protected Attributes | |
| StringBijection< SUMOEmissionClass > | myEmissionClassStrings |
| Mapping between emission class names and integer representations. More... | |
| const std::string | myName |
| the name of the model More... | |
Private Member Functions | |
| 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) More... | |
Private Attributes | |
| PHEMlightdll::CEPHandler | myCEPHandler |
| std::map< SUMOEmissionClass, PHEMlightdll::CEP * > | myCEPs |
| PHEMlightdll::Helpers | myHelper |
| int | myIndex |
| the index of the next class More... | |
Helper methods for PHEMlight-based emission computation.
Definition at line 48 of file HelpersPHEMlight.h.
| HelpersPHEMlight::HelpersPHEMlight | ( | ) |
Constructor.
Definition at line 41 of file HelpersPHEMlight.cpp.
References StringBijection< T >::insert(), PollutantsInterface::Helper::myEmissionClassStrings, and myIndex.
|
inlineinherited |
Add all known emission classes of this model to the given container.
| [in] | list | the vector to add to |
Definition at line 244 of file PollutantsInterface.h.
References StringBijection< T >::addKeysInto(), and PollutantsInterface::Helper::myEmissionClassStrings.
Referenced by PollutantsInterface::getAllClasses(), and PollutantsInterface::getAllClassesStr().
|
virtual |
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel)
| [in] | c | The vehicle emission class |
| [in] | v | The vehicle's current velocity |
| [in] | a | The vehicle's current acceleration |
| [in] | slope | The road's slope at vehicle's position [deg] |
Implements PollutantsInterface::Helper.
Definition at line 255 of file HelpersPHEMlight.cpp.
References PHEMCEP::CalcPower(), PHEMlightdll::CEP::CalcPower(), PollutantsInterface::CO, PollutantsInterface::CO2, PollutantsInterface::ELEC, PollutantsInterface::FUEL, PHEMCEPHandler::GetCep(), PHEMlightdll::CEP::GetCO2Emission(), PHEMlightdll::CEP::GetDecelCoast(), getEmission(), PHEMlightdll::CEP::getFuelType(), PHEMCEPHandler::getHandlerInstance(), getModifiedAccel(), PHEMCEP::GetVehicleFuelType(), PollutantsInterface::HC, IDLE_SPEED, MAX2(), myCEPs, myHelper, PollutantsInterface::NO_X, PHEMLIGHT_BASE, PollutantsInterface::PM_X, SECONDS_PER_HOUR, PHEMlightdll::Constants::strBEV, PHEMlightdll::Constants::strDiesel, PHEMlightdll::Constants::strGasoline, and PHEMlightdll::Constants::ZERO_SPEED_ACCURACY.
|
virtual |
Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...)
| [in] | c | the emission class |
Reimplemented from PollutantsInterface::Helper.
Definition at line 157 of file HelpersPHEMlight.cpp.
References StringBijection< T >::getString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
virtual |
Returns the emission class described by the given parameters.
| [in] | base | the base class giving the default |
| [in] | vClass | the vehicle class as described in the Amitran interface (Passenger, ...) |
| [in] | fuel | the fuel type as described in the Amitran interface (Gasoline, Diesel, ...) |
| [in] | eClass | the emission class as described in the Amitran interface (Euro0, ...) |
| [in] | weight | the vehicle weight in kg as described in the Amitran interface |
Reimplemented from PollutantsInterface::Helper.
Definition at line 94 of file HelpersPHEMlight.cpp.
References StringBijection< T >::get(), StringBijection< T >::hasString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
virtual |
Checks whether the string describes a known vehicle class.
| [in] | eClass | The string describing the vehicle emission class |
Reimplemented from PollutantsInterface::Helper.
Definition at line 47 of file HelpersPHEMlight.cpp.
References StringBijection< T >::addAlias(), StringBijection< T >::get(), PHEMlightdll::CEPHandler::GetCEP(), PHEMlightdll::CEPHandler::getCEPS(), PHEMlightdll::Helpers::getErrMsg(), PHEMlightdll::Helpers::getgClass(), PHEMCEPHandler::getHandlerInstance(), OptionsCont::getOptions(), StringBijection< T >::hasString(), PollutantsInterface::HEAVY_BIT, StringBijection< T >::insert(), myCEPHandler, myCEPs, PollutantsInterface::Helper::myEmissionClassStrings, myHelper, myIndex, StringBijection< T >::remove(), PHEMlightdll::Helpers::setclass(), PHEMlightdll::Helpers::setCommentPrefix(), and PHEMlightdll::Helpers::setPHEMDataV().
|
inlineinherited |
Returns the complete name of the emission class including the model.
| [in] | c | the emission class |
Definition at line 139 of file PollutantsInterface.h.
References StringBijection< T >::getString(), PollutantsInterface::Helper::myEmissionClassStrings, and PollutantsInterface::Helper::myName.
Referenced by PollutantsInterface::getName().
|
private |
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel)
| [in] | currCep | The vehicle emission class |
| [in] | e | The emission type |
| [in] | p | The vehicle's current power |
| [in] | v | The vehicle's current velocity |
Definition at line 236 of file HelpersPHEMlight.cpp.
References PHEMCEP::GetEmission(), PHEMlightdll::CEP::GetEmission(), and myHelper.
Referenced by compute().
|
virtual |
Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6)
| [in] | c | the emission class |
Reimplemented from PollutantsInterface::Helper.
Definition at line 193 of file HelpersPHEMlight.cpp.
References StringBijection< T >::getString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
virtual |
Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...)
| [in] | c | the emission class |
Reimplemented from PollutantsInterface::Helper.
Definition at line 179 of file HelpersPHEMlight.cpp.
References StringBijection< T >::getString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
virtual |
Returns the adapted acceleration value, useful for comparing with external PHEMlight references.
| [in] | c | the emission class |
| [in] | v | the speed value |
| [in] | a | the acceleration value |
| [in] | slope | The road's slope at vehicle's position [deg] |
Reimplemented from PollutantsInterface::Helper.
Definition at line 245 of file HelpersPHEMlight.cpp.
References PHEMlightdll::CEP::GetMaxAccel(), MIN2(), and myCEPs.
Referenced by compute().
|
inlineinherited |
Returns the name of the model.
Definition at line 112 of file PollutantsInterface.h.
References PollutantsInterface::Helper::myName.
|
virtual |
Returns a reference weight in kg described by this emission class as described in the Amitran interface This implementation returns only meaningful values for Solo_LKW (truck without trailer) and LNF (light duty vehicles).
| [in] | c | the emission class |
Reimplemented from PollutantsInterface::Helper.
Definition at line 213 of file HelpersPHEMlight.cpp.
References StringBijection< T >::getString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
inlinevirtualinherited |
Returns whether the class denotes a silent vehicle for interfacing with the noise model. By default the first class in each model is the silent class.
| [in] | c | the emission class |
Definition at line 148 of file PollutantsInterface.h.
References PollutantsInterface::HEAVY_BIT.
Referenced by PollutantsInterface::isSilent().
|
private |
Definition at line 130 of file HelpersPHEMlight.h.
Referenced by getClassByName().
|
private |
Definition at line 132 of file HelpersPHEMlight.h.
Referenced by compute(), getClassByName(), and getModifiedAccel().
|
protectedinherited |
Mapping between emission class names and integer representations.
Definition at line 253 of file PollutantsInterface.h.
Referenced by PollutantsInterface::Helper::addAllClassesInto(), HelpersHBEFA3::getAmitranVehicleClass(), getAmitranVehicleClass(), HelpersHBEFA3::getClass(), getClass(), getClassByName(), PollutantsInterface::Helper::getClassByName(), PollutantsInterface::Helper::getClassName(), HelpersHBEFA3::getEuroClass(), getEuroClass(), HelpersHBEFA3::getFuel(), getFuel(), getWeight(), HelpersEnergy::HelpersEnergy(), HelpersHBEFA::HelpersHBEFA(), HelpersHBEFA3::HelpersHBEFA3(), and HelpersPHEMlight().
|
mutableprivate |
Definition at line 131 of file HelpersPHEMlight.h.
Referenced by compute(), getClassByName(), and getEmission().
|
private |
the index of the next class
Definition at line 129 of file HelpersPHEMlight.h.
Referenced by getClassByName(), and HelpersPHEMlight().
|
protectedinherited |
the name of the model
Definition at line 250 of file PollutantsInterface.h.
Referenced by PollutantsInterface::Helper::getClassName(), and PollutantsInterface::Helper::getName().
|
static |
Definition at line 50 of file HelpersPHEMlight.h.
Referenced by compute().