SUMO - Simulation of Urban MObility
CEP.h
Go to the documentation of this file.
1 /****************************************************************************/
8 //
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2016-2017 DLR (http://www.dlr.de/) and contributors
12 // PHEMlight module
13 // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 #ifndef PHEMlightCEP
26 #define PHEMlightCEP
27 
28 #define _USE_MATH_DEFINES
29 #include <string>
30 #include <map>
31 #include <vector>
32 #include <cmath>
33 #include <utility>
34 
35 //C# TO C++ CONVERTER NOTE: Forward class declarations:
36 namespace PHEMlightdll { class Helpers; }
37 
38 
39 namespace PHEMlightdll {
40  class CEP {
41  //--------------------------------------------------------------------------------------------------
42  // Constructors
43  //--------------------------------------------------------------------------------------------------
44 
45  public:
46  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);
47 
48 
49  //--------------------------------------------------------------------------------------------------
50  // Members
51  //--------------------------------------------------------------------------------------------------
52 
53  private:
55  public:
56  const bool& getHeavyVehicle() const;
57 
58  private:
59  std::string _fuelType;
60  public:
61  const std::string& getFuelType() const;
62 
63  public:
67  };
68  private:
70  public:
71  const NormalizingType& getNormalizingTypeX() const;
72 
73  private:
74  double _ratedPower;
75  public:
76  const double& getRatedPower() const;
77  void setRatedPower(const double& value);
78 
79  private:
81  public:
82  const double& getNormalizingPower() const;
83 
84  private:
85  double _drivingPower;
86  public:
87  const double& getDrivingPower() const;
88  void setDrivingPower(const double& value);
89 
90 
91 
92  protected:
93  double _massVehicle;
97  double _cWValue;
98  double _resistanceF0;
99  double _resistanceF1;
103  double _axleRatio;
104  double _auxPower;
105  double _pNormV0;
106  double _pNormP0;
107  double _pNormV1;
108  double _pNormP1;
109 
113 
114  std::vector<double> _speedPatternRotational;
115  std::vector<double> _powerPatternFC;
116  std::vector<double> _normalizedPowerPatternFC;
118  std::vector<double> _powerPatternPollutants;
119 
120  std::vector<double> _cepCurveFC;
121  std::vector<double> _normedCepCurveFC;
122  std::vector<double> _gearTransmissionCurve;
123  std::vector<double> _speedCurveRotational;
124  std::map<std::string, std::vector<double> > _cepCurvePollutants;
125  std::map<std::string, std::vector<double> > _cepNormalizedCurvePollutants;
127  std::map<std::string, double> _idlingValuesPollutants;
128 
129  std::vector<double> _nNormTable;
130  std::vector<double> _dragNormTable;
131 
132 
133  //--------------------------------------------------------------------------------------------------
134  // Methods
135  //--------------------------------------------------------------------------------------------------
136 
137  public:
138  double CalcPower(double speed, double acc, double gradient);
139 
140  double CalcEngPower(double power);
141 
142  double GetEmission(const std::string& pollutant, double power, double speed, Helpers* VehicleClass);
143 
144 
145  double GetCO2Emission(double _FC, double _CO, double _HC, Helpers* VehicleClass);
146 
147  double GetDecelCoast(double speed, double acc, double gradient);
148 
149  double GetRotationalCoeffecient(double speed);
150 
151 
152  private:
153  void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector<double>& pattern, double value);
154 
155  double Interpolate(double px, double p1, double p2, double e1, double e2);
156 
157  //--------------------------------------------------------------------------------------------------
158  // Operators for fleetmix
159  //--------------------------------------------------------------------------------------------------
160 
161 
162  private:
164  };
165 }
166 
167 
168 #endif //#ifndef PHEMlightCEP
const NormalizingType & getNormalizingTypeX() const
Definition: CEP.cpp:176
std::vector< double > _speedPatternRotational
Definition: CEP.h:114
double _resistanceF0
Definition: CEP.h:98
double GetEmission(const std::string &pollutant, double power, double speed, Helpers *VehicleClass)
Definition: CEP.cpp:230
const bool & getHeavyVehicle() const
Definition: CEP.cpp:168
std::vector< double > _normailzedPowerPatternPollutants
Definition: CEP.h:117
std::vector< double > _dragNormTable
Definition: CEP.h:130
double _massVehicle
Definition: CEP.h:93
std::map< std::string, std::vector< double > > _cepCurvePollutants
Definition: CEP.h:124
void setDrivingPower(const double &value)
Definition: CEP.cpp:196
double _effectiveWheelDiameter
Definition: CEP.h:112
std::vector< double > _nNormTable
Definition: CEP.h:129
double _pNormP0
Definition: CEP.h:106
double _engineRatedSpeed
Definition: CEP.h:110
void InitializeInstanceFields()
Definition: CEP.cpp:415
void setRatedPower(const double &value)
Definition: CEP.cpp:184
double _pNormV1
Definition: CEP.h:107
double _drivingPower
Definition: CEP.h:85
double _resistanceF1
Definition: CEP.h:99
double GetRotationalCoeffecient(double speed)
Definition: CEP.cpp:356
double _auxPower
Definition: CEP.h:104
double _engineIdlingSpeed
Definition: CEP.h:111
std::map< std::string, double > _idlingValuesPollutants
Definition: CEP.h:127
double _resistanceF2
Definition: CEP.h:100
std::vector< double > _normedCepCurveFC
Definition: CEP.h:121
NormalizingType _normalizingType
Definition: CEP.h:69
double _pNormP1
Definition: CEP.h:108
std::map< std::string, std::vector< double > > _cepNormalizedCurvePollutants
Definition: CEP.h:125
double _normalizingPower
Definition: CEP.h:80
const double & getNormalizingPower() const
Definition: CEP.cpp:188
std::vector< double > _normalizedPowerPatternFC
Definition: CEP.h:116
double _cWValue
Definition: CEP.h:97
double GetDecelCoast(double speed, double acc, double gradient)
Definition: CEP.cpp:321
double CalcEngPower(double power)
Definition: CEP.cpp:219
bool _heavyVehicle
Definition: CEP.h:54
double _resistanceF4
Definition: CEP.h:102
std::vector< double > _speedCurveRotational
Definition: CEP.h:123
std::vector< double > _gearTransmissionCurve
Definition: CEP.h:122
double _pNormV0
Definition: CEP.h:105
double _resistanceF3
Definition: CEP.h:101
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:32
std::vector< double > _powerPatternFC
Definition: CEP.h:115
std::vector< double > _cepCurveFC
Definition: CEP.h:120
double Interpolate(double px, double p1, double p2, double e1, double e2)
Definition: CEP.cpp:407
const double & getDrivingPower() const
Definition: CEP.cpp:192
double _axleRatio
Definition: CEP.h:103
double _crossSectionalArea
Definition: CEP.h:96
std::vector< double > _powerPatternPollutants
Definition: CEP.h:118
const double & getRatedPower() const
Definition: CEP.cpp:180
double _idlingValueFC
Definition: CEP.h:126
double CalcPower(double speed, double acc, double gradient)
Definition: CEP.cpp:200
const std::string & getFuelType() const
Definition: CEP.cpp:172
double _vehicleLoading
Definition: CEP.h:94
double _ratedPower
Definition: CEP.h:74
void FindLowerUpperInPattern(int &lowerIndex, int &upperIndex, std::vector< double > &pattern, double value)
Definition: CEP.cpp:365
double GetCO2Emission(double _FC, double _CO, double _HC, Helpers *VehicleClass)
Definition: CEP.cpp:291
std::string _fuelType
Definition: CEP.h:59
double _vehicleMassRot
Definition: CEP.h:95