Eclipse SUMO - Simulation of Urban MObility
PollutantsInterface Class Reference

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

#include <PollutantsInterface.h>

Collaboration diagram for PollutantsInterface:

Data Structures

struct  Emissions
 Storage for collected values of all emission types. More...
 
class  Helper
 abstract superclass for the model helpers More...
 

Public Types

enum  EmissionType {
  CO2, CO, HC, FUEL,
  NO_X, PM_X, ELEC
}
 Enumerating all emission types, including fuel. More...
 

Static Public Member Functions

static double compute (const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param=0)
 Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fuel) More...
 
static Emissions computeAll (const SUMOEmissionClass c, const double v, const double a, const double slope, const std::map< int, double > *param=0)
 Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or ml/s for fuel) More...
 
static double computeDefault (const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const double tt, const std::map< int, double > *param=0)
 Returns the amount of emitted pollutant given the vehicle type and default values for the state (in mg) More...
 
static const std::vector< SUMOEmissionClassgetAllClasses ()
 Checks whether the string describes a known vehicle class. More...
 
static const std::vector< std::string > & getAllClassesStr ()
 Get all SUMOEmissionClass in string format. More...
 
static std::string getAmitranVehicleClass (const SUMOEmissionClass c)
 Returns the vehicle class described by the given emission class. More...
 
static SUMOEmissionClass getClass (const SUMOEmissionClass base, const std::string &vClass, const std::string &fuel, const std::string &eClass, const double weight)
 Returns the emission class fittig the given parameters. More...
 
static SUMOEmissionClass getClassByName (const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
 Checks whether the string describes a known vehicle class. More...
 
static const HelpersEnergygetEnergyHelper ()
 get energy helper More...
 
static int getEuroClass (const SUMOEmissionClass c)
 Returns the Euro norm described by the given emission class. More...
 
static std::string getFuel (const SUMOEmissionClass c)
 Returns the fuel type of the given emission class. More...
 
static double getModifiedAccel (const SUMOEmissionClass c, const double v, const double a, const double slope)
 Returns the adapted acceleration value, useful for comparing with external PHEMlight references. More...
 
static std::string getName (const SUMOEmissionClass c)
 Checks whether the string describes a known vehicle class. More...
 
static double getWeight (const SUMOEmissionClass c)
 Returns a representative weight for the given emission class see http://colombo-fp7.eu/deliverables/COLOMBO_D4.2_ExtendedPHEMSUMO_v1.7.pdf. More...
 
static bool isHeavy (const SUMOEmissionClass c)
 Checks whether the emission class describes a bus, truck or similar vehicle. More...
 
static bool isSilent (const SUMOEmissionClass c)
 Checks whether the emission class describes an electric or similar silent vehicle. More...
 

Static Public Attributes

static const int HEAVY_BIT = 1 << 15
 the bit to set for denoting heavy vehicles More...
 
static const int ZERO_EMISSIONS = 0
 the first class in each model representing a zero emission vehicle More...
 

Static Private Attributes

static std::vector< std::string > myAllClassesStr
 get all emission classes in strin format More...
 
static HelpersEnergy myEnergyHelper
 Instance of EnergyHelper which gets cleaned up automatically. More...
 
static HelpersHBEFA myHBEFA2Helper
 Instance of HBEFA2Helper which gets cleaned up automatically. More...
 
static HelpersHBEFA3 myHBEFA3Helper
 Instance of HBEFA3Helper which gets cleaned up automatically. More...
 
static HelpermyHelpers []
 the known model helpers More...
 
static HelpersPHEMlight myPHEMlightHelper
 Instance of PHEMlightHelper which gets cleaned up automatically. More...
 

Detailed Description

Helper methods for PHEMlight-based emission computation.

Definition at line 51 of file PollutantsInterface.h.

Member Enumeration Documentation

◆ EmissionType

Enumerating all emission types, including fuel.

Enumerator
CO2 
CO 
HC 
FUEL 
NO_X 
PM_X 
ELEC 

Definition at line 55 of file PollutantsInterface.h.

Member Function Documentation

◆ compute()

double PollutantsInterface::compute ( const SUMOEmissionClass  c,
const EmissionType  e,
const double  v,
const double  a,
const double  slope,
const std::map< int, double > *  param = 0 
)
static

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

Parameters
[in]cThe vehicle emission class
[in]ethe type of emission (CO, CO2, ...)
[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 emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s]

Definition at line 148 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::compute(), and myHelpers.

Referenced by ROEdge::buildTimeLines(), MSVehicle::getCO2Emissions(), MSVehicle::getCOEmissions(), MSVehicle::getElectricityConsumption(), MSVehicle::getFuelConsumption(), MSVehicle::getHCEmissions(), MSVehicle::getNOxEmissions(), and MSVehicle::getPMxEmissions().

◆ computeAll()

PollutantsInterface::Emissions PollutantsInterface::computeAll ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope,
const std::map< int, double > *  param = 0 
)
static

Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or 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 emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s]

