SUMO - Simulation of Urban MObility
HelpersPHEMlight Class Reference

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

#include <HelpersPHEMlight.h>

Inheritance diagram for HelpersPHEMlight:
PollutantsInterface::Helper

Public Member Functions

void addAllClassesInto (std::vector< SUMOEmissionClass > &list) const
 Add all known emission classes of this model to the given container. More...
 
SUMOReal compute (const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope) const
 Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel) More...
 
std::string getAmitranVehicleClass (const SUMOEmissionClass c) const
 Returns the vehicle class described by this emission class as described in the Amitran interface (Passenger, ...) More...
 
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. More...
 
SUMOEmissionClass getClassByName (const std::string &eClass, const SUMOVehicleClass vc)
 Checks whether the string describes a known vehicle class. More...
 
const std::string getClassName (const SUMOEmissionClass c) const
 Returns the complete name of the emission class including the model. More...
 
int getEuroClass (const SUMOEmissionClass c) const
 Returns the Euro emission class described by this emission class as described in the Amitran interface (0, ..., 6) More...
 
std::string getFuel (const SUMOEmissionClass c) const
 Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) More...
 
SUMOReal getMaxAccel (SUMOEmissionClass c, double v, double a, double slope)
 Returns the maximum possible acceleration. More...
 
virtual SUMOReal getMaxAccel (SUMOEmissionClass c, double v, double a, double slope) const
 Returns the maximum possible acceleration or -1. if the model cannot determine the maximum acceleration. Default implementation returns always -1. More...
 
const std::string & getName () const
 Returns the name of the model. More...
 
SUMOReal 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). More...
 
 HelpersPHEMlight ()
 Constructor. More...
 
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...
 

Static Public Attributes

static const int PHEMLIGHT_BASE = 2 << 16
 

Protected Attributes

StringBijection< SUMOEmissionClassmyEmissionClassStrings
 Mapping between emission class names and integer representations. More...
 
const std::string myName
 the name of the model More...
 

Private Attributes

int myIndex
 the index of the next class More...
 

Detailed Description

Helper methods for PHEMlight-based emission computation.

Definition at line 49 of file HelpersPHEMlight.h.

Constructor & Destructor Documentation

HelpersPHEMlight::HelpersPHEMlight ( )

Constructor.

Definition at line 47 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings, and myIndex.

Member Function Documentation

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

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

Parameters
[in]listthe vector to add to

Definition at line 251 of file PollutantsInterface.h.

References PollutantsInterface::Helper::myEmissionClassStrings.

Referenced by PollutantsInterface::getAllClasses().

SUMOReal HelpersPHEMlight::compute ( const SUMOEmissionClass  c,
const PollutantsInterface::EmissionType  e,
const double  v,
const double  a,
const double  slope 
) 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 [°]
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]

Implements PollutantsInterface::Helper.

Definition at line 234 of file HelpersPHEMlight.cpp.

References PHEMCEP::CalcPower(), PollutantsInterface::CO, PollutantsInterface::CO2, PollutantsInterface::FUEL, PHEMCEPHandler::GetCep(), PHEMCEP::GetEmission(), PHEMCEPHandler::getHandlerInstance(), PHEMCEP::GetVehicleFuelType(), PollutantsInterface::HC, PollutantsInterface::NO_X, PollutantsInterface::PM_X, and SECONDS_PER_HOUR.

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

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

Reimplemented from PollutantsInterface::Helper.

Definition at line 155 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings.

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

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

Reimplemented from PollutantsInterface::Helper.

Definition at line 92 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings.

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 from PollutantsInterface::Helper.

Definition at line 53 of file HelpersPHEMlight.cpp.

References PHEMCEPHandler::getHandlerInstance(), PollutantsInterface::HEAVY_BIT, PollutantsInterface::Helper::myEmissionClassStrings, and myIndex.

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

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 145 of file PollutantsInterface.h.

References PollutantsInterface::Helper::myEmissionClassStrings, and PollutantsInterface::Helper::myName.

Referenced by PollutantsInterface::getName().

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

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

Reimplemented from PollutantsInterface::Helper.

Definition at line 191 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings.

std::string HelpersPHEMlight::getFuel ( const SUMOEmissionClass  c) const
virtual

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

Reimplemented from PollutantsInterface::Helper.

Definition at line 177 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings.

SUMOReal HelpersPHEMlight::getMaxAccel ( SUMOEmissionClass  c,
double  v,
double  a,
double  slope 
)

Returns the maximum possible acceleration.

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 [°]
Returns
The maximum possible acceleration

Definition at line 82 of file HelpersPHEMlight.cpp.

References PHEMCEPHandler::GetCep(), PHEMCEPHandler::getHandlerInstance(), and PHEMCEP::GetMaxAccel().

virtual SUMOReal PollutantsInterface::Helper::getMaxAccel ( SUMOEmissionClass  c,
double  v,
double  a,
double  slope 
) const
inlinevirtualinherited

Returns the maximum possible acceleration or -1. if the model cannot determine the maximum acceleration. Default implementation returns always -1.

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 [°]
Returns
The maximum possible acceleration

Definition at line 240 of file PollutantsInterface.h.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getMaxAccel().

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

Returns the name of the model.

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

Definition at line 118 of file PollutantsInterface.h.

References PollutantsInterface::Helper::myName.

SUMOReal HelpersPHEMlight::getWeight ( const SUMOEmissionClass  c) const
virtual

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

Reimplemented from PollutantsInterface::Helper.

Definition at line 211 of file HelpersPHEMlight.cpp.

References PollutantsInterface::Helper::myEmissionClassStrings.

virtual bool PollutantsInterface::Helper::isSilent ( const SUMOEmissionClass  c)
inlinevirtualinherited

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 154 of file PollutantsInterface.h.

References PollutantsInterface::HEAVY_BIT.

Referenced by PollutantsInterface::isSilent().

Field Documentation

int HelpersPHEMlight::myIndex
private

the index of the next class

Definition at line 122 of file HelpersPHEMlight.h.

Referenced by getClassByName(), and HelpersPHEMlight().

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

the name of the model

Definition at line 258 of file PollutantsInterface.h.

Referenced by PollutantsInterface::Helper::getClassName(), and PollutantsInterface::Helper::getName().

const int HelpersPHEMlight::PHEMLIGHT_BASE = 2 << 16
static

Definition at line 51 of file HelpersPHEMlight.h.


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