Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
HelpersPHEMlight5 Class Reference

Helper methods for PHEMlight-based emission computation. More...

#include <HelpersPHEMlight5.h>

Inheritance diagram for HelpersPHEMlight5:
[legend]
Collaboration diagram for HelpersPHEMlight5:
[legend]

Public Member Functions

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.
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.
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.
virtual ~HelpersPHEMlight5 ()
 Destructor.

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::CorrectionmyCorrection = 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

Detailed Description

Helper methods for PHEMlight-based emission computation.

Definition at line 43 of file HelpersPHEMlight5.h.

Constructor & Destructor Documentation

◆ HelpersPHEMlight5()

HelpersPHEMlight5::HelpersPHEMlight5 ( )

Constructor.

Definition at line 39 of file HelpersPHEMlight5.cpp.

References HelpersPHEMlight::HelpersPHEMlight(), myIndex, and PHEMLIGHT5_BASE.

◆ ~HelpersPHEMlight5()

HelpersPHEMlight5::~HelpersPHEMlight5 ( )
virtual

Destructor.

Definition at line 45 of file HelpersPHEMlight5.cpp.

References myCEPs.

Member Function Documentation

◆ calcPower()

double HelpersPHEMlight5::calcPower ( PHEMlightdllV5::CEP * currCep,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const
private

Returns the total power needed.

Parameters
[in]currCepthe emission class
[in]vthe speed value
[in]athe acceleration value
[in]slopeThe road's slope at vehicle's position [deg]
Returns
the total power needed

Definition at line 143 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().

Here is the caller graph for this function:

◆ calcWheelPower()

double HelpersPHEMlight5::calcWheelPower ( PHEMlightdllV5::CEP * currCep,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const
private

Returns the power without auxiliaries.

Parameters
[in]currCepthe emission class
[in]vthe speed value
[in]athe acceleration value
[in]slopeThe road's slope at vehicle's position [deg]
Returns
the power without auxiliaries

Definition at line 154 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().

Here is the caller graph for this function:

◆ compute()

double HelpersPHEMlight5::compute ( const SUMOEmissionClass c,
const PollutantsInterface::EmissionType e,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const
virtual

Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel).

Parameters
[in]cThe vehicle emission class
[in]vThe vehicle's current velocity
[in]aThe vehicle's current acceleration
[in]slopeThe road's slope at vehicle's position [deg]
Returns
The amount of the pollutant emitted by the given emission class when moving with the given velocity and acceleration [mg/s or ml/s]

Reimplemented from HelpersPHEMlight.

Definition at line 216 of file HelpersPHEMlight5.cpp.

References PHEMlightdllV5::CEP::CalcEngPower(), calcPower(), calcWheelPower(), PHEMlightdllV5::CEP::getAuxPower(), PHEMlightdllV5::CEP::getCalcType(), PHEMlightdllV5::CEP::GetCO2Emission(), getCoastingDecel(), EnergyParams::getDoubleOptional(), getEmission(), PHEMlightdllV5::CEP::getFuelType(), getModifiedAccel(), PHEMlightdllV5::CEP::getRatedPower(), EnergyParams::isEngineOff(), MAX2(), myCEPs, myHelper, PHEMlightdllV5::Constants::NORMALIZING_ACCELARATION, PHEMlightdllV5::Constants::NORMALIZING_SPEED, 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.

◆ getAmitranVehicleClass()

std::string HelpersPHEMlight::getAmitranVehicleClass ( const SUMOEmissionClass c) const
inherited

Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...).

Parameters
[in]cthe emission class
Returns
the name of the vehicle class

Definition at line 169 of file HelpersPHEMlight.cpp.

◆ getClass()

SUMOEmissionClass HelpersPHEMlight::getClass ( const SUMOEmissionClass base,
const std::string & vClass,
const std::string & fuel,
const std::string & eClass,
const double weight ) const
inherited

Returns the emission class described by the given parameters.

Parameters
[in]basethe base class giving the default
[in]vClassthe vehicle class as described in the Amitran interface (Passenger, ...)
[in]fuelthe fuel type as described in the Amitran interface (Gasoline, Diesel, ...)
[in]eClassthe emission class as described in the Amitran interface (Euro0, ...)
[in]weightthe vehicle weight in kg as described in the Amitran interface
Returns
the class described by the parameters

Definition at line 106 of file HelpersPHEMlight.cpp.

◆ getClassByName()

SUMOEmissionClass HelpersPHEMlight5::getClassByName ( const std::string & eClass,
const SUMOVehicleClass vc )
virtual

Checks whether the string describes a known vehicle class.

Parameters
[in]eClassThe string describing the vehicle emission class
Returns
whether it describes a valid emission class

Reimplemented from HelpersPHEMlight.

Definition at line 53 of file HelpersPHEMlight5.cpp.

References OptionsCont::getBool(), getClassByName(), OptionsCont::getFloat(), PHEMlightdllV5::CEP::getHeavyVehicle(), OptionsCont::getInt(), OptionsCont::getOptions(), OptionsCont::getString(), OptionsCont::isDefault(), myCEPHandler, myCEPs, myCorrection, myHelper, myIndex, and StringUtils::to_lower_case().

Referenced by getClassByName().

Here is the caller graph for this function:

◆ getCoastingDecel()

double HelpersPHEMlight5::getCoastingDecel ( const SUMOEmissionClass c,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const
virtual

Returns the maximum deceleration value (as a negative number), which can still be considered as non-braking.

Parameters
[in]cthe emission class
[in]vthe speed value
[in]athe acceleration value
[in]slopeThe road's slope at vehicle's position [deg]
[in]paramparameter of the emission model affecting the computation
Returns
the coasting deceleration

Reimplemented from HelpersPHEMlight.

Definition at line 193 of file HelpersPHEMlight5.cpp.

References PHEMlightdllV5::Constants::AIR_DENSITY_CONST, DEG2RAD, 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().

Here is the caller graph for this function:

◆ getEmission()

double HelpersPHEMlight5::getEmission ( PHEMlightdllV5::CEP * currCep,
const std::string & e,
const double p,
const double v,
const double drivingPower,
const double ratedPower ) const
private

Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel).

Parameters
[in]currCepThe vehicle emission class
[in]eThe emission type
[in]pThe vehicle's current power
[in]vThe vehicle's current velocity
Returns
The amount of the pollutant emitted by the given emission class when moving with the given velocity and acceleration [mg/s or ml/s]

Definition at line 137 of file HelpersPHEMlight5.cpp.

References PHEMlightdllV5::CEP::GetEmission(), and myHelper.

Referenced by compute().

Here is the caller graph for this function:

◆ getEuroClass()

int HelpersPHEMlight::getEuroClass ( const SUMOEmissionClass c) const
inherited

Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6).