Definition at line 154 of file PollutantsInterface.cpp.

References CO, CO2, PollutantsInterface::Helper::compute(), ELEC, FUEL, HC, myHelpers, NO_X, and PM_X.

Referenced by TrajectoriesHandler::computeEmissions(), MSDevice_Emissions::notifyMove(), MSMeanData_Emissions::MSLaneMeanDataValues::notifyMoveInternal(), MSDevice_Emissions::notifyMoveInternal(), single(), MSEmissionExport::write(), and MSFullExport::writeVehicles().

◆ computeDefault()

double PollutantsInterface::computeDefault ( const SUMOEmissionClass  c,
const EmissionType  e,
const double  v,
const double  a,
const double  slope,
const double  tt,
const std::map< int, double > *  param = 0 
)
static

Returns the amount of emitted pollutant given the vehicle type and default values for the state (in mg)

Parameters
[in]cThe vehicle emission class
[in]ethe type of emission (CO, CO2, ...)
[in]vThe vehicle's average velocity
[in]aThe vehicle's average acceleration
[in]slopeThe road's slope at vehicle's position [deg]
{in]tt the time the vehicle travels
Returns
The amount emitted by the given vehicle class [mg]

Definition at line 163 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::compute(), and myHelpers.

Referenced by ROEdge::getEmissionEffort(), and MSMeanData_Emissions::MSLaneMeanDataValues::write().

◆ getAllClasses()

const std::vector< SUMOEmissionClass > PollutantsInterface::getAllClasses ( )
static

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

Definition at line 72 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::addAllClassesInto(), and myHelpers.

Referenced by main().

◆ getAllClassesStr()

const std::vector< std::string > & PollutantsInterface::getAllClassesStr ( )
static

◆ getAmitranVehicleClass()

std::string PollutantsInterface::getAmitranVehicleClass ( const SUMOEmissionClass  c)
static

Returns the vehicle class described by the given emission class.

Parameters
[in]cThe vehicle emission class
Returns
The Amitran string describing the vehicle class

Definition at line 124 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getAmitranVehicleClass(), and myHelpers.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ getClass()

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

Returns the emission class fittig the given parameters.

Parameters
[in]baseThe base emission class to derive from
[in]vClassThe vehicle class description (like "truck")
[in]eClassThe emission class description (like "Euro5")
[in]fuelThe fuel type (like "Diesel")
[in]weightThe weight in kg
Returns
The best fitting emission class related to the base

Definition at line 117 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getClass(), and myHelpers.

Referenced by TrajectoriesHandler::myStartElement().

◆ getClassByName()

SUMOEmissionClass PollutantsInterface::getClassByName ( const std::string &  eClass,
const SUMOVehicleClass  vc = SVC_IGNORING 
)
static

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

Definition at line 53 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getClassByName(), getName(), and myHelpers.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), ROEdge::buildTimeLines(), main(), GNEVehicleType::setAttribute(), and SUMOVTypeParameter::VClassDefaultValues::VClassDefaultValues().

◆ getEnergyHelper()

static const HelpersEnergy& PollutantsInterface::getEnergyHelper ( )
inlinestatic

◆ getEuroClass()

int PollutantsInterface::getEuroClass ( const SUMOEmissionClass  c)
static

Returns the Euro norm described by the given emission class.

Parameters
[in]cThe vehicle emission class
Returns
A value between 0 and 6 (inclusive)

Definition at line 136 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getEuroClass(), and myHelpers.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ getFuel()

std::string PollutantsInterface::getFuel ( const SUMOEmissionClass  c)
static

Returns the fuel type of the given emission class.

Parameters
[in]cThe vehicle emission class
Returns
"Diesel", "Gasoline", "HybridDiesel", or "HybridGasoline"

Definition at line 130 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getFuel(), and myHelpers.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ getModifiedAccel()

double PollutantsInterface::getModifiedAccel ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope 
)
static

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

Definition at line 170 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getModifiedAccel(), and myHelpers.

