SUMO - Simulation of Urban MObility
PHEMCEP.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors
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 #ifndef PHEMCEP_h
24 #define PHEMCEP_h
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
38 #include "PHEMCEP.h"
39 #include "PHEMConstants.h"
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class PHEMCEP {
50 public:
51  /*** @brief Constructor
52  * @param[in] emissionClass PHEM emission class of vehicle
53  * @param[in] vehicleMass vehicle mass
54  * @param[in] vehicleLoading vehicle loading
55  * @param[in] vehicleMassRot rotational mass of vehicle
56  * @param[in] crossArea crosssectional area of vehicle
57  * @param[in] cWValue cw-value
58  * @param[in] f0 Rolling resistance f0
59  * @param[in] f1 Rolling resistance f1
60  * @param[in] f2 Rolling resistance f2
61  * @param[in] f3 Rolling resistance f3
62  * @param[in] f4 Rolling resistance f4
63  * @param[in] ratedPower rated power of vehicle
64  * @param[in] pNormV0 out variable for step function to get maximum normalized rated power over speed
65  * @param[in] pNormP0 out variable for step function to get maximum normalized rated power over speed
66  * @param[in] pNormV1 out variable for step function to get maximum normalized rated power over speed
67  * @param[in] pNormP1 out variable for step function to get maximum normalized rated power over speed
68  * @param[in] vehicleFuelType out variable for fuel type (D, G) of vehicle, needed for density of fuel
69  * @param[in] matrixFC Coefficients of the fuel consumption
70  * @param[in] headerLine Definition of covered pollutants
71  * @param[in] headerLinePollutants Coefficients of the pollutants
72  * @param[in] matrixPollutants Coefficients of the pollutants
73  * @param[in] matrixSpeedRotational Table for rotational coefficients over speed
74  */
75  PHEMCEP(bool heavyVehicel, SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier,
76  double vehicleMass, double vehicleLoading, double vehicleMassRot,
77  double crossArea, double cWValue,
78  double f0, double f1, double f2, double f3, double f4,
79  double ratedPower, double pNormV0, double pNormP0, double pNormV1,
80  double pNormP1, std:: string vehicelFuelType,
81  const std::vector< std::vector<double> >& matrixFC,
82  const std::vector<std::string>& headerLinePollutants,
83  const std::vector< std::vector<double> >& matrixPollutants,
84  const std::vector< std::vector<double> > matrixSpeedRotational
85  );
86 
87 
89  ~PHEMCEP();
90 
99  double CalcPower(double v, double a, double slope) const;
100 
101 
110  double GetMaxAccel(double v, double a, double gradient) const;
111 
117  double GetEmission(const std::string& pollutantIdentifier, double power) const;
118 
119 
124  return _emissionClass;
125  }
126 
127 
131  double GetResistanceF0() const {
132  return _resistanceF0;
133  }
134 
135 
139  double GetResistanceF1() const {
140  return _resistanceF1;
141  }
142 
143 
147  double GetResistanceF2() const {
148  return _resistanceF2;
149  }
150 
151 
155  double GetResistanceF3() const {
156  return _resistanceF3;
157  }
158 
159 
163  double GetResistanceF4() const {
164  return _resistanceF4;
165  }
166 
167 
172  double GetCdValue() const {
173  return _cwValue;
174  }
175 
179  double GetCrossSectionalArea() const {
180  return _crossSectionalArea;
181  }
182 
183 
187  double GetMassVehicle() const {
188  return _massVehicle;
189  }
190 
194  double GetVehicleLoading() const {
195  return _vehicleLoading;
196  }
197 
198 
202  double GetMassRot() const {
203  return _massRot;
204  }
205 
206 
210  double GetRatedPower() const {
211  return _ratedPower;
212  }
213 
217  std::string GetVehicleFuelType() const {
218  return _vehicleFuelType;
219  }
220 
221 private:
230  double Interpolate(double px, double p1, double p2, double e1, double e2) const;
231 
238  void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector<double> pattern, double value) const;
239 
243  double GetRotationalCoeffecient(double speed) const;
244 
248  double GetPMaxNorm(double speed) const;
249 
250 private:
264  double _cwValue;
268  double _massVehicle;
272  double _massRot;
274  double _ratedPower;
276  double _pNormV0;
278  double _pNormP0;
280  double _pNormV1;
282  double _pNormP1;
288  std::vector<double> _powerPatternFC;
290  std::vector<double> _powerPatternPollutants;
292  std::vector<double> _cepCurveFC;
296  std::vector<double> _speedPatternRotational;
298  std::vector<double> _speedCurveRotational;
300  std::string _vehicleFuelType;
301 
302 };
303 
304 #endif
305 
306 /****************************************************************************/
double GetRatedPower() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:210
Data Handler for a single CEP emission data set.
Definition: PHEMCEP.h:49
double GetVehicleLoading() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:194
std::vector< double > _powerPatternFC
Definition: PHEMCEP.h:288
double GetCdValue() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:172
double GetResistanceF3() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:155
double GetEmission(const std::string &pollutantIdentifier, double power) const
Returns a emission measure for power[kW] level.
Definition: PHEMCEP.cpp:182
SUMOEmissionClass GetEmissionClass() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:123
std::vector< double > _speedCurveRotational
Definition: PHEMCEP.h:298
double _massVehicle
vehicle mass
Definition: PHEMCEP.h:268
double _resistanceF1
Rolling resistance f1.
Definition: PHEMCEP.h:256
std::string _vehicleFuelType
Definition: PHEMCEP.h:300
double GetMassVehicle() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:187
std::string GetVehicleFuelType() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:217
double GetCrossSectionalArea() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:179
double _pNormP0
Step functions parameter for maximum rated power.
Definition: PHEMCEP.h:278
~PHEMCEP()
Destructor.
Definition: PHEMCEP.cpp:152
double _pNormV1
Step functions parameter for maximum rated power.
Definition: PHEMCEP.h:280
double _resistanceF3
Rolling resistance f3.
Definition: PHEMCEP.h:260
double _massRot
rotational mass of vehicle
Definition: PHEMCEP.h:272
double GetMaxAccel(double v, double a, double gradient) const
Returns the maximum accelaration for a vehicle at state v,a, slope and loading.
Definition: PHEMCEP.cpp:174
int _sizeOfPatternFC
Definition: PHEMCEP.h:284
double _pNormV0
Step functions parameter for maximum rated power.
Definition: PHEMCEP.h:276
double _crossSectionalArea
crosssectional area of vehicle
Definition: PHEMCEP.h:266
double _vehicleLoading
vehicle loading
Definition: PHEMCEP.h:270
double _pNormP1
Step functions parameter for maximum rated power.
Definition: PHEMCEP.h:282
std::vector< double > _speedPatternRotational
Definition: PHEMCEP.h:296
double GetRotationalCoeffecient(double speed) const
Calculates rotational index for speed.
Definition: PHEMCEP.cpp:246
double _resistanceF4
Rolling resistance f4.
Definition: PHEMCEP.h:262
PHEMCEP(bool heavyVehicel, SUMOEmissionClass emissionClass, const std::string &emissionClassIdentifier, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double ratedPower, double pNormV0, double pNormP0, double pNormV1, double pNormP1, std::string vehicelFuelType, const std::vector< std::vector< double > > &matrixFC, const std::vector< std::string > &headerLinePollutants, const std::vector< std::vector< double > > &matrixPollutants, const std::vector< std::vector< double > > matrixSpeedRotational)
Definition: PHEMCEP.cpp:49
double GetResistanceF1() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:139
double _resistanceF0
Rolling resistance f0.
Definition: PHEMCEP.h:254
std::vector< double > _cepCurveFC
Definition: PHEMCEP.h:292
double GetPMaxNorm(double speed) const
Calculates maximum available rated power for speed.
Definition: PHEMCEP.cpp:301
int _sizeOfPatternPollutants
Definition: PHEMCEP.h:286
double GetResistanceF0() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:131
std::vector< double > _powerPatternPollutants
Definition: PHEMCEP.h:290
double Interpolate(double px, double p1, double p2, double e1, double e2) const
Interpolates emission linearly between two known power-emission pairs.
Definition: PHEMCEP.cpp:237
double GetResistanceF2() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:147
double _ratedPower
rated power of vehicle
Definition: PHEMCEP.h:274
double _cwValue
Cw value.
Definition: PHEMCEP.h:264
double CalcPower(double v, double a, double slope) const
Returns the power of used for a vehicle at state v,a, slope and loading.
Definition: PHEMCEP.cpp:163
StringBijection< std::vector< double > > _cepCurvePollutants
Definition: PHEMCEP.h:294
void FindLowerUpperInPattern(int &lowerIndex, int &upperIndex, std::vector< double > pattern, double value) const
Finds bounding upper and lower index in pattern for value.
Definition: PHEMCEP.cpp:260
double GetMassRot() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:202
SUMOEmissionClass _emissionClass
PHEM emission class of vehicle.
Definition: PHEMCEP.h:252
double _resistanceF2
Rolling resistance f2.
Definition: PHEMCEP.h:258
double GetResistanceF4() const
Getter function to recieve vehicle data from CEP.
Definition: PHEMCEP.h:163