SUMO - Simulation of Urban MObility
HelpersPHEMlight.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Helper methods for PHEMlight-based emission computation
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2013-2012 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef HelpersPHEMlight_h
22 #define HelpersPHEMlight_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #define INTERNAL_PHEM
35 
36 #include <vector>
37 #include <limits>
38 #include <cmath>
39 #ifdef INTERNAL_PHEM
40 #include "PHEMCEPHandler.h"
41 #endif
45 #include <utils/common/StdDefs.h>
46 #include "PollutantsInterface.h"
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
57 public:
58  static const int PHEMLIGHT_BASE = 2 << 16;
59 
60 
64 
65 
70  SUMOEmissionClass getClassByName(const std::string& eClass, const SUMOVehicleClass vc);
71 
72 
81  SUMOEmissionClass getClass(const SUMOEmissionClass base, const std::string& vClass, const std::string& fuel, const std::string& eClass, const double weight) const;
82 
87  std::string getAmitranVehicleClass(const SUMOEmissionClass c) const;
88 
93  std::string getFuel(const SUMOEmissionClass c) const;
94 
99  int getEuroClass(const SUMOEmissionClass c) const;
100 
106  double getWeight(const SUMOEmissionClass c) const;
107 
115  double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map<int, double>* param) const;
116 
117 private:
125  double getEmission(const PHEMCEP* oldCep, PHEMlightdll::CEP* currCep, const std::string& e, const double p, const double v) const;
126 
128  int myIndex;
131  std::map<SUMOEmissionClass, PHEMlightdll::CEP*> myCEPs;
132 };
133 
134 
135 #endif
136 
137 /****************************************************************************/
138 
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:59
double getWeight(const SUMOEmissionClass c) const
Returns a reference weight in kg described by this emission class as described in the Amitran interfa...
double getEmission(const PHEMCEP *oldCep, PHEMlightdll::CEP *currCep, const std::string &e, const double p, const double v) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
int myIndex
the index of the next class
HelpersPHEMlight()
Constructor.
EmissionType
Enumerating all emission types, including fuel.
std::string getFuel(const SUMOEmissionClass c) const
Returns the fuel type described by this emission class as described in the Amitran interface (Gasolin...
Helper methods for PHEMlight-based emission computation.
std::map< SUMOEmissionClass, PHEMlightdll::CEP * > myCEPs
abstract superclass for the model helpers
int SUMOEmissionClass
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param) const
Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel...
static const int PHEMLIGHT_BASE
SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc)
Checks whether the string describes a known vehicle class.
int getEuroClass(const SUMOEmissionClass c) const
Returns the Euro emission class described by this emission class as described in the Amitran interfac...
PHEMlightdll::Helpers myHelper
PHEMlightdll::CEPHandler myCEPHandler
std::string getAmitranVehicleClass(const SUMOEmissionClass c) const
Returns the vehicle class described by this emission class as described in the Amitran interface (Pas...
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.