Eclipse SUMO - Simulation of Urban MObility
HelpersMMPEVEM Class Reference

This helper class allows the PollutantsInterface to load and use different MMPEVEMs. More...

#include <HelpersMMPEVEM.h>

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

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, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *ptr_energyParams) const
 Compute the amount of emitted pollutants for an emission class in a given state. More...
 
virtual SUMOEmissionClass getClassByName (const std::string &eClass, const SUMOVehicleClass vc)
 Returns the emission class associated with the given name, aliases are possible If this method is asked for the "unknown" class it should return the default (possibly depending on the given vehicle class). The class name is case insensitive. More...
 
const std::string getClassName (const SUMOEmissionClass c) const
 Returns the complete name of the emission class including the model. More...
 
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. Default implementation returns always zero. More...
 
std::string getFuel (const SUMOEmissionClass) const
 Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) More...
 
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. Default implementation returns always the input accel. More...
 
const std::string & getName () const
 Returns the name of the model. More...
 
 HelpersMMPEVEM ()
 Constructor. More...
 
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. More...
 
Methods for Amitran interfaces
virtual 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. The base is used to determine the model to use and as default return values. Default implementation returns always base. More...
 
virtual std::string getAmitranVehicleClass (const SUMOEmissionClass c) const
 Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...) Default implementation returns always "Passenger". More...
 
virtual int getEuroClass (const SUMOEmissionClass c) const
 Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6) Default implementation returns always 0. More...
 
virtual double getWeight (const SUMOEmissionClass c) const
 Returns a reference weight in kg described by this emission class as described in the Amitran interface It might return -1, if the weight is not important to distinguish different emission classes. Default implementation returns always -1. More...
 

Protected Attributes

const int myBaseIndex
 the starting index for classes of this model More...
 
StringBijection< SUMOEmissionClassmyEmissionClassStrings
 Mapping between emission class names and integer representations. More...
 
const std::string myName
 the name of the model More...
 
bool myVolumetricFuel
 return fuel consumption in l instead of mg More...
 

Static Protected Attributes

static const double ZERO_SPEED_ACCURACY = .5
 the lowest speed which allows reliable coasting calculations More...
 

Static Private Attributes

static const int MMPEVEM_BASE = 5 << 16
 

Detailed Description

This helper class allows the PollutantsInterface to load and use different MMPEVEMs.

Definition at line 43 of file HelpersMMPEVEM.h.

Constructor & Destructor Documentation

◆ HelpersMMPEVEM()

HelpersMMPEVEM::HelpersMMPEVEM ( )

Constructor.

Definition at line 173 of file HelpersMMPEVEM.cpp.

Member Function Documentation

◆ addAllClassesInto()

void PollutantsInterface::Helper::addAllClassesInto ( std::vector< SUMOEmissionClass > &  list) const
inherited

Add all known emission classes of this model to the given container.

Parameters
[in]listthe vector to add to

Definition at line 214 of file PollutantsInterface.cpp.

Referenced by PollutantsInterface::getAllClasses(), and PollutantsInterface::getAllClassesStr().

Here is the caller graph for this function:

◆ compute()

double HelpersMMPEVEM::compute ( const  SUMOEmissionClass,
const PollutantsInterface::EmissionType  e,
const double  v,
const double  a,
const double  slope,
const EnergyParams ptr_energyParams 
) const
virtual

Compute the amount of emitted pollutants for an emission class in a given state.

This method returns 0 for all emission types but electric power consumption.

Parameters
[in]cAn emission class
[in]eAn emission type
[in]vCurrent vehicle velocity [m/s]
[in]aCurrent acceleration of the vehicle [m/s^2]
[in]slopeSlope of the road at the vehicle's current position [deg]
Returns
The electric power consumption [Wh/s] or 0 for all other emission types

This method returns 0 for all emission types but electric power consumption.

