21 #ifndef PollutantsInterface_h 22 #define PollutantsInterface_h 86 : CO2(co2), CO(co), HC(hc), fuel(f), NOx(nox), PMx(pmx) {
97 fuel += scale * a.
fuel;
113 Helper(std::string name) : myName(name) {}
133 if (myEmissionClassStrings.hasString(eClass)) {
134 return myEmissionClassStrings.get(eClass);
136 std::string eclower = eClass;
137 std::transform(eclower.begin(), eclower.end(), eclower.begin(), tolower);
138 return myEmissionClassStrings.get(eclower);
146 return myName +
"/" + myEmissionClassStrings.getString(c);
155 return (c & 0xffffffff & ~
HEAVY_BIT) == 0;
172 const std::string&
fuel,
const std::string& eClass,
const double weight)
const {
252 myEmissionClassStrings.addKeysInto(list);
virtual int getEuroClass(const SUMOEmissionClass c) const
Returns the Euro emission class described by this emission class as described in the Amitran interfac...
static SUMOReal 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.
void addScaled(const Emissions &a, const SUMOReal scale=1.)
Add the values of the other struct to this one, scaling the values if needed.
Emissions(SUMOReal co2=0, SUMOReal co=0, SUMOReal hc=0, SUMOReal f=0, SUMOReal nox=0, SUMOReal pmx=0)
Constructor, intializes all members.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void addAllClassesInto(std::vector< SUMOEmissionClass > &list) const
Add all known emission classes of this model to the given container.
static Emissions computeAll(const SUMOEmissionClass c, const double v, const double a, const double slope)
Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or ml/s for fu...
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 accelerati...
virtual bool isSilent(const SUMOEmissionClass c)
Returns whether the class denotes a silent vehicle for interfacing with the noise model...
EmissionType
Enumerating all emission types, including fuel.
virtual SUMOReal getWeight(const SUMOEmissionClass c) const
Returns a reference weight in kg described by this emission class as described in the Amitran interfa...
Storage for collected values of all emission types.
const std::string myName
the name of the model
const std::string getClassName(const SUMOEmissionClass c) const
Returns the complete name of the emission class including the model.
#define UNUSED_PARAMETER(x)
static const int HEAVY_BIT
the bit to set for denoting heavy vehicles
Helper methods for PHEMlight-based emission computation.
static const int ZERO_EMISSIONS
the first class in each model representing a zero emission vehicle
const std::string & getName() const
Returns the name of the model.
static Helper * myHelpers[]
the known model helpers
static std::string getAmitranVehicleClass(const SUMOEmissionClass c)
Returns the vehicle class described by the given emission class.
virtual std::string getAmitranVehicleClass(const SUMOEmissionClass c) const
Returns the vehicle class described by this emission class as described in the Amitran interface (Pas...
static HelpersPHEMlight myPHEMlightHelper
Instance of PHEMlightHelper which gets cleaned up automatically.
abstract superclass for the model helpers
static SUMOReal computeDefault(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const SUMOReal tt)
Returns the amount of emitted pollutant given the vehicle type and default values for the state (in m...
Helper methods for HBEFA3-based emission computation.
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 HelpersHBEFA3 myHBEFA3Helper
Instance of HBEFA3Helper which gets cleaned up automatically.
static const std::vector< SUMOEmissionClass > getAllClasses()
Checks whether the string describes a known vehicle class.
static bool isSilent(const SUMOEmissionClass c)
Checks whether the emission class describes an electric or similar silent vehicle.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
static bool isHeavy(const SUMOEmissionClass c)
Checks whether the emission class describes a bus, truck or similar vehicle.
static int getEuroClass(const SUMOEmissionClass c)
Returns the Euro norm described by the given emission class.
Helper(std::string name)
Constructor, intializes the name.
Helper methods for HBEFA-based emission computation.
static SUMOReal compute(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope)
Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fue...
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...
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
StringBijection< SUMOEmissionClass > myEmissionClassStrings
Mapping between emission class names and integer representations.
static HelpersHBEFA myHBEFA2Helper
Instance of HBEFA2Helper which gets cleaned up automatically.
static SUMOReal getMaxAccel(SUMOEmissionClass c, double v, double a, double slope)
Returns the maximum possible acceleration.
vehicles ignoring classes
static std::string getFuel(const SUMOEmissionClass c)
Returns the fuel type of the given emission class.
Helper methods for PHEMlight-based emission computation.
virtual std::string getFuel(const SUMOEmissionClass c) const
Returns the fuel type described by this emission class as described in the Amitran interface (Gasolin...
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 ask...