SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PollutantsInterface::Helper Class Reference

abstract superclass for the model helpers More...

#include <PollutantsInterface.h>

Inheritance diagram for PollutantsInterface::Helper:
HelpersHBEFA HelpersHBEFA3 HelpersPHEMlight

Public Member Functions

void addAllClassesInto (std::vector< SUMOEmissionClass > &list) const
 Add all known emission classes of this model to the given container.
virtual SUMOReal compute (const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope) const =0
 Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fuel)
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.
const std::string getClassName (const SUMOEmissionClass c) const
 Returns the complete name of the emission class including the model.
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.
const std::string & getName () const
 Returns the name of the model.
 Helper (std::string name)
 Constructor, intializes the name.
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.
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.
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".
virtual std::string getFuel (const SUMOEmissionClass c) const
 Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) Default implementation returns always "Gasoline".
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.
virtual SUMOReal 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.

Protected Attributes

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

Private Member Functions

Helperoperator= (const Helper &)

Detailed Description

abstract superclass for the model helpers

Definition at line 108 of file PollutantsInterface.h.

Constructor & Destructor Documentation

PollutantsInterface::Helper::Helper ( std::string  name)
inline

Constructor, intializes the name.

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

Definition at line 113 of file PollutantsInterface.h.

Member Function Documentation

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

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 StringBijection< T >::addKeysInto(), and myEmissionClassStrings.

Referenced by PollutantsInterface::getAllClasses().

virtual SUMOReal PollutantsInterface::Helper::compute ( const SUMOEmissionClass  c,
const EmissionType  e,
const double  v,
const double  a,
const double  slope 
) const
pure virtual

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 [°]
Returns
The amount emitted by the given emission class when moving with the given velocity and acceleration [mg/s or ml/s]

Implemented in HelpersPHEMlight, HelpersHBEFA3, and HelpersHBEFA.

Referenced by PollutantsInterface::compute(), PollutantsInterface::computeAll(), and PollutantsInterface::computeDefault().

virtual std::string PollutantsInterface::Helper::getAmitranVehicleClass ( const SUMOEmissionClass  c) const
inlinevirtual

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

Definition at line 185 of file PollutantsInterface.h.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getAmitranVehicleClass().

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

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

Definition at line 171 of file PollutantsInterface.h.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getClass().

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

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

Definition at line 131 of file PollutantsInterface.h.

References StringBijection< T >::get(), StringBijection< T >::hasString(), myEmissionClassStrings, and UNUSED_PARAMETER.

Referenced by PollutantsInterface::getClassByName().

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

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 StringBijection< T >::getString(), myEmissionClassStrings, and myName.

Referenced by PollutantsInterface::getName().

virtual int PollutantsInterface::Helper::getEuroClass ( const SUMOEmissionClass  c) const
inlinevirtual

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

Definition at line 205 of file PollutantsInterface.h.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getEuroClass().

virtual std::string PollutantsInterface::Helper::getFuel ( const SUMOEmissionClass  c) const
inlinevirtual

Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...) Default implementation returns always "Gasoline".

Parameters
[in]cthe emission class
Returns
the fuel type

Reimplemented in HelpersHBEFA3, and HelpersPHEMlight.

Definition at line 195 of file PollutantsInterface.h.

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getFuel().

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

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
inline

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

virtual SUMOReal PollutantsInterface::Helper::getWeight ( const SUMOEmissionClass  c) const
inlinevirtual

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

References UNUSED_PARAMETER.

Referenced by PollutantsInterface::getWeight().

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

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

Helper& PollutantsInterface::Helper::operator= ( const Helper )
private

Field Documentation

const std::string PollutantsInterface::Helper::myName
protected

the name of the model

Definition at line 258 of file PollutantsInterface.h.

Referenced by getClassName(), and getName().


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