Parameters
[in]cAn emission class
[in]eAn emission type
[in]vCurrent vehicle velocity [m/s]
[in]aCurrent acceleration of the vehicle [m/s^2]
[in]slopeSlope of the road at the vehicle's current position [deg]
[in]ptr_energyParamsVehicle parameters
Returns
The electric power consumption [Wh/s] or 0 for all other emission types

Reimplemented from PollutantsInterface::Helper.

Definition at line 197 of file HelpersMMPEVEM.cpp.

References calcPowerConsumption(), PollutantsInterface::ELEC, EnergyParams::getCharacteristicMap(), EnergyParams::getDouble(), EnergyParams::getDoubleOptional(), SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_CONSTANTPOWERINTAKE, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_GEAREFFICIENCY, SUMO_ATTR_GEARRATIO, SUMO_ATTR_INTERNALBATTERYRESISTANCE, SUMO_ATTR_INTERNALMOMENTOFINERTIA, SUMO_ATTR_LOADING, SUMO_ATTR_MASS, SUMO_ATTR_MAXIMUMPOWER, SUMO_ATTR_MAXIMUMRECUPERATIONPOWER, SUMO_ATTR_MAXIMUMRECUPERATIONTORQUE, SUMO_ATTR_MAXIMUMTORQUE, SUMO_ATTR_NOMINALBATTERYVOLTAGE, SUMO_ATTR_POWERLOSSMAP, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_WHEELRADIUS, and TS.

◆ getAmitranVehicleClass()

std::string PollutantsInterface::Helper::getAmitranVehicleClass ( const SUMOEmissionClass  c) const
virtualinherited

Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...) Default implementation returns always "Passenger".

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

Reimplemented in HelpersPHEMlight, HelpersHBEFA4, and HelpersHBEFA3.

Definition at line 146 of file PollutantsInterface.cpp.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getAmitranVehicleClass().

Here is the caller graph for this function:

◆ getClass()

SUMOEmissionClass PollutantsInterface::Helper::getClass ( const SUMOEmissionClass  base,
const std::string &  vClass,
const std::string &  fuel,
const std::string &  eClass,
const double  weight 
) const
virtualinherited

Returns the emission class described by the given parameters. The base is used to determine the model to use and as default return values. Default implementation returns always base.

Parameters
[in]basethe base class giving the model and 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

Reimplemented in HelpersPHEMlight, HelpersHBEFA4, and HelpersHBEFA3.

Definition at line 136 of file PollutantsInterface.cpp.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getClass().

Here is the caller graph for this function:

◆ getClassByName()

SUMOEmissionClass PollutantsInterface::Helper::getClassByName ( const std::string &  eClass,
const SUMOVehicleClass  vc 
)
virtualinherited

Returns the emission class associated with the given name, aliases are possible If this method is asked for the "unknown" class it should return the default (possibly depending on the given vehicle class). The class name is case insensitive.

Parameters
[in]eClassthe name of the emission class (string after the '/' in the emission class attribute)
[in]vcthe vehicle class to use when determining default class
Returns
the name of the model (string before the '/' in the emission class)

Reimplemented in HelpersPHEMlight5, and HelpersPHEMlight.

Definition at line 113 of file PollutantsInterface.cpp.

References OptionsCont::exists(), OptionsCont::getBool(), OptionsCont::getOptions(), StringUtils::to_lower_case(), and UNUSED_PARAMETER.

Referenced by PollutantsInterface::getClassByName().

Here is the caller graph for this function:

◆ getClassName()

const std::string PollutantsInterface::Helper::getClassName ( const SUMOEmissionClass  c) const
inherited

Returns the complete name of the emission class including the model.

Parameters
[in]cthe emission class
Returns
the name of the class (the complete emission class attribute)

Definition at line 124 of file PollutantsInterface.cpp.

Referenced by PollutantsInterface::getName().

Here is the caller graph for this function:

◆ getCoastingDecel()

double PollutantsInterface::Helper::getCoastingDecel ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope,
const EnergyParams param 
) const
virtualinherited

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

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, and HelpersPHEMlight.

Definition at line 196 of file PollutantsInterface.cpp.

