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,
List<double> transmissionGearRatios,
double auxPower,
double ratedPower,
double engineIdlingSpeed,
double engineRatedSpeed,
double effictiveWheelDiameter,
double pNormV0,
double pNormP0,
double pNormV1,
double pNormP1,
string vehicelFuelType,
List<List<double>> matrixFC,
List<string> headerLinePollutants,
List<List<double>> matrixPollutants,
List<List<double>> matrixSpeedRotational,
List<List<double>> normedDragTable,
double idlingFC,
List<double> idlingPollutants)
{
_resistanceF0 = f0;
_resistanceF1 = f1;
_resistanceF2 = f2;
_resistanceF3 = f3;
_resistanceF4 = f4;
_cWValue = cWValue;
_crossSectionalArea = crossArea;
_massVehicle = vehicleMass;
_vehicleLoading = vehicleLoading;
_vehicleMassRot = vehicleMassRot;
_ratedPower = ratedPower;
_engineIdlingSpeed = engineIdlingSpeed;
_engineRatedSpeed = engineRatedSpeed;
_effectiveWheelDiameter = effictiveWheelDiameter;
_heavyVehicle = heavyVehicle;
_fuelType = vehicelFuelType;
_axleRatio = axleRatio;
_auxPower = auxPower;
_pNormV0 = pNormV0 / 3.6;
_pNormP0 = pNormP0;
_pNormV1 = pNormV1 / 3.6;
_pNormP1 = pNormP1;
List<string> pollutantIdentifier = new List<string>();
List<List<double>> pollutantMeasures = new List<List<double>>();
List<List<double>> normalizedPollutantMeasures = new List<List<double>>();
// init pollutant identifiers
for (int i = 0; i < headerLinePollutants.Count; i++)
{
pollutantIdentifier.Add(headerLinePollutants[i]);
}
// initialize measures
for (int i = 0; i < headerLinePollutants.Count; i++)
{
pollutantMeasures.Add(new List<double>());
normalizedPollutantMeasures.Add(new List<double>());
}
// looping through matrix and assigning values for speed rotational table
_speedCurveRotational = new List<double>();
_speedPatternRotational = new List<double>();
_gearTransmissionCurve = new List<double>();
for (int i = 0; i < matrixSpeedRotational.Count; i++)
{
if (matrixSpeedRotational[i].Count != 3)
return;
_speedPatternRotational.Add(matrixSpeedRotational[i][0] / 3.6);
_gearTransmissionCurve.Add(matrixSpeedRotational[i][1]);
_speedCurveRotational.Add(matrixSpeedRotational[i][2]);
}
// looping through matrix and assigning values for drag table
_nNormTable = new List<double>();
_dragNormTable = new List<double>();
for (int i = 0; i < normedDragTable.Count; i++)
{
if (normedDragTable[i].Count != 2)
return;
_nNormTable.Add(normedDragTable[i][0]);
_dragNormTable.Add(normedDragTable[i][1]);
}
// looping through matrix and assigning values for Fuel consumption
_cepCurveFC = new List<double>();
_normedCepCurveFC = new List<double>();
_powerPatternFC = new List<double>();
_normalizedPowerPatternFC = new List<double>();
for (int i = 0; i < matrixFC.Count; i++)
{
if (matrixFC[i].Count != 2)
return;
_powerPatternFC.Add(matrixFC[i][0] * _ratedPower);
_normalizedPowerPatternFC.Add(matrixFC[i][0]);
_cepCurveFC.Add(matrixFC[i][1] * _ratedPower);
_normedCepCurveFC.Add(matrixFC[i][1]);
}
_powerPatternPollutants = new List<double>();
double pollutantMultiplyer = 1;
_drivingPower = _normalizingPower = CalcPower(Constants.NORMALIZING_SPEED, Constants.NORMALIZING_ACCELARATION, 0);
// looping through matrix and assigning values for pollutants
if (heavyVehicle)
{
_normalizingPower = _ratedPower;
_normalizingType = NormalizingType.RatedPower;
pollutantMultiplyer = _ratedPower;
}
else
{
_normalizingPower = _drivingPower;
_normalizingType = NormalizingType.DrivingPower;
}
_normailzedPowerPatternPollutants = new List<double>();
_cepNormalizedCurvePollutants = new Dictionary<string, List<double>>();
int headerCount = headerLinePollutants.Count;
for (int i = 0; i < matrixPollutants.Count; i++)
{
for (int j = 0; j < matrixPollutants[i].Count; j++)
{
if (matrixPollutants[i].Count != headerCount + 1)
return;
if (j == 0)
{
_normailzedPowerPatternPollutants.Add(matrixPollutants[i][j]);
_powerPatternPollutants.Add(matrixPollutants[i][j] * NormalizingPower);
}
else
{
pollutantMeasures[j - 1].Add(matrixPollutants[i][j] * pollutantMultiplyer);
normalizedPollutantMeasures[j - 1].Add(matrixPollutants[i][j]);
}
}
}
_cepCurvePollutants = new Dictionary<string, List<double>>();
_idlingValuesPollutants = new Dictionary<string, double>();
for (int i = 0; i < headerLinePollutants.Count; i++)
{
_cepCurvePollutants.Add(pollutantIdentifier[i], pollutantMeasures[i]);
_cepNormalizedCurvePollutants.Add(pollutantIdentifier[i], normalizedPollutantMeasures[i]);
_idlingValuesPollutants.Add(pollutantIdentifier[i], idlingPollutants[i] * pollutantMultiplyer);
}
_idlingValueFC = idlingFC * _ratedPower;
}
#endregion