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