References PollutantsInterface::getCoastingDecel(), EnergyParams::getDefault(), EnergyParams::getDouble(), PHEMlightdllV5::Constants::GRAVITY_CONST, M_PI, MIN2(), PHEMlightdllV5::Constants::SPEED_DCEL_MIN, SUMO_ATTR_HEIGHT, SUMO_ATTR_MASS, and SUMO_ATTR_WIDTH.

Referenced by HelpersHBEFA::compute(), HelpersHBEFA3::compute(), HelpersHBEFA4::compute(), and PollutantsInterface::getCoastingDecel().

Here is the caller graph for this function:

◆ getEuroClass()

int PollutantsInterface::Helper::getEuroClass ( const SUMOEmissionClass  c) const
virtualinherited

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

Parameters
[in]cthe emission class
Returns
the Euro class

Reimplemented in HelpersPHEMlight, HelpersHBEFA4, and HelpersHBEFA3.

Definition at line 160 of file PollutantsInterface.cpp.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getEuroClass().

Here is the caller graph for this function:

◆ getFuel()

std::string HelpersMMPEVEM::getFuel ( const  SUMOEmissionClass) const
inlinevirtual

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

Parameters
[in]cthe emission class
Returns
always "Electricity"

Reimplemented from PollutantsInterface::Helper.

Definition at line 58 of file HelpersMMPEVEM.h.

◆ getModifiedAccel()

double PollutantsInterface::Helper::getModifiedAccel ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope,
const EnergyParams param 
) const
virtualinherited

Returns the adapted acceleration value, useful for comparing with external PHEMlight references. Default implementation returns always the input accel.

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, and HelpersPHEMlight.

Definition at line 186 of file PollutantsInterface.cpp.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getModifiedAccel().

Here is the caller graph for this function:

◆ getName()

const std::string & PollutantsInterface::Helper::getName ( ) const
inherited

Returns the name of the model.

Returns
the name of the model (string before the '/' in the emission class attribute)

Definition at line 107 of file PollutantsInterface.cpp.

◆ getWeight()

double PollutantsInterface::Helper::getWeight ( const SUMOEmissionClass  c) const
virtualinherited

Returns a reference weight in kg described by this emission class as described in the Amitran interface It might return -1, if the weight is not important to distinguish different emission classes. Default implementation returns always -1.

Parameters
[in]cthe emission class
Returns
a reference weight

Reimplemented in HelpersPHEMlight.

Definition at line 167 of file PollutantsInterface.cpp.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getWeight().

Here is the caller graph for this function:

◆ includesClass()

bool PollutantsInterface::Helper::includesClass ( const SUMOEmissionClass  c) const
inherited

Definition at line 220 of file PollutantsInterface.cpp.

◆ isSilent()

bool PollutantsInterface::Helper::isSilent ( const SUMOEmissionClass  c)
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.

Parameters
[in]cthe emission class
Returns
whether the class denotes a silent vehicle

Definition at line 130 of file PollutantsInterface.cpp.

References PollutantsInterface::HEAVY_BIT.

Referenced by PollutantsInterface::isSilent().

Here is the caller graph for this function:

Field Documentation

◆ MMPEVEM_BASE

const int HelpersMMPEVEM::MMPEVEM_BASE = 5 << 16
staticprivate

Definition at line 45 of file HelpersMMPEVEM.h.

◆ myBaseIndex

const int PollutantsInterface::Helper::myBaseIndex
protectedinherited

the starting index for classes of this model

Definition at line 228 of file PollutantsInterface.h.

◆ myEmissionClassStrings

◆ myName

const std::string PollutantsInterface::Helper::myName
protectedinherited

the name of the model

Definition at line 225 of file PollutantsInterface.h.

◆ myVolumetricFuel

bool PollutantsInterface::Helper::myVolumetricFuel
protectedinherited

◆ ZERO_SPEED_ACCURACY

const double PollutantsInterface::Helper::ZERO_SPEED_ACCURACY = .5
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().


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