Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 2721efec authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

removing ADAS quick-fix

parent f885dce9
No related branches found
No related tags found
No related merge requests found
Showing
with 5 additions and 385 deletions
......@@ -181,7 +181,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
{
var vehicle = InputDataProvider.JobInputData.Vehicle;
var adasCombination = DeclarationData.ADASCombinations.Lookup(vehicle.ADAS);
foreach (var mission in _segment.Missions) {
if (mission.MissionType.IsEMS() &&
_engineData.RatedPowerDeclared.IsSmaller(DeclarationData.MinEnginePowerForEMS)) {
......@@ -226,8 +225,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
mission.MissionType.GetNonEMSMissionType(), _engineData.WHTCRural, _engineData.WHTCUrban,
_engineData.WHTCMotorway) *
_engineData.ColdHotCorrectionFactor * _engineData.CorrectionFactorRegPer;
simulationRunData.EngineData.ADASCorrectionFactor = DeclarationData.ADASBenefits.Lookup(
_segment.VehicleClass, adasCombination, mission.MissionType, loading.Key);
simulationRunData.VehicleData.VehicleClass = _segment.VehicleClass;
yield return simulationRunData;
}
......
/*
* This file is part of VECTO.
*
* Copyright © 2012-2019 European Union
*
* Developed by Graz University of Technology,
* Institute of Internal Combustion Engines and Thermodynamics,
* Institute of Technical Informatics
*
* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use VECTO except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
*
* Unless required by applicable law or agreed to in writing, VECTO
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* Authors:
* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.Collections.Generic;
using System.Data;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration
{
public sealed class ADASBenefits : LookupData<VehicleClass, ADASCombination, MissionType, LoadingType, double>
{
private readonly Dictionary<Tuple<VehicleClass, ADASCombination>, Dictionary<Tuple<MissionType, LoadingType>, double>> _data = new Dictionary<Tuple<VehicleClass, ADASCombination>, Dictionary<Tuple<MissionType, LoadingType>, double>>();
#region Overrides of LookupData
public override double Lookup(VehicleClass group, ADASCombination adasCombination, MissionType mission, LoadingType loading)
{
var groupAndAdas = Tuple.Create(group, adasCombination);
var missionAndLoading = Tuple.Create(mission, loading);
if (!_data.ContainsKey(groupAndAdas)) {
return 1.0;
}
if (!_data[groupAndAdas].ContainsKey(missionAndLoading)) {
return 1.0;
}
return _data[groupAndAdas][missionAndLoading];
}
protected override string ResourceId { get { return DeclarationData.DeclarationDataResourcePrefix + ".ADAS.ADAS_Benefits.csv"; } }
protected override string ErrorMessage { get { return "ADAS Benefits Lookup Error: No value found."; } }
protected override void ParseData(DataTable table)
{
var loadingTypes = new[] { LoadingType.LowLoading, LoadingType.ReferenceLoad };
foreach (DataRow row in table.Rows) {
var groupAndAdas = Tuple.Create(VehicleClassHelper.Parse(row.Field<string>("vehiclegroup")), new ADASCombination() { ID = row.Field<string>("adascombination")});
if (!_data.ContainsKey(groupAndAdas)) {
_data[groupAndAdas] = new Dictionary<Tuple<MissionType, LoadingType>, double>();
}
foreach (var missionType in new[] { MissionType.LongHaul, MissionType.LongHaulEMS, MissionType.RegionalDelivery, MissionType.RegionalDeliveryEMS, MissionType.UrbanDelivery}) {
var benefits = row.Field<string>(missionType.GetName());
if (string.IsNullOrWhiteSpace(benefits)) {
continue;
}
var benefitsPerLoading = benefits.Split('/');
for (var i = 0; i < loadingTypes.Length; i++) {
var cycleAndPayload = Tuple.Create(missionType, loadingTypes[i]);
_data[groupAndAdas][cycleAndPayload] = BenefitFacor(benefitsPerLoading[i]);
}
}
}
}
private double BenefitFacor(string benefitStr)
{
var benefit = benefitStr.Replace("%", "").ToDouble();
return 1 + benefit / 100.0;
}
#endregion
}
}
/*
* This file is part of VECTO.
*
* Copyright © 2012-2019 European Union
*
* Developed by Graz University of Technology,
* Institute of Internal Combustion Engines and Thermodynamics,
* Institute of Technical Informatics
*
* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use VECTO except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
*
* Unless required by applicable law or agreed to in writing, VECTO
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* Authors:
* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration
{
public struct ADASCombination
{
public string ID;
}
public sealed class ADASCombinations : LookupData<bool, EcoRollType, PredictiveCruiseControlType, ADASCombination>
{
private readonly List<Entry> _combinations = new List<Entry>();
#region Overrides of LookupData
public override ADASCombination Lookup(bool enginestopstart, EcoRollType ecoRoll, PredictiveCruiseControlType pcc)
{
try {
var entry = _combinations.First(
x => x.EngineStopStart == enginestopstart && x.EcoRoll == ecoRoll &&
x.PCCType == pcc);
return new ADASCombination {ID = entry.ADASCombination};
} catch (Exception ) {
throw new VectoException(string.Format(ErrorMessage, enginestopstart, ecoRoll, pcc));
}
}
protected override string ResourceId
{
get { return DeclarationData.DeclarationDataResourcePrefix + ".ADAS.ADAS_Combinations.csv"; }
}
protected override string ErrorMessage
{
get {
return
"ADAS Combination Lookup Error: No entry found for engine stop/start: {0}, eco roll: {1}, PCC: {2}";
}
}
protected override void ParseData(DataTable table)
{
foreach (DataRow row in table.Rows) {
_combinations.Add(new Entry() {
EngineStopStart = row.ParseBoolean("enginestopstart"),
EcoRoll = EcorollTypeHelper.Get(row.ParseBoolean("ecorollwithoutenginestop"), row.ParseBoolean("ecorollwithenginestop")),
PCCType = PredictiveCruiseControlTypeHelper.Parse(row.Field<string>("predictivecruisecontrol")),
ADASCombination = row.Field<string>("adascombination")
});
}
}
#endregion
public struct Entry
{
public bool EngineStopStart;
public EcoRollType EcoRoll;
public PredictiveCruiseControlType PCCType;
public string ADASCombination;
}
public ADASCombination Lookup(IAdvancedDriverAssistantSystemDeclarationInputData adas)
{
return Lookup(
adas.EngineStopStart, adas.EcoRoll, adas.PredictiveCruiseControl);
}
internal ADASCombination Lookup(VehicleData.ADASData adas)
{
return Lookup(
adas.EngineStopStart, adas.EcoRoll, adas.PredictiveCruiseControl);
}
}
}
......@@ -79,8 +79,6 @@ namespace TUGraz.VectoCore.Models.Declaration
public static readonly PTOTransmission PTOTransmission = new PTOTransmission();
public const double LossMapExtrapolationFactor = 3;
public static readonly ADASCombinations ADASCombinations = new ADASCombinations();
public static readonly ADASBenefits ADASBenefits = new ADASBenefits();
public static readonly WeightingGroups WeightingGroup = new WeightingGroups();
public static readonly WeightingFactors WeightingFactors = new WeightingFactors();
......
......@@ -74,8 +74,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public double FuelConsumptionCorrectionFactor { get; internal set; }
public double ADASCorrectionFactor { get; internal set; }
public PerSecond RatedSpeedDeclared { get; internal set; }
public Watt RatedPowerDeclared { get; internal set; }
......@@ -91,7 +89,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
WHTCRural = 1;
CorrectionFactorRegPer = 1;
FuelConsumptionCorrectionFactor = 1;
ADASCorrectionFactor = 1;
}
public CombustionEngineData Copy()
......@@ -114,7 +111,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
RatedSpeedDeclared = RatedSpeedDeclared,
MaxTorqueDeclared = MaxTorqueDeclared,
FuelData = FuelData,
ADASCorrectionFactor = ADASCorrectionFactor,
CertificationNumber = CertificationNumber,
CertificationMethod = CertificationMethod,
};
......
......@@ -405,14 +405,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
advancedAux.DoWriteModalResults(container);
fcAAUX = advancedAux.AAuxFuelConsumption;
}
var fcADAS = fcAAUX * ModelData.ADASCorrectionFactor;
var fcFinal = fcADAS;
var fcFinal = fcAAUX;
container[ModalResultField.FCMap] = fc;
container[ModalResultField.FCNCVc] = fcNCVcorr;
container[ModalResultField.FCWHTCc] = fcWHTC;
container[ModalResultField.FCAAUX] = fcAAUX;
container[ModalResultField.FCADAS] = fcADAS;
container[ModalResultField.FCFinal] = fcFinal;
}
......
......@@ -206,7 +206,7 @@ namespace TUGraz.VectoCore.OutputData
public const string DECLARED_FZISO_AXLE3 = "Declared FzISO axle 3 [N]";
public const string DECLARED_RRC_AXLE4 = "Declared RRC axle 4 [-]";
public const string DECLARED_FZISO_AXLE4 = "Declared FzISO axle 4 [N]";
public const string ADAS_TECHNOLOGY_COMBINATION = "ADAS technology combination [-]";
//public const string ADAS_TECHNOLOGY_COMBINATION = "ADAS technology combination [-]";
public const string PTO_TECHNOLOGY = "PTOShaftsGearWheels";
......@@ -323,7 +323,7 @@ namespace TUGraz.VectoCore.OutputData
typeof(string)),
Tuple.Create(string.Format(AUX_TECH_FORMAT, Constants.Auxiliaries.IDs.PneumaticSystem), typeof(string)),
Tuple.Create(string.Format(AUX_TECH_FORMAT, Constants.Auxiliaries.IDs.ElectricSystem), typeof(string)),
Tuple.Create(ADAS_TECHNOLOGY_COMBINATION, typeof(string)),
//Tuple.Create(ADAS_TECHNOLOGY_COMBINATION, typeof(string)),
Tuple.Create(PTO_TECHNOLOGY, typeof(string)),
//Tuple.Create(PTO_OTHER_ELEMENTS, typeof(string)),
......@@ -712,7 +712,7 @@ namespace TUGraz.VectoCore.OutputData
row[R_DYN] = (ConvertedSI)data.DynamicTyreRadius;
row[ADAS_TECHNOLOGY_COMBINATION] = data.ADAS != null ? DeclarationData.ADASCombinations.Lookup(data.ADAS).ID : "";
//row[ADAS_TECHNOLOGY_COMBINATION] = data.ADAS != null ? DeclarationData.ADASCombinations.Lookup(data.ADAS).ID : "";
}
private static void WriteAirdragData(AirdragData data, DataRow row)
......
Vehicle Group , ADAS Combination , LongHaul , LongHaul EMS , Regional Delivery , Regional Delivery EMS , Urban Delivery
4 , 1 , -0.1%/0.0% , , -0.5%/-0.5% , , -1.5%/-1.2%
4 , 2 , 0.0%/0.0% , , -0.1%/-0.1% , , 0.0%/0.0%
4 , 3 , 0.0%/-0.1% , , -0.1%/-0.2% , , 0.0%/0.0%
4 , 4/1 , -0.1%/-0.4% , , 0.0%/-0.1% , , 0.0%/0.0%
4 , 4/2 , -0.1%/-0.5% , , -0.1%/-0.2% , , 0.0%/0.0%
4 , 5 , -0.1%/-0.1% , , -0.6%/-0.6% , , -1.5%/-1.2%
4 , 6 , -0.1%/-0.1% , , -0.6%/-0.7% , , -1.5%/-1.2%
4 , 7/1 , -0.1%/-0.4% , , -0.5%/-0.6% , , -1.5%/-1.2%
4 , 7/2 , -0.1%/-0.6% , , -0.6%/-0.7% , , -1.5%/-1.2%
4 , 8/1 , -0.1%/-0.4% , , -0.1%/-0.2% , , 0.0%/0.0%
4 , 8/2 , -0.1%/-0.5% , , -0.1%/-0.3% , , 0.0%/0.0%
4 , 9/1 , -0.1%/-0.4% , , -0.2%/-0.3% , , 0.0%/0.0%
4 , 9/2 , -0.1%/-0.5% , , -0.2%/-0.4% , , 0.0%/0.0%
4 , 10/1 , -0.2%/-0.4% , , -0.6%/-0.7% , , -1.5%/-1.2%
4 , 10/2 , -0.2%/-0.6% , , -0.6%/-0.7% , , -1.5%/-1.2%
4 , 11/1 , -0.2%/-0.4% , , -0.7%/-0.8% , , -1.5%/-1.2%
4 , 11/2 , -0.2%/-0.6% , , -0.7%/-0.8% , , -1.5%/-1.2%
#----------------------------------------------------------------------------------------------------------------------------
5 , 1 , -0.1%/0.0% , 0.0%/0.0% , -0.4%/-0.3% , -0.3%/-0.2% , -1.8%/-1.3%
5 , 2 , 0.0%/-0.1% , 0.0%/-0.1% , -0.1%/-0.1% , -0.2%/0.0% , 0.0%/0.0%
5 , 3 , -0.1%/-0.2% , 0.0%/-0.1% , -0.2%/-0.2% , -0.3%/-0.1% , 0.0%/0.0%
5 , 4/1 , -0.2%/-0.5% , -0.2%/-0.1% , -0.2%/-0.6% , -0.3%/-0.5% , 0.0%/0.0%
5 , 4/2 , -0.2%/-0.7% , -0.3%/-0.3% , -0.4%/-0.9% , -0.5%/-0.8% , 0.0%/0.0%
5 , 5 , -0.1%/-0.1% , 0.0%/-0.1% , -0.5%/-0.4% , -0.5%/-0.3% , -1.8%/-1.3%
5 , 6 , -0.1%/-0.2% , -0.1%/-0.2% , -0.6%/-0.5% , -0.6%/-0.4% , -1.8%/-1.3%
5 , 7/1 , -0.2%/-0.5% , -0.3%/-0.1% , -0.6%/-0.9% , -0.7%/-0.8% , -1.8%/-1.3%
5 , 7/2 , -0.3%/-0.7% , -0.3%/-0.4% , -0.8%/-1.3% , -0.8%/-1.1% , -1.8%/-1.3%
5 , 8/1 , -0.2%/-0.6% , -0.2%/-0.1% , -0.3%/-0.7% , -0.5%/-0.5% , 0.0%/0.0%
5 , 8/2 , -0.2%/-0.7% , -0.3%/-0.4% , -0.4%/-1.0% , -0.7%/-0.8% , 0.0%/0.0%
5 , 9/1 , -0.2%/-0.6% , -0.3%/-0.2% , -0.4%/-0.8% , -0.6%/-0.6% , 0.0%/0.0%
5 , 9/2 , -0.2%/-0.8% , -0.3%/-0.4% , -0.5%/-1.1% , -0.7%/-0.9% , 0.0%/0.0%
5 , 10/1 , -0.2%/-0.6% , -0.3%/-0.2% , -0.7%/-1.0% , -0.8%/-0.8% , -1.8%/-1.3%
5 , 10/2 , -0.3%/-0.8% , -0.3%/-0.4% , -0.8%/-1.3% , -1.0%/-1.1% , -1.8%/-1.3%
5 , 11/1 , -0.3%/-0.7% , -0.3%/-0.2% , -0.8%/-1.1% , -0.9%/-0.9% , -1.8%/-1.3%
5 , 11/2 , -0.3%/-0.8% , -0.4%/-0.5% , -0.9%/-1.4% , -1.0%/-1.2% , -1.8%/-1.3%
#----------------------------------------------------------------------------------------------------------------------------
9 , 1 , -0.1%/0.0% , 0.0%/0.0% , -0.5%/-0.4% , -0.3%/-0.2% ,
9 , 2 , 0.0%/-0.1% , 0.0%/0.0% , -0.1%/-0.1% , 0.0%/0.0% ,
9 , 3 , 0.0%/-0.2% , 0.0%/-0.1% , -0.2%/-0.2% , -0.2%/-0.2% ,
9 , 4/1 , -0.1%/-0.4% , -0.2%/-0.1% , -0.1%/-0.3% , -0.3%/-0.6% ,
9 , 4/2 , -0.1%/-0.6% , -0.3%/-0.3% , -0.2%/-0.5% , -0.5%/-0.9% ,
9 , 5 , -0.1%/-0.1% , -0.1%/-0.1% , -0.6%/-0.5% , -0.3%/-0.3% ,
9 , 6 , -0.1%/-0.2% , -0.1%/-0.2% , -0.7%/-0.6% , -0.5%/-0.4% ,
9 , 7/1 , -0.2%/-0.5% , -0.3%/-0.1% , -0.6%/-0.7% , -0.6%/-0.8% ,
9 , 7/2 , -0.2%/-0.6% , -0.3%/-0.4% , -0.7%/-0.9% , -0.8%/-1.1% ,
9 , 8/1 , -0.1%/-0.5% , -0.2%/-0.1% , -0.2%/-0.4% , -0.3%/-0.6% ,
9 , 8/2 , -0.1%/-0.7% , -0.3%/-0.4% , -0.2%/-0.5% , -0.5%/-0.9% ,
9 , 9/1 , -0.1%/-0.6% , -0.3%/-0.2% , -0.3%/-0.5% , -0.4%/-0.7% ,
9 , 9/2 , -0.2%/-0.7% , -0.3%/-0.4% , -0.3%/-0.6% , -0.6%/-1.0% ,
9 , 10/1 , -0.2%/-0.5% , -0.3%/-0.2% , -0.6%/-0.8% , -0.6%/-0.8% ,
9 , 10/2 , -0.2%/-0.7% , -0.3%/-0.4% , -0.7%/-0.9% , -0.8%/-1.1% ,
9 , 11/1 , -0.2%/-0.6% , -0.3%/-0.2% , -0.7%/-0.9% , -0.7%/-0.9% ,
9 , 11/2 , -0.2%/-0.8% , -0.3%/-0.4% , -0.8%/-1.0% , -0.9%/-1.2% ,
#----------------------------------------------------------------------------------------------------------------------------
10 , 1 , -0.1%/0.0% , 0.0%/0.0% , -0.4%/-0.3% , -0.3%/-0.2% ,
10 , 2 , 0.0%/-0.1% , 0.0%/0.0% , -0.1%/-0.1% , 0.0%/0.0% ,
10 , 3 , -0.1%/-0.2% , 0.0%/-0.1% , -0.2%/-0.2% , -0.2%/-0.1% ,
10 , 4/1 , -0.2%/-0.5% , -0.2%/-0.1% , -0.3%/-0.6% , -0.4%/-0.6% ,
10 , 4/2 , -0.2%/-0.7% , -0.3%/-0.4% , -0.4%/-0.9% , -0.6%/-0.9% ,
10 , 5 , -0.1%/-0.1% , 0.0%/-0.1% , -0.5%/-0.4% , -0.4%/-0.2% ,
10 , 6 , -0.1%/-0.2% , -0.1%/-0.2% , -0.6%/-0.5% , -0.5%/-0.3% ,
10 , 7/1 , -0.2%/-0.5% , -0.3%/-0.1% , -0.6%/-1.0% , -0.7%/-0.8% ,
10 , 7/2 , -0.3%/-0.7% , -0.4%/-0.4% , -0.8%/-1.3% , -0.9%/-1.1% ,
10 , 8/1 , -0.2%/-0.5% , -0.2%/-0.1% , -0.3%/-0.7% , -0.4%/-0.6% ,
10 , 8/2 , -0.2%/-0.7% , -0.3%/-0.4% , -0.4%/-1.0% , -0.6%/-0.9% ,
10 , 9/1 , -0.2%/-0.6% , -0.3%/-0.2% , -0.4%/-0.8% , -0.5%/-0.7% ,
10 , 9/2 , -0.3%/-0.8% , -0.3%/-0.4% , -0.5%/-1.1% , -0.7%/-1.0% ,
10 , 10/1 , -0.3%/-0.6% , -0.3%/-0.2% , -0.7%/-1.0% , -0.7%/-0.8% ,
10 , 10/2 , -0.3%/-0.8% , -0.4%/-0.4% , -0.8%/-1.3% , -0.9%/-1.1% ,
10 , 11/1 , -0.3%/-0.6% , -0.3%/-0.2% , -0.8%/-1.1% , -0.8%/-0.9% ,
10 , 11/2 , -0.3%/-0.8% , -0.4%/-0.5% , -0.9%/-1.4% , -1.0%/-1.2% ,
\ No newline at end of file
ADAS Combination , Engine Stop Start , EcoRoll without Engine Stop , EcoRoll with Engine Stop , Predictive Cruise Control
0 , 0 , 0 , 0 , none
1 , 1 , 0 , 0 , none
2 , 0 , 1 , 0 , none
3 , 0 , 0 , 1 , none
4/1 , 0 , 0 , 0 , "1_2"
4/2 , 0 , 0 , 0 , "1_2_3"
5 , 1 , 1 , 0 , none
6 , 1 , 0 , 1 , none
7/1 , 1 , 0 , 0 , "1_2"
7/2 , 1 , 0 , 0 , "1_2_3"
8/1 , 0 , 1 , 0 , "1_2"
8/2 , 0 , 1 , 0 , "1_2_3"
9/1 , 0 , 0 , 1 , "1_2"
9/2 , 0 , 0 , 1 , "1_2_3"
10/1 , 1 , 1 , 0 , "1_2"
10/2 , 1 , 1 , 0 , "1_2_3"
11/1 , 1 , 0 , 1 , "1_2"
11/2 , 1 , 0 , 1 , "1_2_3"
\ No newline at end of file
......@@ -319,8 +319,6 @@
<Compile Include="InputData\Reader\Impl\EngineeringModeVectoRunDataFactory.cs" />
<Compile Include="InputData\Reader\Impl\EngineOnlyVectoRunDataFactory.cs" />
<Compile Include="InputData\Reader\ShiftPolygonReader.cs" />
<Compile Include="Models\Declaration\ADASBenefits.cs" />
<Compile Include="Models\Declaration\ADASCombinations.cs" />
<Compile Include="Models\Declaration\AuxDemandEntry.cs" />
<Compile Include="Models\Declaration\AuxiliaryTypeHelper.cs" />
<Compile Include="Models\Connector\Ports\IDriverDemandPort.cs" />
......@@ -618,8 +616,6 @@
<EmbeddedResource Include="Resources\XSD\VectoOutputCustomer.0.7.xsd">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Declaration\ADAS\ADAS_Benefits.csv" />
<EmbeddedResource Include="Resources\Declaration\ADAS\ADAS_Combinations.csv" />
<EmbeddedResource Include="Resources\Declaration\CO2Standards\MissionProfileWeights.csv" />
<EmbeddedResource Include="Resources\Declaration\CO2Standards\WeightingGroups.csv" />
<EmbeddedResource Include="Resources\Declaration\TyreLabeling.csv" />
......
......@@ -1988,73 +1988,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration
CollectionAssert.AreEqual(withSTT1, runs[9].VehicleData.AxleData.Select(a => a.Inertia.Value()));
}
[TestCase(false, false, false, PredictiveCruiseControlType.None, "0"),
TestCase(true, false, false, PredictiveCruiseControlType.None, "1"),
TestCase(true, false, false, PredictiveCruiseControlType.Option_1_2_3, "7/2"),
TestCase(true, true, false, PredictiveCruiseControlType.Option_1_2, "10/1")]
public void TestADASCombinationLookup(
bool engineStopStart, bool ecoRollWOEngineStop, bool ecoRollWEngineStop, PredictiveCruiseControlType pcc,
string expectedADASGroup)
{
var adas = DeclarationData.ADASCombinations.Lookup(engineStopStart, EcorollTypeHelper.Get(ecoRollWOEngineStop, ecoRollWEngineStop), pcc);
Assert.AreEqual(adas.ID, expectedADASGroup);
}
[TestCase(true, true, true, PredictiveCruiseControlType.Option_1_2),
TestCase(true, true, true, PredictiveCruiseControlType.None)]
public void TestInvalidADASCombinationLookup(
bool engineStopStart, bool ecoRollWOEngineStop, bool ecoRollWEngineStop, PredictiveCruiseControlType pcc)
{
AssertHelper.Exception<VectoException>(() => {
DeclarationData.ADASCombinations.Lookup(engineStopStart, EcorollTypeHelper.Get(ecoRollWOEngineStop, ecoRollWEngineStop), pcc);
});
}
[TestCase(VehicleClass.Class4, "0", MissionType.LongHaul, LoadingType.LowLoading, 0.0),
TestCase(VehicleClass.Class5, "0", MissionType.LongHaul, LoadingType.LowLoading, 0.0),
TestCase(VehicleClass.Class9, "0", MissionType.LongHaul, LoadingType.LowLoading, 0.0),
TestCase(VehicleClass.Class10, "0", MissionType.LongHaul, LoadingType.LowLoading, 0.0),
TestCase(VehicleClass.Class4, "4/1", MissionType.LongHaul, LoadingType.ReferenceLoad, -0.4),
TestCase(VehicleClass.Class4, "8/2", MissionType.LongHaul, LoadingType.LowLoading, -0.1),
TestCase(VehicleClass.Class4, "11/1", MissionType.RegionalDelivery, LoadingType.ReferenceLoad, -0.8),
TestCase(VehicleClass.Class5, "3", MissionType.LongHaul, LoadingType.ReferenceLoad, -0.2),
TestCase(VehicleClass.Class5, "5", MissionType.RegionalDelivery, LoadingType.ReferenceLoad, -0.4),
TestCase(VehicleClass.Class5, "11/1", MissionType.UrbanDelivery, LoadingType.ReferenceLoad, -1.3),
TestCase(VehicleClass.Class9, "1", MissionType.RegionalDeliveryEMS, LoadingType.ReferenceLoad, -0.2),
TestCase(VehicleClass.Class9, "6", MissionType.LongHaulEMS, LoadingType.ReferenceLoad, -0.2),
TestCase(VehicleClass.Class9, "10/1", MissionType.LongHaul, LoadingType.ReferenceLoad, -0.5),
TestCase(VehicleClass.Class10, "2", MissionType.LongHaul, LoadingType.ReferenceLoad, -0.1),
TestCase(VehicleClass.Class10, "4/2", MissionType.RegionalDeliveryEMS, LoadingType.LowLoading, -0.6),
TestCase(VehicleClass.Class10, "11/2", MissionType.RegionalDelivery, LoadingType.ReferenceLoad, -1.4)
]
public void TestADASBenefitLookup(
VehicleClass group, string adasConfig, MissionType mission, LoadingType loading, double expectedBenefit)
{
var expectedCorrectionFactor = 1 + expectedBenefit / 100.0;
var factor = DeclarationData.ADASBenefits.Lookup(
group, new ADASCombination() { ID = adasConfig }, mission, loading);
Assert.AreEqual(expectedCorrectionFactor, factor, 1e-6, "group: {0}, adas: {1}, mission: {2}, payload: {3}, expectedBenefit: {4}, actualBenefit: {5}",
group, adasConfig, mission, loading, expectedBenefit, (factor - 1)*100.0);
}
[TestCase(VehicleClass.Class4, "3", MissionType.LongHaul, LoadingType.FullLoading),
TestCase(VehicleClass.Class4, "5", MissionType.LongHaulEMS, LoadingType.LowLoading),
TestCase(VehicleClass.Class7, "10/1", MissionType.LongHaul, LoadingType.LowLoading),
TestCase(VehicleClass.Class8, "2", MissionType.RegionalDelivery, LoadingType.LowLoading),
]
public void TestIvalidADASBenefitLookup(
VehicleClass group, string adasConfig, MissionType mission, LoadingType loading)
{
var expectedBenefit = 0.0;
var expectedCorrectionFactor = 1 + expectedBenefit / 100.0;
var factor = DeclarationData.ADASBenefits.Lookup(
group, new ADASCombination() { ID = adasConfig }, mission, loading);
Assert.AreEqual(expectedCorrectionFactor, factor, 1e-6, "group: {0}, adas: {1}, mission: {2}, payload: {3}, expectedBenefit: {4}, actualBenefit: {5}",
group, adasConfig, mission, loading, expectedBenefit, (factor - 1) * 100.0);
}
[
TestCase("Diesel CI", null, 1.0),
TestCase("Ethanol CI", null, 1.011811),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment