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

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

#include <PollutantsInterface.h>

Collaboration diagram for PollutantsInterface:
[legend]

Data Structures

struct  Emissions
 Storage for collected values of all emission types. More...
 
class  Helper
 zero emission model, used as superclass for the other 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 EnergyParams *param)
 Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fuel)
 
static Emissions computeAll (const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param)
 Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or ml/s for fuel)
 
static double computeDefault (const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const double tt, const EnergyParams *param)
 Returns the amount of emitted pollutant given the vehicle type and default values for the state (in mg)
 
static const std::vector< SUMOEmissionClassgetAllClasses ()
 Checks whether the string describes a known vehicle class.
 
static const std::vector< std::string > & getAllClassesStr ()
 Get all SUMOEmissionClass in string format.
 
static std::string getAmitranVehicleClass (const SUMOEmissionClass c)
 Returns the vehicle class described by the given emission class.
 
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.
 
static SUMOEmissionClass getClassByName (const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
 Checks whether the string describes a known vehicle class.
 
static double getCoastingDecel (const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param)
 Returns the coasting deceleration value, useful for comparing with external PHEMlight references.
 
static const HelpersEnergygetEnergyHelper ()
 get energy helper
 
static int getEuroClass (const SUMOEmissionClass c)
 Returns the Euro norm described by the given emission class.
 
static std::string getFuel (const SUMOEmissionClass c)
 Returns the fuel type of the given emission class.
 
static double getModifiedAccel (const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams *param)
 Returns the adapted acceleration value, useful for comparing with external PHEMlight references.
 
static std::string getName (const SUMOEmissionClass c)
 Checks whether the string describes a known vehicle class.
 
static std::string getPollutantName (const EmissionType e)
 return the name for the given emission type
 
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.
 
static bool isHeavy (const SUMOEmissionClass c)
 Checks whether the emission class describes a bus, truck or similar vehicle.
 
static bool isSilent (const SUMOEmissionClass c)
 Checks whether the emission class describes an electric or similar silent vehicle.
 

Static Public Attributes

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

Static Private Attributes

static std::vector< std::string > myAllClassesStr
 get all emission classes in string format
 
static HelpersEnergy myEnergyHelper
 Instance of EnergyHelper which gets cleaned up automatically.
 
static HelpersHBEFA myHBEFA2Helper
 Instance of HBEFA2Helper which gets cleaned up automatically.
 
static HelpersHBEFA3 myHBEFA3Helper
 Instance of HBEFA3Helper which gets cleaned up automatically.
 
static HelpersHBEFA4 myHBEFA4Helper
 Instance of HBEFA4Helper which gets cleaned up automatically.
 
static HelpermyHelpers []
 the known model helpers
 
static HelpersMMPEVEM myMMPEVEMHelper
 Instance of HelpersMMPEVEM which gets cleaned up automatically.
 
static HelpersPHEMlight5 myPHEMlight5Helper
 Instance of PHEMlight5Helper which gets cleaned up automatically.
 
static HelpersPHEMlight myPHEMlightHelper
 Instance of PHEMlightHelper which gets cleaned up automatically.
 
static Helper myZeroHelper
 Instance of Helper which gets cleaned up automatically.
 

Detailed Description

Helper methods for PHEMlight-based emission computation.

Definition at line 52 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 56 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 EnergyParams param 
)
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 353 of file PollutantsInterface.cpp.

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

Referenced by ROEdge::buildTimeLines(), MSDevice_StationFinder::estimateConsumption(), MSBaseVehicle::getEmissions(), and MSDevice_Battery::notifyMove().

Here is the caller graph for this function:

◆ computeAll()

PollutantsInterface::Emissions PollutantsInterface::computeAll ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope,
const EnergyParams param 
)
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 359 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::notifyIdle(), MSMeanData_Emissions::MSLaneMeanDataValues::notifyIdle(), MSDevice_Emissions::notifyMove(), MSDevice_Emissions::notifyMoveInternal(), MSMeanData_Emissions::MSLaneMeanDataValues::notifyMoveInternal(), single(), MSEmissionExport::write(), and MSFullExport::writeVehicles().