Parameters
[in]cthe emission class
Returns
the Euro class

Definition at line 205 of file HelpersPHEMlight.cpp.

◆ getFuel()

std::string HelpersPHEMlight5::getFuel ( const SUMOEmissionClass c) const

Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...).

Parameters
[in]cthe emission class
Returns
the fuel type

Definition at line 114 of file HelpersPHEMlight5.cpp.

◆ getModifiedAccel()

double HelpersPHEMlight5::getModifiedAccel ( const SUMOEmissionClass c,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const
virtual

Returns the adapted acceleration value, useful for comparing with external PHEMlight references.

Parameters
[in]cthe emission class
[in]vthe speed value
[in]athe acceleration value
[in]slopeThe road's slope at vehicle's position [deg]
Returns
the modified acceleration

Reimplemented from HelpersPHEMlight.

Definition at line 172 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().

Here is the caller graph for this function:

◆ getWeight()

double HelpersPHEMlight5::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.

Parameters
[in]cthe emission class
Returns
a reference weight

Definition at line 131 of file HelpersPHEMlight5.cpp.

References myCEPs.

Field Documentation

◆ myCEPHandler

PHEMlightdllV5::CEPHandler HelpersPHEMlight5::myCEPHandler
private

Definition at line 133 of file HelpersPHEMlight5.h.

Referenced by getClassByName().

◆ myCEPs

std::map<SUMOEmissionClass, PHEMlightdllV5::CEP*> HelpersPHEMlight5::myCEPs
private

◆ myCorrection

PHEMlightdllV5::Correction* HelpersPHEMlight5::myCorrection = nullptr
private

Definition at line 134 of file HelpersPHEMlight5.h.

Referenced by getClassByName().

◆ myHelper

PHEMlightdllV5::Helpers HelpersPHEMlight5::myHelper
mutableprivate

Definition at line 135 of file HelpersPHEMlight5.h.

Referenced by compute(), getClassByName(), and getEmission().

◆ myIndex

int HelpersPHEMlight5::myIndex
private

the index of the next class

Definition at line 132 of file HelpersPHEMlight5.h.

Referenced by getClassByName(), and HelpersPHEMlight5().

◆ PHEMLIGHT5_BASE

const int HelpersPHEMlight5::PHEMLIGHT5_BASE = 6 << 16
staticprivate

Definition at line 45 of file HelpersPHEMlight5.h.

Referenced by HelpersPHEMlight5().

◆ PHEMLIGHT_BASE

const int HelpersPHEMlight::PHEMLIGHT_BASE = 3 << 16
staticprivateinherited

Definition at line 48 of file HelpersPHEMlight.h.

Referenced by HelpersPHEMlight().


The documentation for this class was generated from the following files: