SUMO - Simulation of Urban MObility
CEP.h
Go to the documentation of this file.
1 #ifndef PHEMlightCEP
2 #define PHEMlightCEP
3 
4 #define _USE_MATH_DEFINES
5 #include <string>
6 #include <map>
7 #include <vector>
8 #include <cmath>
9 #include <utility>
10 
11 //C# TO C++ CONVERTER NOTE: Forward class declarations:
12 namespace PHEMlightdll { class Helpers; }
13 
14 
15 namespace PHEMlightdll {
16  class CEP {
17  //--------------------------------------------------------------------------------------------------
18  // Constructors
19  //--------------------------------------------------------------------------------------------------
20 
21  public:
22  CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, std::vector<double>& transmissionGearRatios, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1, const std::string& vehicelFuelType, std::vector<std::vector<double> >& matrixFC, std::vector<std::string>& headerLinePollutants, std::vector<std::vector<double> >& matrixPollutants, std::vector<std::vector<double> >& matrixSpeedRotational, std::vector<std::vector<double> >& normedDragTable, double idlingFC, std::vector<double>& idlingPollutants);
23 
24 
25  //--------------------------------------------------------------------------------------------------
26  // Members
27  //--------------------------------------------------------------------------------------------------
28 
29  private:
31  public:
32  const bool& getHeavyVehicle() const;
33 
34  private:
35  std::string _fuelType;
36  public:
37  const std::string& getFuelType() const;
38 
39  public:
43  };
44  private:
46  public:
47  const NormalizingType& getNormalizingTypeX() const;
48 
49  private:
50  double _ratedPower;
51  public:
52  const double& getRatedPower() const;
53  void setRatedPower(const double& value);
54 
55  private:
57  public:
58  const double& getNormalizingPower() const;
59 
60  private:
61  double _drivingPower;
62  public:
63  const double& getDrivingPower() const;
64  void setDrivingPower(const double& value);
65 
66 
67 
68  protected:
69  double _massVehicle;
73  double _cWValue;
74  double _resistanceF0;
75  double _resistanceF1;
76  double _resistanceF2;
77  double _resistanceF3;
78  double _resistanceF4;
79  double _axleRatio;
80  double _auxPower;
81  double _pNormV0;
82  double _pNormP0;
83  double _pNormV1;
84  double _pNormP1;
85 
89 
90  std::vector<double> _speedPatternRotational;
91  std::vector<double> _powerPatternFC;
92  std::vector<double> _normalizedPowerPatternFC;
93  std::vector<double> _normailzedPowerPatternPollutants;
94  std::vector<double> _powerPatternPollutants;
95 
96  std::vector<double> _cepCurveFC;
97  std::vector<double> _normedCepCurveFC;
98  std::vector<double> _gearTransmissionCurve;
99  std::vector<double> _speedCurveRotational;
100  std::map<std::string, std::vector<double> > _cepCurvePollutants;
101  std::map<std::string, std::vector<double> > _cepNormalizedCurvePollutants;
103  std::map<std::string, double> _idlingValuesPollutants;
104 
105  std::vector<double> _nNormTable;
106  std::vector<double> _dragNormTable;
107 
108 
109  //--------------------------------------------------------------------------------------------------
110  // Methods
111  //--------------------------------------------------------------------------------------------------
112 
113  public:
114  double CalcPower(double speed, double acc, double gradient);
115 
116  double CalcEngPower(double power);
117 
118  double GetEmission(const std::string& pollutant, double power, double speed, Helpers* VehicleClass);
119 
120 
121  double GetCO2Emission(double _FC, double _CO, double _HC, Helpers* VehicleClass);
122 
123  double GetDecelCoast(double speed, double acc, double gradient);
124 
125  double GetRotationalCoeffecient(double speed);
126 
127 
128  private:
129  void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector<double>& pattern, double value);
130 
131  double Interpolate(double px, double p1, double p2, double e1, double e2);
132 
133  //--------------------------------------------------------------------------------------------------
134  // Operators for fleetmix
135  //--------------------------------------------------------------------------------------------------
136 
137 
138  private:
140  };
141 }
142 
143 
144 #endif //#ifndef PHEMlightCEP
std::vector< double > _speedPatternRotational
Definition: CEP.h:90
double _resistanceF0
Definition: CEP.h:74
double GetEmission(const std::string &pollutant, double power, double speed, Helpers *VehicleClass)
Definition: CEP.cpp:206
std::vector< double > _normailzedPowerPatternPollutants
Definition: CEP.h:93
std::vector< double > _dragNormTable
Definition: CEP.h:106
double _massVehicle
Definition: CEP.h:69
std::map< std::string, std::vector< double > > _cepCurvePollutants
Definition: CEP.h:100
void setDrivingPower(const double &value)
Definition: CEP.cpp:172
double _effectiveWheelDiameter
Definition: CEP.h:88
std::vector< double > _nNormTable
Definition: CEP.h:105
const double & getNormalizingPower() const
Definition: CEP.cpp:164
double _pNormP0
Definition: CEP.h:82
double _engineRatedSpeed
Definition: CEP.h:86
void InitializeInstanceFields()
Definition: CEP.cpp:391
void setRatedPower(const double &value)
Definition: CEP.cpp:160
double _pNormV1
Definition: CEP.h:83
double _drivingPower
Definition: CEP.h:61
double _resistanceF1
Definition: CEP.h:75
double GetRotationalCoeffecient(double speed)
Definition: CEP.cpp:332
const double & getDrivingPower() const
Definition: CEP.cpp:168
double _auxPower
Definition: CEP.h:80
double _engineIdlingSpeed
Definition: CEP.h:87
std::map< std::string, double > _idlingValuesPollutants
Definition: CEP.h:103
double _resistanceF2
Definition: CEP.h:76
std::vector< double > _normedCepCurveFC
Definition: CEP.h:97
NormalizingType _normalizingType
Definition: CEP.h:45
const double & getRatedPower() const
Definition: CEP.cpp:156
double _pNormP1
Definition: CEP.h:84
std::map< std::string, std::vector< double > > _cepNormalizedCurvePollutants
Definition: CEP.h:101
double _normalizingPower
Definition: CEP.h:56
std::vector< double > _normalizedPowerPatternFC
Definition: CEP.h:92
double _cWValue
Definition: CEP.h:73
double GetDecelCoast(double speed, double acc, double gradient)
Definition: CEP.cpp:297
double CalcEngPower(double power)
Definition: CEP.cpp:195
bool _heavyVehicle
Definition: CEP.h:30
double _resistanceF4
Definition: CEP.h:78
std::vector< double > _speedCurveRotational
Definition: CEP.h:99
std::vector< double > _gearTransmissionCurve
Definition: CEP.h:98
double _pNormV0
Definition: CEP.h:81
double _resistanceF3
Definition: CEP.h:77
CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, std::vector< double > &transmissionGearRatios, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1, const std::string &vehicelFuelType, std::vector< std::vector< double > > &matrixFC, std::vector< std::string > &headerLinePollutants, std::vector< std::vector< double > > &matrixPollutants, std::vector< std::vector< double > > &matrixSpeedRotational, std::vector< std::vector< double > > &normedDragTable, double idlingFC, std::vector< double > &idlingPollutants)
Definition: CEP.cpp:8
std::vector< double > _powerPatternFC
Definition: CEP.h:91
std::vector< double > _cepCurveFC
Definition: CEP.h:96
const NormalizingType & getNormalizingTypeX() const
Definition: CEP.cpp:152
double Interpolate(double px, double p1, double p2, double e1, double e2)
Definition: CEP.cpp:383
const bool & getHeavyVehicle() const
Definition: CEP.cpp:144
double _axleRatio
Definition: CEP.h:79
double _crossSectionalArea
Definition: CEP.h:72
std::vector< double > _powerPatternPollutants
Definition: CEP.h:94
double _idlingValueFC
Definition: CEP.h:102
double CalcPower(double speed, double acc, double gradient)
Definition: CEP.cpp:176
double _vehicleLoading
Definition: CEP.h:70
double _ratedPower
Definition: CEP.h:50
const std::string & getFuelType() const
Definition: CEP.cpp:148
void FindLowerUpperInPattern(int &lowerIndex, int &upperIndex, std::vector< double > &pattern, double value)
Definition: CEP.cpp:341
double GetCO2Emission(double _FC, double _CO, double _HC, Helpers *VehicleClass)
Definition: CEP.cpp:267
std::string _fuelType
Definition: CEP.h:35
double _vehicleMassRot
Definition: CEP.h:71