Here is the caller graph for this function:

◆ computeDefault()

double PollutantsInterface::computeDefault ( const SUMOEmissionClass  c,
const EmissionType  e,
const double  v,
const double  a,
const double  slope,
const double  tt,
const EnergyParams param 
)
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
[in]paramparameter of the emission model affecting the computation
Returns
The amount emitted by the given vehicle class [mg]

Definition at line 368 of file PollutantsInterface.cpp.

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

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

Here is the caller graph for this function:

◆ 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 255 of file PollutantsInterface.cpp.

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

Referenced by main().

Here is the caller graph for this function:

◆ getAllClassesStr()

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

Get all SUMOEmissionClass in string format.

Definition at line 265 of file PollutantsInterface.cpp.

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

Referenced by GNEVehicleTypeDialog::VTypeAttributes::buildAttributesA(), GNEAttributeCarrier::fillDemandElements(), and GNEVType::isValid().

Here is the caller graph for this function:

◆ 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 329 of file PollutantsInterface.cpp.

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

Referenced by MSAmitranTrajectories::writeVehicle().

Here is the caller graph for this function:

◆ 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 322 of file PollutantsInterface.cpp.

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

Referenced by TrajectoriesHandler::myStartElement().

Here is the caller graph for this function:

◆ 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 228 of file PollutantsInterface.cpp.

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

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

Here is the caller graph for this function:

◆ getCoastingDecel()

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

Returns the coasting deceleration 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]
[in]paramparameter of the emission model affecting the computation
Returns
the coasting deceleration

Definition at line 381 of file PollutantsInterface.cpp.

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

Referenced by PollutantsInterface::Helper::getCoastingDecel(), and TrajectoriesHandler::writeEmissions().

Here is the caller graph for this function:

◆ getEnergyHelper()

const HelpersEnergy & PollutantsInterface::getEnergyHelper ( )
static

get energy helper

Definition at line 387 of file PollutantsInterface.cpp.

References myEnergyHelper.

Referenced by MSDevice_ElecHybrid::acceleration(), MSDevice_ElecHybrid::consumption(), and MSDevice_Battery::notifyMove().

Here is the caller graph for this function:

◆ 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 341 of file PollutantsInterface.cpp.

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

Referenced by MSAmitranTrajectories::writeVehicle().

Here is the caller graph for this function:

◆ 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", "HybridGasoline", or "Electricity"

Definition at line 335 of file PollutantsInterface.cpp.

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

Referenced by MSDevice_Battery::MSDevice_Battery(), and MSAmitranTrajectories::writeVehicle().

Here is the caller graph for this function:

◆ getModifiedAccel()

double PollutantsInterface::getModifiedAccel ( const SUMOEmissionClass  c,
const double  v,
const double  a,
const double  slope,
const EnergyParams param 
)
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 375 of file PollutantsInterface.cpp.

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

Referenced by TrajectoriesHandler::computeEmissions().

Here is the caller graph for this function:

◆ 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 282 of file PollutantsInterface.cpp.

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

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

Here is the caller graph for this function:

◆ getPollutantName()

std::string PollutantsInterface::getPollutantName ( const EmissionType  e)
static

return the name for the given emission type

Definition at line 288 of file PollutantsInterface.cpp.

References CO, CO2, ELEC, FUEL, HC, NO_X, PM_X, and toString().

◆ 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, -1 otherwise

Definition at line 347 of file PollutantsInterface.cpp.

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

Referenced by EnergyParams::EnergyParams(), and MSAmitranTrajectories::writeVehicle().

Here is the caller graph for this function:

◆ 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 310 of file PollutantsInterface.cpp.

References HEAVY_BIT.

Referenced by HelpersHarmonoise::computeNoise().

Here is the caller graph for this function:

