Eclipse SUMO - Simulation of Urban MObility
CEP.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2016-2019 German Aerospace Center (DLR) and others.
4 // PHEMlight module
5 // Copyright (C) 2016-2017 Technische Universitaet Graz, https://www.tugraz.at/
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 
20 
21 #ifndef PHEMlightCEP
22 #define PHEMlightCEP
23 
24 #define _USE_MATH_DEFINES
25 #include <string>
26 #include <map>
27 #include <vector>
28 #include <cmath>
29 #include <utility>
30 
31 //C# TO C++ CONVERTER NOTE: Forward class declarations:
32 namespace PHEMlightdll { class Helpers; }
33 
34 
35 namespace PHEMlightdll {
36  class CEP {
37  //--------------------------------------------------------------------------------------------------
38  // Constructors
39  //--------------------------------------------------------------------------------------------------
40 
41  public:
42  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);
43 
44 
45  //--------------------------------------------------------------------------------------------------
46  // Members
47  //--------------------------------------------------------------------------------------------------
48 
49  private:
51  public:
52  const bool& getHeavyVehicle() const;
53 
54  private:
55  std::string _fuelType;
56  public:
57  const std::string& getFuelType() const;
58 
59  public:
63  };
64  private:
66  public:
67  const NormalizingType& getNormalizingTypeX() const;
68 
69  private:
70  double _ratedPower;
71  public:
72  const double& getRatedPower() const;
73  void setRatedPower(const double& value);
74 
75  private:
77  public:
78  const double& getNormalizingPower() const;
79 
80  private:
81  double _drivingPower;
82  public:
83  const double& getDrivingPower() const;
84  void setDrivingPower(const double& value);
85 
86 
87 
88  protected:
89  double _massVehicle;
93  double _cWValue;
94  double _resistanceF0;
95  double _resistanceF1;
96  double _resistanceF2;
97  double _resistanceF3;
98  double _resistanceF4;
99  double _axleRatio;
100  double _auxPower;
101  double _pNormV0;
102  double _pNormP0;
103  double _pNormV1;
104  double _pNormP1;
105 
109 
110  std::vector<double> _speedPatternRotational;
111  std::vector<double> _powerPatternFC;
112  std::vector<double> _normalizedPowerPatternFC;
114  std::vector<double> _powerPatternPollutants;
115 
116  std::vector<double> _cepCurveFC;
117  std::vector<double> _normedCepCurveFC;
118  std::vector<double> _gearTransmissionCurve;
119  std::vector<double> _speedCurveRotational;
120  std::map<std::string, std::vector<double> > _cepCurvePollutants;
121  std::map<std::string, std::vector<double> > _cepNormalizedCurvePollutants;
123  std::map<std::string, double> _idlingValuesPollutants;
124 
125  std::vector<double> _nNormTable;
126  std::vector<double> _dragNormTable;
127 
128 
129  //--------------------------------------------------------------------------------------------------
130  // Methods
131  //--------------------------------------------------------------------------------------------------
132 
133  public:
134  double CalcPower(double speed, double acc, double gradient);
135 
136  double CalcEngPower(double power);
137 
138  double GetEmission(const std::string& pollutant, double power, double speed, Helpers* VehicleClass);
139 
140 
141  double GetCO2Emission(double _FC, double _CO, double _HC, Helpers* VehicleClass);
142 
143  double GetDecelCoast(double speed, double acc, double gradient);
144 
145  double GetRotationalCoeffecient(double speed);
146 
147 
148  private:
149  void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector<double>& pattern, double value);
150 
151  double Interpolate(double px, double p1, double p2, double e1, double e2);
152 
153  public:
154  double GetMaxAccel(double speed, double gradient);
155 
156  private:
157  double GetPMaxNorm(double speed);
158 
159  //--------------------------------------------------------------------------------------------------
160  // Operators for fleetmix
161  //--------------------------------------------------------------------------------------------------
162 
163 
164  private:
166  };
167 }
168 
169 
170 #endif //#ifndef PHEMlightCEP
PHEMlightdll::CEP::GetRotationalCoeffecient
double GetRotationalCoeffecient(double speed)
Definition: CEP.cpp:357
PHEMlightdll::CEP::setDrivingPower
void setDrivingPower(const double &value)
Definition: CEP.cpp:192
PHEMlightdll::CEP::_cepNormalizedCurvePollutants
std::map< std::string, std::vector< double > > _cepNormalizedCurvePollutants
Definition: CEP.h:121
PHEMlightdll::CEP::_ratedPower
double _ratedPower
Definition: CEP.h:70
PHEMlightdll::CEP::_idlingValueFC
double _idlingValueFC
Definition: CEP.h:122
PHEMlightdll::CEP::_cWValue
double _cWValue
Definition: CEP.h:93
PHEMlightdll::CEP::_speedPatternRotational
std::vector< double > _speedPatternRotational
Definition: CEP.h:110
PHEMlightdll::CEP::_vehicleLoading
double _vehicleLoading
Definition: CEP.h:90
PHEMlightdll::CEP::_dragNormTable
std::vector< double > _dragNormTable
Definition: CEP.h:126
PHEMlightdll::CEP::GetEmission
double GetEmission(const std::string &pollutant, double power, double speed, Helpers *VehicleClass)
Definition: CEP.cpp:226
PHEMlightdll::CEP::setRatedPower
void setRatedPower(const double &value)
Definition: CEP.cpp:180
PHEMlightdll::CEP::_engineRatedSpeed
double _engineRatedSpeed
Definition: CEP.h:106
PHEMlightdll::CEP::_auxPower
double _auxPower
Definition: CEP.h:100
PHEMlightdll::CEP::_pNormP0
double _pNormP0
Definition: CEP.h:102
PHEMlightdll::CEP::_nNormTable
std::vector< double > _nNormTable
Definition: CEP.h:125
PHEMlightdll::CEP::getRatedPower
const double & getRatedPower() const
Definition: CEP.cpp:176
PHEMlightdll::CEP::_normailzedPowerPatternPollutants
std::vector< double > _normailzedPowerPatternPollutants
Definition: CEP.h:113
PHEMlightdll::CEP::_axleRatio
double _axleRatio
Definition: CEP.h:99
PHEMlightdll::CEP::GetPMaxNorm
double GetPMaxNorm(double speed)
Definition: CEP.cpp:423
PHEMlightdll::CEP::NormalizingType
NormalizingType
Definition: CEP.h:60
PHEMlightdll::CEP::getFuelType
const std::string & getFuelType() const
Definition: CEP.cpp:168
PHEMlightdll::CEP::_drivingPower
double _drivingPower
Definition: CEP.h:81
PHEMlightdll::CEP::InitializeInstanceFields
void InitializeInstanceFields()
Definition: CEP.cpp:436
PHEMlightdll::CEP::FindLowerUpperInPattern
void FindLowerUpperInPattern(int &lowerIndex, int &upperIndex, std::vector< double > &pattern, double value)
Definition: CEP.cpp:366
PHEMlightdll::CEP::getNormalizingPower
const double & getNormalizingPower() const
Definition: CEP.cpp:184
PHEMlightdll::CEP::_cepCurvePollutants
std::map< std::string, std::vector< double > > _cepCurvePollutants
Definition: CEP.h:120
PHEMlightdll::CEP::getHeavyVehicle
const bool & getHeavyVehicle() const
Definition: CEP.cpp:164
PHEMlightdll::CEP::_resistanceF0
double _resistanceF0
Definition: CEP.h:94
PHEMlightdll::CEP::getNormalizingTypeX
const NormalizingType & getNormalizingTypeX() const
Definition: CEP.cpp:172
PHEMlightdll::CEP::_fuelType
std::string _fuelType
Definition: CEP.h:55
PHEMlightdll::CEP::_resistanceF2
double _resistanceF2
Definition: CEP.h:96
PHEMlightdll::CEP::GetCO2Emission
double GetCO2Emission(double _FC, double _CO, double _HC, Helpers *VehicleClass)
Definition: CEP.cpp:287
PHEMlightdll::CEP::_powerPatternPollutants
std::vector< double > _powerPatternPollutants
Definition: CEP.h:114
PHEMlightdll::CEP::_pNormV0
double _pNormV0
Definition: CEP.h:101
PHEMlightdll::CEP::GetMaxAccel
double GetMaxAccel(double speed, double gradient)
Definition: CEP.cpp:416
PHEMlightdll::CEP::getDrivingPower
const double & getDrivingPower() const
Definition: CEP.cpp:188
PHEMlightdll::CEP::_cepCurveFC
std::vector< double > _cepCurveFC
Definition: CEP.h:116
PHEMlightdll
Definition: CEP.cpp:26
PHEMlightdll::CEP::GetDecelCoast
double GetDecelCoast(double speed, double acc, double gradient)
Definition: CEP.cpp:322
PHEMlightdll::CEP::Interpolate
double Interpolate(double px, double p1, double p2, double e1, double e2)
Definition: CEP.cpp:408
PHEMlightdll::CEP::_heavyVehicle
bool _heavyVehicle
Definition: CEP.h:50
PHEMlightdll::Helpers
Definition: Helpers.h:28
PHEMlightdll::CEP::_vehicleMassRot
double _vehicleMassRot
Definition: CEP.h:91
PHEMlightdll::CEP.NormalizingType::NormalizingType_DrivingPower
Definition: CEP.h:62
PHEMlightdll::CEP::_normedCepCurveFC
std::vector< double > _normedCepCurveFC
Definition: CEP.h:117
PHEMlightdll::CEP::CalcPower
double CalcPower(double speed, double acc, double gradient)
Definition: CEP.cpp:196
PHEMlightdll::CEP.NormalizingType::NormalizingType_RatedPower
Definition: CEP.h:61
PHEMlightdll::CEP::_pNormV1
double _pNormV1
Definition: CEP.h:103
PHEMlightdll::CEP::_resistanceF3
double _resistanceF3
Definition: CEP.h:97
PHEMlightdll::CEP::_resistanceF4
double _resistanceF4
Definition: CEP.h:98
PHEMlightdll::CEP::_speedCurveRotational
std::vector< double > _speedCurveRotational
Definition: CEP.h:119
PHEMlightdll::CEP::_crossSectionalArea
double _crossSectionalArea
Definition: CEP.h:92
PHEMlightdll::CEP::_resistanceF1
double _resistanceF1
Definition: CEP.h:95
PHEMlightdll::CEP::_normalizingType
NormalizingType _normalizingType
Definition: CEP.h:65
PHEMlightdll::CEP::_normalizingPower
double _normalizingPower
Definition: CEP.h:76
PHEMlightdll::CEP::_normalizedPowerPatternFC
std::vector< double > _normalizedPowerPatternFC
Definition: CEP.h:112
PHEMlightdll::CEP::_powerPatternFC
std::vector< double > _powerPatternFC
Definition: CEP.h:111
PHEMlightdll::CEP::_idlingValuesPollutants
std::map< std::string, double > _idlingValuesPollutants
Definition: CEP.h:123
PHEMlightdll::CEP::_pNormP1
double _pNormP1
Definition: CEP.h:104
PHEMlightdll::CEP::_gearTransmissionCurve
std::vector< double > _gearTransmissionCurve
Definition: CEP.h:118
PHEMlightdll::CEP::_massVehicle
double _massVehicle
Definition: CEP.h:89
PHEMlightdll::CEP
Definition: CEP.h:36
PHEMlightdll::CEP::_effectiveWheelDiameter
double _effectiveWheelDiameter
Definition: CEP.h:108
PHEMlightdll::CEP::CEP
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:28
PHEMlightdll::CEP::_engineIdlingSpeed
double _engineIdlingSpeed
Definition: CEP.h:107
PHEMlightdll::CEP::CalcEngPower
double CalcEngPower(double power)
Definition: CEP.cpp:215