Referenced by TrajectoriesHandler::computeEmissions().

◆ getName()

std::string PollutantsInterface::getName ( const SUMOEmissionClass  c)
static

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

Definition at line 99 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getClassName(), and myHelpers.

Referenced by getAllClassesStr(), GNEVehicleType::getAttribute(), getClassByName(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), main(), GNEVehicleType::overwriteVType(), MSEmissionExport::write(), SUMOVTypeParameter::write(), MSFullExport::writeVehicles(), and TrajectoriesHandler::writeXMLEmissions().

◆ getWeight()

double PollutantsInterface::getWeight ( const SUMOEmissionClass  c)
static

Returns a representative weight for the given emission class see http://colombo-fp7.eu/deliverables/COLOMBO_D4.2_ExtendedPHEMSUMO_v1.7.pdf.

Parameters
[in]cThe vehicle emission class
Returns
the weight in kg if it matters, 0 otherwise

Definition at line 142 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::getWeight(), and myHelpers.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ isHeavy()

bool PollutantsInterface::isHeavy ( const SUMOEmissionClass  c)
static

Checks whether the emission class describes a bus, truck or similar vehicle.

Parameters
[in]cThe vehicle emission class
Returns
whether it describes a heavy vehicle

Definition at line 105 of file PollutantsInterface.cpp.

References HEAVY_BIT.

Referenced by HelpersHarmonoise::computeNoise().

◆ isSilent()

bool PollutantsInterface::isSilent ( const SUMOEmissionClass  c)
static

Checks whether the emission class describes an electric or similar silent vehicle.

Parameters
[in]cThe vehicle emission class
Returns
whether it describes a silent vehicle

Definition at line 111 of file PollutantsInterface.cpp.

References PollutantsInterface::Helper::isSilent(), and myHelpers.

Referenced by HelpersHarmonoise::computeNoise().

Field Documentation

◆ HEAVY_BIT

const int PollutantsInterface::HEAVY_BIT = 1 << 15
static

◆ myAllClassesStr

std::vector< std::string > PollutantsInterface::myAllClassesStr
staticprivate

get all emission classes in strin format

Definition at line 395 of file PollutantsInterface.h.

Referenced by getAllClassesStr().

◆ myEnergyHelper

HelpersEnergy PollutantsInterface::myEnergyHelper
staticprivate

Instance of EnergyHelper which gets cleaned up automatically.

Definition at line 389 of file PollutantsInterface.h.

Referenced by getEnergyHelper().

◆ myHBEFA2Helper

HelpersHBEFA PollutantsInterface::myHBEFA2Helper
staticprivate

Instance of HBEFA2Helper which gets cleaned up automatically.

Definition at line 380 of file PollutantsInterface.h.

◆ myHBEFA3Helper

HelpersHBEFA3 PollutantsInterface::myHBEFA3Helper
staticprivate

Instance of HBEFA3Helper which gets cleaned up automatically.

Definition at line 383 of file PollutantsInterface.h.

◆ myHelpers

◆ myPHEMlightHelper

HelpersPHEMlight PollutantsInterface::myPHEMlightHelper
staticprivate

Instance of PHEMlightHelper which gets cleaned up automatically.

Definition at line 386 of file PollutantsInterface.h.

◆ ZERO_EMISSIONS

const int PollutantsInterface::ZERO_EMISSIONS = 0
static

the first class in each model representing a zero emission vehicle

Definition at line 261 of file PollutantsInterface.h.

Referenced by HelpersHBEFA::compute(), HelpersEnergy::HelpersEnergy(), and HelpersHBEFA::HelpersHBEFA().


The documentation for this class was generated from the following files:
PollutantsInterface::myEnergyHelper
static HelpersEnergy myEnergyHelper
Instance of EnergyHelper which gets cleaned up automatically.
Definition: PollutantsInterface.h:389
PollutantsInterface::myHBEFA2Helper
static HelpersHBEFA myHBEFA2Helper
Instance of HBEFA2Helper which gets cleaned up automatically.
Definition: PollutantsInterface.h:380
PollutantsInterface::myHBEFA3Helper
static HelpersHBEFA3 myHBEFA3Helper
Instance of HBEFA3Helper which gets cleaned up automatically.
Definition: PollutantsInterface.h:383
PollutantsInterface::myPHEMlightHelper
static HelpersPHEMlight myPHEMlightHelper
Instance of PHEMlightHelper which gets cleaned up automatically.
Definition: PollutantsInterface.h:386