◆ 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 316 of file PollutantsInterface.cpp.

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

Referenced by HelpersHarmonoise::computeNoise().

Here is the caller graph for this function:

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 string format

Definition at line 400 of file PollutantsInterface.h.

Referenced by getAllClassesStr().

◆ myEnergyHelper

HelpersEnergy PollutantsInterface::myEnergyHelper
staticprivate

Instance of EnergyHelper which gets cleaned up automatically.

Definition at line 385 of file PollutantsInterface.h.

Referenced by getEnergyHelper().

◆ myHBEFA2Helper

HelpersHBEFA PollutantsInterface::myHBEFA2Helper
staticprivate

Instance of HBEFA2Helper which gets cleaned up automatically.

Definition at line 376 of file PollutantsInterface.h.

Referenced by getClassByName().

◆ myHBEFA3Helper

HelpersHBEFA3 PollutantsInterface::myHBEFA3Helper
staticprivate

Instance of HBEFA3Helper which gets cleaned up automatically.

Definition at line 379 of file PollutantsInterface.h.

◆ myHBEFA4Helper

HelpersHBEFA4 PollutantsInterface::myHBEFA4Helper
staticprivate

Instance of HBEFA4Helper which gets cleaned up automatically.

Definition at line 394 of file PollutantsInterface.h.

◆ myHelpers

PollutantsInterface::Helper * PollutantsInterface::myHelpers
staticprivate
Initial value:
= {
}
static HelpersHBEFA3 myHBEFA3Helper
Instance of HBEFA3Helper which gets cleaned up automatically.
static HelpersPHEMlight5 myPHEMlight5Helper
Instance of PHEMlight5Helper which gets cleaned up automatically.
static HelpersPHEMlight myPHEMlightHelper
Instance of PHEMlightHelper which gets cleaned up automatically.
static HelpersHBEFA4 myHBEFA4Helper
Instance of HBEFA4Helper which gets cleaned up automatically.
static HelpersHBEFA myHBEFA2Helper
Instance of HBEFA2Helper which gets cleaned up automatically.
static HelpersEnergy myEnergyHelper
Instance of EnergyHelper which gets cleaned up automatically.
static HelpersMMPEVEM myMMPEVEMHelper
Instance of HelpersMMPEVEM which gets cleaned up automatically.
static Helper myZeroHelper
Instance of Helper which gets cleaned up automatically.

the known model helpers

Definition at line 53 of file PollutantsInterface.h.

Referenced by compute(), computeAll(), computeDefault(), getAllClasses(), getAllClassesStr(), getAmitranVehicleClass(), getClass(), getClassByName(), getCoastingDecel(), getEuroClass(), getFuel(), getModifiedAccel(), getName(), getWeight(), and isSilent().

◆ myMMPEVEMHelper

HelpersMMPEVEM PollutantsInterface::myMMPEVEMHelper
staticprivate

Instance of HelpersMMPEVEM which gets cleaned up automatically.

Definition at line 388 of file PollutantsInterface.h.

◆ myPHEMlight5Helper

HelpersPHEMlight5 PollutantsInterface::myPHEMlight5Helper
staticprivate

Instance of PHEMlight5Helper which gets cleaned up automatically.

Definition at line 391 of file PollutantsInterface.h.

◆ myPHEMlightHelper

HelpersPHEMlight PollutantsInterface::myPHEMlightHelper
staticprivate

Instance of PHEMlightHelper which gets cleaned up automatically.

Definition at line 382 of file PollutantsInterface.h.

◆ myZeroHelper

PollutantsInterface::Helper PollutantsInterface::myZeroHelper
staticprivate

Instance of Helper which gets cleaned up automatically.

Definition at line 373 of file PollutantsInterface.h.

Referenced by getClassByName().

◆ ZERO_EMISSIONS

const int PollutantsInterface::ZERO_EMISSIONS = 0
static

the first class in each model representing a zero emission vehicle

Definition at line 242 of file PollutantsInterface.h.


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