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

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

#include <HelpersPHEMlight.h>

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

Public Member Functions

virtual 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.
virtual 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, ...).
virtual 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 as described in the Amitran interface This implementation returns only meaningful values for Solo_LKW (truck without trailer) and LNF (light duty vehicles).
 HelpersPHEMlight ()
 Constructor.
virtual ~HelpersPHEMlight ()
 Destructor.

Protected Member Functions

 HelpersPHEMlight (std::string name, const int baseIndex, const int defaultClass)
 Constructor for subclasses.

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).

Private Attributes

PHEMlightdll::CEPHandler myCEPHandler
std::map< SUMOEmissionClass, PHEMlightdll::CEP * > myCEPs
PHEMlightdll::Helpers myHelper
int myIndex
 the index of the next class

Static Private Attributes

static const int PHEMLIGHT_BASE = 3 << 16

Detailed Description

Helper methods for PHEMlight-based emission computation.

Definition at line 46 of file HelpersPHEMlight.h.

Constructor & Destructor Documentation

◆ HelpersPHEMlight() [1/2]

HelpersPHEMlight::HelpersPHEMlight ( )

Constructor.

Definition at line 43 of file HelpersPHEMlight.cpp.

References myIndex, and PHEMLIGHT_BASE.

Referenced by HelpersPHEMlight5::HelpersPHEMlight5().

Here is the caller graph for this function:

◆ ~HelpersPHEMlight()

HelpersPHEMlight::~HelpersPHEMlight ( )
virtual

Destructor.

Definition at line 49 of file HelpersPHEMlight.cpp.

References myCEPs.

◆ HelpersPHEMlight() [2/2]

HelpersPHEMlight::HelpersPHEMlight ( std::string name,
const int baseIndex,
const int defaultClass )
inlineprotected

Constructor for subclasses.

Parameters
[in]namethe name of the model (string before the '/' in the emission class attribute)

Definition at line 63 of file HelpersPHEMlight.h.

Member Function Documentation

◆ compute()

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

Definition at line 273 of file HelpersPHEMlight.cpp.

References PHEMlightdll::CEP::CalcPower(), PHEMCEPHandler::GetCep(), PHEMlightdll::CEP::GetCO2Emission(), getEmission(), PHEMlightdll::CEP::getFuelType(), PHEMCEPHandler::getHandlerInstance(), getModifiedAccel(), IDLE_SPEED, EnergyParams::isEngineOff(), MAX2(), myCEPs, myHelper, SECONDS_PER_HOUR, PHEMlightdll::Constants::strBEV, PHEMlightdll::Constants::strDiesel, PHEMlightdll::Constants::strGasoline, and PHEMlightdll::Constants::ZERO_SPEED_ACCURACY.

◆ getAmitranVehicleClass()

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

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

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 HelpersPHEMlight::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 in HelpersPHEMlight5.

Definition at line 57 of file HelpersPHEMlight.cpp.

References OptionsCont::getBool(), getClassByName(), PHEMCEPHandler::getHandlerInstance(), OptionsCont::getOptions(), myCEPHandler, myCEPs, myHelper, myIndex, and StringUtils::to_lower_case().

Referenced by getClassByName().

Here is the caller graph for this function:

◆ getCoastingDecel()

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

Definition at line 267 of file HelpersPHEMlight.cpp.

References myCEPs.

◆ getEmission()

double HelpersPHEMlight::getEmission ( const PHEMCEP * oldCep,
PHEMlightdll::CEP * currCep,
const std::string & e,
const double p,
const double v ) 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 248 of file HelpersPHEMlight.cpp.

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

Referenced by compute().

Here is the caller graph for this function:

◆ getEuroClass()

int HelpersPHEMlight::getEuroClass ( const SUMOEmissionClass c) const

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 HelpersPHEMlight::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 191 of file HelpersPHEMlight.cpp.

◆ getModifiedAccel()

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

Definition at line 257 of file HelpersPHEMlight.cpp.

References PHEMlightdll::CEP::GetMaxAccel(), MIN2(), and myCEPs.

Referenced by compute().

Here is the caller graph for this function:

◆ getWeight()

double HelpersPHEMlight::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).

Parameters
[in]cthe emission class
Returns
a reference weight

Definition at line 225 of file HelpersPHEMlight.cpp.

Field Documentation

◆ myCEPHandler

PHEMlightdll::CEPHandler HelpersPHEMlight::myCEPHandler
private

Definition at line 148 of file HelpersPHEMlight.h.

Referenced by getClassByName().

◆ myCEPs

std::map<SUMOEmissionClass, PHEMlightdll::CEP*> HelpersPHEMlight::myCEPs
private

◆ myHelper

PHEMlightdll::Helpers HelpersPHEMlight::myHelper
mutableprivate

Definition at line 149 of file HelpersPHEMlight.h.

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

◆ myIndex

int HelpersPHEMlight::myIndex
private

the index of the next class

Definition at line 147 of file HelpersPHEMlight.h.

Referenced by getClassByName(), and HelpersPHEMlight().

◆ PHEMLIGHT_BASE

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

Definition at line 48 of file HelpersPHEMlight.h.

Referenced by HelpersPHEMlight().


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