Eclipse SUMO - Simulation of Urban MObility
|
Helper methods for PHEMlight-based emission computation. More...
#include <HelpersPHEMlight5.h>
Public Member Functions | |
void | addAllClassesInto (std::vector< SUMOEmissionClass > &list) const |
Add all known emission classes of this model to the given container. | |
double | compute (const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const |
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel) | |
std::string | getAmitranVehicleClass (const SUMOEmissionClass c) const |
Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...) | |
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. | |
SUMOEmissionClass | getClassByName (const std::string &eClass, const SUMOVehicleClass vc) |
Checks whether the string describes a known vehicle class. | |
const std::string | getClassName (const SUMOEmissionClass c) const |
Returns the complete name of the emission class including the model. | |
virtual double | getCoastingDecel (const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param) const |
Returns the maximum deceleration value (as a negative number), which can still be considered as non-braking. | |
int | getEuroClass (const SUMOEmissionClass c) const |
Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6) | |
std::string | getFuel (const SUMOEmissionClass c) const |
Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) | |
double | getModifiedAccel (const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param) const |
Returns the adapted acceleration value, useful for comparing with external PHEMlight references. | |
const std::string & | getName () const |
Returns the name of the model. | |
double | getWeight (const SUMOEmissionClass c) const |
Returns a reference weight in kg described by this emission class This implementation returns the value from the corresponding veh description file. | |
HelpersPHEMlight5 () | |
Constructor. | |
bool | includesClass (const SUMOEmissionClass c) const |
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. | |
virtual | ~HelpersPHEMlight5 () |
Destructor. | |
Protected Attributes | |
const int | myBaseIndex |
the starting index for classes of this model | |
StringBijection< SUMOEmissionClass > | myEmissionClassStrings |
Mapping between emission class names and integer representations. | |
const std::string | myName |
the name of the model | |
bool | myVolumetricFuel |
return fuel consumption in l instead of mg | |
Static Protected Attributes | |
static const double | ZERO_SPEED_ACCURACY = .5 |
the lowest speed which allows reliable coasting calculations | |
Private Member Functions | |
double | calcPower (PHEMlightdllV5::CEP *currCep, const double v, const double a, const double slope, const EnergyParams *param) const |
Returns the total power needed. | |
double | calcWheelPower (PHEMlightdllV5::CEP *currCep, const double v, const double a, const double slope, const EnergyParams *param) const |
Returns the power without auxiliaries. | |
double | getEmission (PHEMlightdllV5::CEP *currCep, const std::string &e, const double p, const double v, const double drivingPower, const double ratedPower) const |
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel) | |
Private Attributes | |
PHEMlightdllV5::CEPHandler | myCEPHandler |
std::map< SUMOEmissionClass, PHEMlightdllV5::CEP * > | myCEPs |
PHEMlightdllV5::Correction * | myCorrection = nullptr |
PHEMlightdllV5::Helpers | myHelper |
int | myIndex |
the index of the next class | |
Static Private Attributes | |
static const int | PHEMLIGHT5_BASE = 6 << 16 |
static const int | PHEMLIGHT_BASE = 3 << 16 |
Helper methods for PHEMlight-based emission computation.
Definition at line 43 of file HelpersPHEMlight5.h.
HelpersPHEMlight5::HelpersPHEMlight5 | ( | ) |
Constructor.
Definition at line 38 of file HelpersPHEMlight5.cpp.
|
virtual |
|
inherited |
Add all known emission classes of this model to the given container.
[in] | list | the vector to add to |
Definition at line 213 of file PollutantsInterface.cpp.
Referenced by PollutantsInterface::getAllClasses(), and PollutantsInterface::getAllClassesStr().
|
private |
Returns the total power needed.
[in] | currCep | the emission class |
[in] | v | the speed value |
[in] | a | the acceleration value |
[in] | slope | The road's slope at vehicle's position [deg] |
Definition at line 142 of file HelpersPHEMlight5.cpp.
References PHEMlightdllV5::Constants::_DRIVE_TRAIN_EFFICIENCY, calcWheelPower(), PHEMlightdllV5::CEP::getAuxPower(), PHEMlightdllV5::CEP::getCalcType(), EnergyParams::getDoubleOptional(), and SUMO_ATTR_CONSTANTPOWERINTAKE.
Referenced by compute(), and getModifiedAccel().
|
private |
Returns the power without auxiliaries.
[in] | currCep | the emission class |
[in] | v | the speed value |
[in] | a | the acceleration value |
[in] | slope | The road's slope at vehicle's position [deg] |
Definition at line 153 of file HelpersPHEMlight5.cpp.
References PHEMlightdllV5::Constants::AIR_DENSITY_CONST, PHEMlightdllV5::CEP::getCrossSectionalArea(), PHEMlightdllV5::CEP::getCWValue(), EnergyParams::getDoubleOptional(), PHEMlightdllV5::CEP::getResistance(), PHEMlightdllV5::CEP::getResistanceF0(), PHEMlightdllV5::CEP::GetRotationalCoeffecient(), EnergyParams::getTransportableMass(), PHEMlightdllV5::CEP::getVehicleLoading(), PHEMlightdllV5::CEP::getVehicleMass(), PHEMlightdllV5::CEP::getVehicleMassRot(), PHEMlightdllV5::Constants::GRAVITY_CONST, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_ROLLDRAGCOEFFICIENT, and SUMO_ATTR_ROTATINGMASS.
Referenced by calcPower(), and compute().
|
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] |
Reimplemented from HelpersPHEMlight.
Definition at line 215 of file HelpersPHEMlight5.cpp.
References PHEMlightdllV5::CEP::CalcEngPower(), calcPower(), calcWheelPower(), PollutantsInterface::CO, PollutantsInterface::CO2, PollutantsInterface::ELEC, PollutantsInterface::FUEL, PHEMlightdllV5::CEP::getAuxPower(), PHEMlightdllV5::CEP::getCalcType(), PHEMlightdllV5::CEP::GetCO2Emission(), getCoastingDecel(), EnergyParams::getDoubleOptional(), getEmission(), PHEMlightdllV5::CEP::getFuelType(), getModifiedAccel(), PHEMlightdllV5::CEP::getRatedPower(), PollutantsInterface::HC, EnergyParams::isEngineOff(), MAX2(), myCEPs, myHelper, PollutantsInterface::Helper::myVolumetricFuel, PollutantsInterface::NO_X, PHEMlightdllV5::Constants::NORMALIZING_ACCELARATION, PHEMlightdllV5::Constants::NORMALIZING_SPEED, PollutantsInterface::PM_X, SECONDS_PER_HOUR, PHEMlightdllV5::Constants::strBEV, PHEMlightdllV5::Constants::strDiesel, PHEMlightdllV5::Constants::strGasoline, PHEMlightdllV5::Constants::strHybrid, SUMO_ATTR_CONSTANTPOWERINTAKE, SUMO_ATTR_MAXIMUMPOWER, and PHEMlightdllV5::Constants::ZERO_SPEED_ACCURACY.
|
virtualinherited |
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 169 of file HelpersPHEMlight.cpp.
References StringBijection< T >::getString(), and PollutantsInterface::Helper::myEmissionClassStrings.
|
virtualinherited |
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 106 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 HelpersPHEMlight.
Definition at line 52 of file HelpersPHEMlight5.cpp.
References StringBijection< T >::addAlias(), StringBijection< T >::get(), OptionsCont::getBool(), PHEMlightdllV5::CEPHandler::GetCEP(), PHEMlightdllV5::CEPHandler::getCEPS(), getClassByName(), PHEMlightdllV5::Helpers::getErrMsg(), OptionsCont::getFloat(), PHEMlightdllV5::Helpers::getgClass(), PHEMlightdllV5::CEP::getHeavyVehicle(), OptionsCont::getInt(), OptionsCont::getOptions(), OptionsCont::getString(), StringBijection< T >::hasString(), PollutantsInterface::HEAVY_BIT, StringBijection< T >::insert(), OptionsCont::isDefault(), myCEPHandler, myCEPs, myCorrection, PollutantsInterface::Helper::myEmissionClassStrings, myHelper, myIndex, PollutantsInterface::Helper::myVolumetricFuel, PHEMlightdllV5::Correction::ReadDet(), PHEMlightdllV5::Correction::ReadTNOx(), PHEMlightdllV5::Correction::setAmbTemp(), PHEMlightdllV5::Helpers::setclass(), PHEMlightdllV5::Helpers::setCommentPrefix(), PHEMlightdllV5::Helpers::setPHEMDataV(), PHEMlightdllV5::Correction::setUseDet(), PHEMlightdllV5::Correction::setUseTNOx(), PHEMlightdllV5::Correction::setYear(), and StringUtils::to_lower_case().
Referenced by getClassByName().
|
inherited |
Returns the complete name of the emission class including the model.
[in] | c | the emission class |
Definition at line 124 of file PollutantsInterface.cpp.
Referenced by PollutantsInterface::getName().
|
virtual |
Returns the maximum deceleration value (as a negative number), which can still be considered as non-braking.
[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] |
[in] | param | parameter of the emission model affecting the computation |
Reimplemented from HelpersPHEMlight.
Definition at line 192 of file HelpersPHEMlight5.cpp.
References PHEMlightdllV5::Constants::AIR_DENSITY_CONST, getCoastingDecel(), PHEMlightdllV5::CEP::getCrossSectionalArea(), PHEMlightdllV5::CEP::getCWValue(), EnergyParams::getDoubleOptional(), PHEMlightdllV5::CEP::getFMot(), PHEMlightdllV5::CEP::getRatedPower(), PHEMlightdllV5::CEP::getResistance(), PHEMlightdllV5::CEP::getResistanceF0(), PHEMlightdllV5::CEP::GetRotationalCoeffecient(), EnergyParams::getTransportableMass(), PHEMlightdllV5::CEP::getVehicleLoading(), PHEMlightdllV5::CEP::getVehicleMass(), PHEMlightdllV5::CEP::getWheelRadius(), PHEMlightdllV5::Constants::GRAVITY_CONST, myCEPs, PHEMlightdllV5::Constants::SPEED_DCEL_MIN, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_MAXIMUMPOWER, SUMO_ATTR_ROLLDRAGCOEFFICIENT, and SUMO_ATTR_WHEELRADIUS.
Referenced by compute(), and getCoastingDecel().
|
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 136 of file HelpersPHEMlight5.cpp.
References PHEMlightdllV5::CEP::GetEmission(), and myHelper.
Referenced by compute().
|
virtualinherited |
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 205 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 HelpersPHEMlight.
Definition at line 113 of file HelpersPHEMlight5.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 HelpersPHEMlight.
Definition at line 171 of file HelpersPHEMlight5.cpp.
References calcPower(), EnergyParams::getDoubleOptional(), PHEMlightdllV5::CEP::GetPMaxNorm(), PHEMlightdllV5::CEP::getRatedPower(), PHEMlightdllV5::CEP::GetRotationalCoeffecient(), EnergyParams::getTransportableMass(), PHEMlightdllV5::CEP::getVehicleLoading(), PHEMlightdllV5::CEP::getVehicleMass(), PHEMlightdllV5::CEP::getVehicleMassRot(), MIN2(), myCEPs, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_MAXIMUMPOWER, and SUMO_ATTR_ROTATINGMASS.
Referenced by compute().
|
inherited |
Returns the name of the model.
Definition at line 107 of file PollutantsInterface.cpp.
|
virtual |
Returns a reference weight in kg described by this emission class This implementation returns the value from the corresponding veh description file.
[in] | c | the emission class |
Reimplemented from HelpersPHEMlight.
Definition at line 130 of file HelpersPHEMlight5.cpp.
References myCEPs.
|
inherited |
Definition at line 219 of file PollutantsInterface.cpp.
|
virtualinherited |
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 130 of file PollutantsInterface.cpp.
References PollutantsInterface::HEAVY_BIT.
Referenced by PollutantsInterface::isSilent().
|
protectedinherited |
the starting index for classes of this model
Definition at line 228 of file PollutantsInterface.h.
|
private |
Definition at line 133 of file HelpersPHEMlight5.h.
Referenced by getClassByName().
|
private |
Definition at line 136 of file HelpersPHEMlight5.h.
Referenced by compute(), getClassByName(), getCoastingDecel(), getModifiedAccel(), getWeight(), and ~HelpersPHEMlight5().
|
private |
Definition at line 134 of file HelpersPHEMlight5.h.
Referenced by getClassByName().
|
protectedinherited |
Mapping between emission class names and integer representations.
Definition at line 234 of file PollutantsInterface.h.
Referenced by HelpersHBEFA3::getAmitranVehicleClass(), HelpersHBEFA4::getAmitranVehicleClass(), HelpersPHEMlight::getAmitranVehicleClass(), HelpersHBEFA3::getClass(), HelpersHBEFA4::getClass(), HelpersPHEMlight::getClass(), HelpersPHEMlight::getClassByName(), getClassByName(), HelpersHBEFA3::getEuroClass(), HelpersHBEFA4::getEuroClass(), HelpersPHEMlight::getEuroClass(), HelpersHBEFA3::getFuel(), HelpersHBEFA4::getFuel(), HelpersPHEMlight::getFuel(), getFuel(), HelpersPHEMlight::getWeight(), PollutantsInterface::Helper::Helper(), HelpersHBEFA::HelpersHBEFA(), HelpersHBEFA3::HelpersHBEFA3(), and HelpersHBEFA4::HelpersHBEFA4().
|
mutableprivate |
Definition at line 135 of file HelpersPHEMlight5.h.
Referenced by compute(), getClassByName(), and getEmission().
|
private |
the index of the next class
Definition at line 132 of file HelpersPHEMlight5.h.
Referenced by getClassByName().
|
protectedinherited |
the name of the model
Definition at line 225 of file PollutantsInterface.h.
|
protectedinherited |
return fuel consumption in l instead of mg
Definition at line 231 of file PollutantsInterface.h.
Referenced by HelpersHBEFA::compute(), HelpersHBEFA3::compute(), HelpersHBEFA4::compute(), HelpersPHEMlight::compute(), compute(), HelpersPHEMlight::getClassByName(), and getClassByName().
|
staticprivate |
Definition at line 45 of file HelpersPHEMlight5.h.
|
staticprivateinherited |
Definition at line 48 of file HelpersPHEMlight.h.
|
staticprotectedinherited |
the lowest speed which allows reliable coasting calculations
Definition at line 222 of file PollutantsInterface.h.
Referenced by HelpersHBEFA::compute(), HelpersHBEFA3::compute(), and HelpersHBEFA4::compute().