diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index 3fa0f6d57117556da39965436ab9a12e885a0772..d6a24d93ae32a11c8f07b8f05dfca6b345e6cab5 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -72,7 +72,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl driverdata.AccelerationCurve = AccelerationCurveReader.ReadFromStream(segment.AccelerationFile); var tempVehicle = dao.CreateVehicleData(InputDataProvider.VehicleInputData, InputDataProvider.AirdragInputData, - segment.Missions.First(), segment.Missions.First().Loadings.First().Value, segment.VehicleHeight, segment.MunicipalBodyWeight); + segment.Missions.First(), segment.Missions.First().Loadings.First().Value, segment.VehicleHeight, + segment.MunicipalBodyWeight); var engineData = dao.CreateEngineData(InputDataProvider.EngineInputData, InputDataProvider.GearboxInputData, InputDataProvider.VehicleInputData.TorqueLimits); var axlegearData = dao.CreateAxleGearData(InputDataProvider.AxleGearInputData, false); @@ -87,7 +88,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl var powertrainConfig = new VectoRunData() { VehicleData = dao.CreateVehicleData(InputDataProvider.VehicleInputData, InputDataProvider.AirdragInputData, - segment.Missions.First(), segment.Missions.First().Loadings.First().Value, segment.VehicleHeight, segment.MunicipalBodyWeight), + segment.Missions.First(), segment.Missions.First().Loadings.First().Value, segment.VehicleHeight, + segment.MunicipalBodyWeight), EngineData = engineData, GearboxData = gearboxData, AxleGearData = axlegearData, @@ -97,9 +99,10 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl }; Report.InitializeReport(powertrainConfig, segment); } - var maxEnginePower = engineData.FullLoadCurves[0].FullLoadStationaryPower(engineData.FullLoadCurves[0].PreferredSpeed); + foreach (var mission in segment.Missions) { - if (mission.MissionType.IsEMS() && maxEnginePower.IsSmaller(DeclarationData.MinEnginePowerForEMS)) { + if (mission.MissionType.IsEMS() && + engineData.FullLoadCurves[0].MaxPower.IsSmaller(DeclarationData.MinEnginePowerForEMS)) { continue; } DrivingCycleData cycle; diff --git a/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv b/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv index 4662ec2f104a65e2b9ed86365df5d5d6a38b8a9f..23434dc26f2184e6e6c09b571d4358a8961683f1 100644 --- a/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv +++ b/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv @@ -5,8 +5,8 @@ B2 , 1900 , - , - B3 , 2000 , - , - , 0 , , 47.7 , --- B4 , 2100 , - , - , 0 , , 49.4 , --- B5 , 2200 , - , - , 0 , , 51.9 , """B6"" changed to ""B5"" as ""old B5"" not applicable anymore" -T1 , 3400 , 10500 , 1.3/0.6 , 2 , 235/75 R17.5 , 39.8 , -T2 , 5400 , 18000 , 1.5/0.6 , 2 , 385/65 R22.5 , 49.5 , -ST1 , 7500 , 24000 , 0/1.2 , 3 , 385/65 R22.5 , 91.0 , relevant for fully loaded is GVM of tractor semitrailer combination = 40000kg -ST1-v2 , 7500 , - , 0/1.2 , 3 , 385/65 R22.5 , 91.0 , +T1 , 3400 , 10500 , 1.3 , 2 , 235/75 R17.5 , 39.8 , +T2 , 5400 , 18000 , 1.5/1.5 , 2 , 385/65 R22.5 , 49.5 , +ST1 , 7500 , 24000 , 0/2.1 , 3 , 385/65 R22.5 , 91.0 , relevant for fully loaded is GVM of tractor semitrailer combination = 40000kg +ST1-v2 , 7500 , - , 0/2.1 , 3 , 385/65 R22.5 , 91.0 , Dolly , 2500 , 12000 , 0/0 , 2 , 315/70 R22.5 , 0.0 , only relevant for EMS diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs index 14cabbc84ff3173eb9c31b4bb9c4b2bc03917bac..066547b81eb552293bb1428ef8a569626e48d4f7 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs @@ -1,15 +1,29 @@ +using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.JSON; +using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.Models.Declaration; +using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter { public class DeclarationAdapterTestHelper { + public static VectoRunData[] CreateVectoRunData(string file) + { + var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); + var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); + var runData = dataReader.NextRun().ToArray(); + return runData; + } + public static void AssertVehicleData(VehicleData vehicleData, VehicleCategory vehicleCategory, - VehicleClass vehicleClass, - AxleConfiguration axleConfiguration, double wheelsInertia, double totalVehicleWeight, double totalRollResistance) + VehicleClass vehicleClass, AxleConfiguration axleConfiguration, double wheelsInertia, double totalVehicleWeight, + double totalRollResistance, double aerodynamicDragArea) { Assert.AreEqual(vehicleCategory, vehicleData.VehicleCategory, "VehicleCategory"); Assert.AreEqual(vehicleClass, vehicleData.VehicleClass, "VehicleClass"); @@ -17,6 +31,8 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter Assert.AreEqual(totalVehicleWeight, vehicleData.TotalVehicleWeight.Value(), 1e-3, "TotalVehicleWeight"); Assert.AreEqual(wheelsInertia, vehicleData.WheelsInertia.Value(), 1e-6, "WheelsInertia"); Assert.AreEqual(totalRollResistance, vehicleData.TotalRollResistanceCoefficient, 1e-6, "TotalRollResistance"); + + Assert.AreEqual(aerodynamicDragArea, vehicleData.CrossWindCorrectionCurve.AirDragArea.Value(), 1e-6, "Cd x A"); } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs index e3d149dd482136436963e76b157c53d3440288ef..b20062080528630f212850e99705425f79486adf 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs @@ -17,13 +17,12 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto"; public const int CurbWeight = 4670; + public const double CdxA = 4.83; [TestCase(Class2RigidTruckNoEMSJob, 0)] public void TestClass2_Vehicle_LongHaul_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); Assert.AreEqual(6, runData.Length); @@ -34,15 +33,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 57, totalVehicleWeight: CurbWeight + 1900 + 3400 + 603.917 + 710, - totalRollResistance: 0.006954); + totalRollResistance: 0.006954, + aerodynamicDragArea: CdxA + 1.3); } [TestCase(Class2RigidTruckNoEMSJob, 1)] public void TestClass2_Vehicle_LongHaul_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // long haul, ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -51,16 +49,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 57, totalVehicleWeight: CurbWeight + 1900 + 3400 + 4541.176 + 5325, - totalRollResistance: 0.0065733); + totalRollResistance: 0.0065733, + aerodynamicDragArea: CdxA + 1.3); } [TestCase(Class2RigidTruckNoEMSJob, 2)] public void TestClass2_Vehicle_RegionalDel_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -69,15 +66,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 39, totalVehicleWeight: CurbWeight + 1900 + 603.917, - totalRollResistance: 0.007461); + totalRollResistance: 0.007461, + aerodynamicDragArea: CdxA); } [TestCase(Class2RigidTruckNoEMSJob, 3)] public void TestClass2_Vehicle_RegionalDel_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -86,17 +82,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 39, totalVehicleWeight: CurbWeight + 1900 + 3019.588, - totalRollResistance: 0.007248); + totalRollResistance: 0.007248, + aerodynamicDragArea: CdxA); } [TestCase(Class2RigidTruckNoEMSJob, 4)] public void TestClass2_Vehicle_UrbanDel_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); - + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // municipal, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, vehicleCategory: VehicleCategory.RigidTruck, @@ -104,15 +98,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 39, totalVehicleWeight: CurbWeight + 1900 + 603.917, - totalRollResistance: 0.007461); + totalRollResistance: 0.007461, + aerodynamicDragArea: CdxA); } [TestCase(Class2RigidTruckNoEMSJob, 5)] public void TestClass2_Vehicle_UrbanDel_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // municipal, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -121,7 +114,8 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 39, totalVehicleWeight: CurbWeight + 1900 + 3019.588, - totalRollResistance: 0.007248); + totalRollResistance: 0.007248, + aerodynamicDragArea: CdxA); } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs index 524be959bb7527ad9bb22e6a42c23a436ef70d99..38e1589b023368083206a4c71b419de4e1a6d490 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs @@ -13,19 +13,19 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter [TestFixture] public class DeclarationDataAdapterTest_Class5 { - public const string Class5TractorNoEMS_PTOJob = + public const string Class5TractorPTOJob = @"TestData\Integration\DeclarationMode\Class5_Tractor_4x2\Class5_Tractor_DECL.vecto"; public const int CurbWeight = 8229; - [TestCase(Class5TractorNoEMS_PTOJob, 0)] + public const double CdxA = 5.3; + + [TestCase(Class5TractorPTOJob, 0)] public void TestClass5_Vehicle_LongHaul_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); - Assert.AreEqual(4, runData.Length); + Assert.AreEqual(8, runData.Length); // long haul, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -34,15 +34,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 204.6, totalVehicleWeight: CurbWeight + 7500 + 2600, - totalRollResistance: 0.0062662); + totalRollResistance: 0.0062662, + aerodynamicDragArea: CdxA); } - [TestCase(Class5TractorNoEMS_PTOJob, 1)] + [TestCase(Class5TractorPTOJob, 1)] public void TestClass5_Vehicle_LongHaul_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // long haul, ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -51,16 +50,48 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 204.6, totalVehicleWeight: CurbWeight + 7500 + 19300, - totalRollResistance: 0.00587322); + totalRollResistance: 0.00587322, + aerodynamicDragArea: CdxA); } + [TestCase(Class5TractorPTOJob, 2)] + public void TestClass5_Vehicle_LongHaul_EMS_LowLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + Assert.AreEqual(8, runData.Length); + + // long haul, min load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.Tractor, + vehicleClass: VehicleClass.Class5, + axleConfiguration: AxleConfiguration.AxleConfig_4x2, + wheelsInertia: 281.4, + totalVehicleWeight: CurbWeight + 7500 + 5400 + 3500, + totalRollResistance: 0.0062159, + aerodynamicDragArea: CdxA + 1.5); + } + + [TestCase(Class5TractorPTOJob, 3)] + public void TestClass5_Vehicle_LongHaul_EMS_RefLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // long haul, ref load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.Tractor, + vehicleClass: VehicleClass.Class5, + axleConfiguration: AxleConfiguration.AxleConfig_4x2, + wheelsInertia: 281.4, + totalVehicleWeight: CurbWeight + 7500 + 5400 + 26500, + totalRollResistance: 0.0058192, + aerodynamicDragArea: CdxA + 1.5); + } - [TestCase(Class5TractorNoEMS_PTOJob, 2)] + [TestCase(Class5TractorPTOJob, 4)] public void TestClass5_Vehicle_RegionalDel_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -69,15 +100,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 204.6, totalVehicleWeight: CurbWeight + 7500 + 2600, - totalRollResistance: 0.0062565); + totalRollResistance: 0.0062565, + aerodynamicDragArea: CdxA); } - [TestCase(Class5TractorNoEMS_PTOJob, 3)] + [TestCase(Class5TractorPTOJob, 5)] public void TestClass5_Vehicle_RegionalDel_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -86,7 +116,40 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter axleConfiguration: AxleConfiguration.AxleConfig_4x2, wheelsInertia: 204.6, totalVehicleWeight: CurbWeight + 7500 + 12900, - totalRollResistance: 0.0059836); + totalRollResistance: 0.0059836, + aerodynamicDragArea: CdxA); + } + + [TestCase(Class5TractorPTOJob, 6)] + public void TestClass5_Vehicle_RegionalDelEMS_LowLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // regional del., min load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.Tractor, + vehicleClass: VehicleClass.Class5, + axleConfiguration: AxleConfiguration.AxleConfig_4x2, + wheelsInertia: 281.4, + totalVehicleWeight: CurbWeight + 7500 + 5400 + 3500, + totalRollResistance: 0.006259, + aerodynamicDragArea: CdxA + 1.5); + } + + [TestCase(Class5TractorPTOJob, 7)] + public void TestClass5_Vehicle_RegionalDelEMS_RefLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // regional del., ref load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.Tractor, + vehicleClass: VehicleClass.Class5, + axleConfiguration: AxleConfiguration.AxleConfig_4x2, + wheelsInertia: 281.4, + totalVehicleWeight: CurbWeight + 7500 + 5400 + 17500, + totalRollResistance: 0.0059836, + aerodynamicDragArea: CdxA + 1.5); } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs index 6f3b506a25f4be67e2501991b727e092ecb1e17f..37107d56ab462e891b5b8136ad030182578a5bbc 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs @@ -5,6 +5,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.Models.Declaration; +using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; @@ -13,17 +14,18 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter [TestFixture] public class DeclarationDataAdapterTest_Class9 { - public const string Class9RigidTruckNoEMS_PTOJob = + public const string Class9RigidTruckJob = @"TestData\Integration\DeclarationMode\Class9_RigidTruck_6x2\Class9_RigidTruck_DECL.vecto"; - [TestCase(Class9RigidTruckNoEMS_PTOJob, 0)] + public const int CurbWeight = 9300; + public const double CdxA = 5.2; + + [TestCase(Class9RigidTruckJob, 0)] public void TestClass9_Vehicle_LongHaul_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); - Assert.AreEqual(6, runData.Length); + Assert.AreEqual(10, runData.Length); // long haul, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -31,16 +33,16 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 196, - totalVehicleWeight: 9300 + 2200 + 5400 + 2600, - totalRollResistance: 0.0059426); + totalVehicleWeight: CurbWeight + 2200 + 5400 + 2600, + totalRollResistance: 0.0059426, + aerodynamicDragArea: CdxA + 1.5); } - [TestCase(Class9RigidTruckNoEMS_PTOJob, 1)] + + [TestCase(Class9RigidTruckJob, 1)] public void TestClass9_Vehicle_LongHaul_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // long haul, ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -48,17 +50,47 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 196, - totalVehicleWeight: 9300 + 2200 + 5400 + 19300, - totalRollResistance: 0.00558611); + totalVehicleWeight: CurbWeight + 2200 + 5400 + 19300, + totalRollResistance: 0.00558611, + aerodynamicDragArea: CdxA + 1.5); + } + + [TestCase(Class9RigidTruckJob, 2)] + public void TestClass9_Vehicle_LongHaul_EMS_LowLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // long haul, min load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.RigidTruck, + vehicleClass: VehicleClass.Class9, + axleConfiguration: AxleConfiguration.AxleConfig_6x2, + wheelsInertia: 294, + totalVehicleWeight: CurbWeight + 2200 + 2500 + 7500 + 3500, + totalRollResistance: 0.0060500, + aerodynamicDragArea: CdxA + 2.1); } + [TestCase(Class9RigidTruckJob, 3)] + public void TestClass9_Vehicle_LongHaul_EMS_RefLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // long haul, ref load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.RigidTruck, + vehicleClass: VehicleClass.Class9, + axleConfiguration: AxleConfiguration.AxleConfig_6x2, + wheelsInertia: 294, + totalVehicleWeight: CurbWeight + 2200 + 2500 + 7500 + 26500, + totalRollResistance: 0.0056680, + aerodynamicDragArea: CdxA + 2.1); + } - [TestCase(Class9RigidTruckNoEMS_PTOJob, 2)] + [TestCase(Class9RigidTruckJob, 4)] public void TestClass9_Vehicle_RegionalDel_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -66,16 +98,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 119.2, - totalVehicleWeight: 9300 + 2200 + 1400, - totalRollResistance: 0.0059109); + totalVehicleWeight: CurbWeight + 2200 + 1400, + totalRollResistance: 0.0059109, + aerodynamicDragArea: CdxA); } - [TestCase(Class9RigidTruckNoEMS_PTOJob, 3)] + [TestCase(Class9RigidTruckJob, 5)] public void TestClass9_Vehicle_RegionalDel_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // regional del., ref load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -83,17 +114,47 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 119.2, - totalVehicleWeight: 9300 + 2200 + 7100, - totalRollResistance: 0.0056986); + totalVehicleWeight: CurbWeight + 2200 + 7100, + totalRollResistance: 0.0056986, + aerodynamicDragArea: CdxA); + } + + [TestCase(Class9RigidTruckJob, 6)] + public void TestClass9_Vehicle_RegionalDel_EMS_LowLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // regional del., min load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.RigidTruck, + vehicleClass: VehicleClass.Class9, + axleConfiguration: AxleConfiguration.AxleConfig_6x2, + wheelsInertia: 294, + totalVehicleWeight: CurbWeight + 2200 + 2500 + 7500 + 3500, + totalRollResistance: 0.0060425, + aerodynamicDragArea: CdxA + 2.1); } + [TestCase(Class9RigidTruckJob, 7)] + public void TestClass9_Vehicle_RegionalDel_EMS_RefLoad(string file, int runIdx) + { + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); + + // regional del., ref load + DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, + vehicleCategory: VehicleCategory.RigidTruck, + vehicleClass: VehicleClass.Class9, + axleConfiguration: AxleConfiguration.AxleConfig_6x2, + wheelsInertia: 294, + totalVehicleWeight: CurbWeight + 2200 + 2500 + 7500 + 17500, + totalRollResistance: 0.0057797, + aerodynamicDragArea: CdxA + 2.1); + } - [TestCase(Class9RigidTruckNoEMS_PTOJob, 4)] + [TestCase(Class9RigidTruckJob, 8)] public void TestClass9_Vehicle_Municipal_LowLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // municipal, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -101,16 +162,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 119.2, - totalVehicleWeight: 9300 + 6750 + 1200, - totalRollResistance: 0.0057417); + totalVehicleWeight: CurbWeight + 6750 + 1200, + totalRollResistance: 0.0057417, + aerodynamicDragArea: CdxA); } - [TestCase(Class9RigidTruckNoEMS_PTOJob, 5)] + [TestCase(Class9RigidTruckJob, 9)] public void TestClass9_Vehicle_Municipal_RefLoad(string file, int runIdx) { - var inputData = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(file); - var dataReader = new DeclarationModeVectoRunDataFactory(inputData, null); - var runData = dataReader.NextRun().ToArray(); + var runData = DeclarationAdapterTestHelper.CreateVectoRunData(file); // municipal, min load DeclarationAdapterTestHelper.AssertVehicleData(runData[runIdx].VehicleData, @@ -118,8 +178,9 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter vehicleClass: VehicleClass.Class9, axleConfiguration: AxleConfiguration.AxleConfig_6x2, wheelsInertia: 119.2, - totalVehicleWeight: 9300 + 6750 + 6000, - totalRollResistance: 0.005602); + totalVehicleWeight: CurbWeight + 6750 + 6000, + totalRollResistance: 0.005602, + aerodynamicDragArea: CdxA); } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 9d9b96fb64c483cd6c396c258a05b7eb34d00ff9..93468548f9addff4f0db100f7d1bf49a8e02ca06 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -706,29 +706,53 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(3, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.225, 0.325 }, - trailerAxleWeightDistribution: new[] { 0.45 }, trailerAxleCount: new[] { 2 }, bodyCurbWeight: 1900, + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.225, 0.325 }, + trailerAxleWeightDistribution: new[] { 0.45 }, + trailerAxleCount: new[] { 2 }, + bodyCurbWeight: 1900, trailerCurbWeight: new[] { 3400.0 }, - trailerType: new[] { TrailerType.T1 }, lowLoad: 1306.8235, refLoad: 9813.2353, + trailerType: new[] { TrailerType.T1 }, + lowLoad: 1306.8235, + refLoad: 9813.2353, trailerGrossVehicleWeight: new[] { 10500.0 }, - deltaCdA: 1.3, maxLoad: 11250); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.45, 0.55 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 1900, + deltaCdA: 1.3, + maxLoad: 11250); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.45, 0.55 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 1900, trailerCurbWeight: new double[] { }, - trailerType: new TrailerType[] { }, lowLoad: 596.8235, refLoad: 2984.1176, + trailerType: new TrailerType[] { }, + lowLoad: 596.8235, + refLoad: 2984.1176, trailerGrossVehicleWeight: new double[] { }, - deltaCdA: 0, maxLoad: 4150); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.UrbanDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.45, 0.55 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 1900, + deltaCdA: 0, + maxLoad: 4150); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.UrbanDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.45, 0.55 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 1900, trailerCurbWeight: new double[] { }, - trailerType: new TrailerType[] { }, lowLoad: 596.8235, refLoad: 2984.1176, + trailerType: new TrailerType[] { }, + lowLoad: 596.8235, + refLoad: 2984.1176, trailerGrossVehicleWeight: new double[] { }, - deltaCdA: 0, maxLoad: 4150); + deltaCdA: 0, + maxLoad: 4150); } /// <summary> @@ -751,17 +775,37 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(2, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.4, 0.6 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2000, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 762.3529, refLoad: 3811.7647, - trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 6150); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.UrbanDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.4, 0.6 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2000, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 762.3529, refLoad: 3811.7647, - trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 6150); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.4, 0.6 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2000, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 762.3529, + refLoad: 3811.7647, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 6150); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.UrbanDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.4, 0.6 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2000, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 762.3529, + refLoad: 3811.7647, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 6150); } /// <summary> @@ -787,23 +831,53 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(3, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.2, 0.3 }, - trailerAxleWeightDistribution: new[] { 0.5 }, trailerAxleCount: new[] { 2 }, bodyCurbWeight: 2100, - trailerCurbWeight: new[] { 5400.0 }, trailerType: new[] { TrailerType.T2 }, lowLoad: 1900, refLoad: 14000, - trailerGrossVehicleWeight: new[] { 18000.0 }, deltaCdA: 1.5, maxLoad: 21000); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.45, 0.55 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2100, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 900, refLoad: 4400, - trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 8400); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.MunicipalUtility, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.45, 0.55 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2100, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 600, refLoad: 3000, - trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 8400); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.2, 0.3 }, + trailerAxleWeightDistribution: new[] { 0.5 }, + trailerAxleCount: new[] { 2 }, + bodyCurbWeight: 2100, + trailerCurbWeight: new[] { 5400.0 }, + trailerType: new[] { TrailerType.T2 }, + lowLoad: 1900, + refLoad: 14000, + trailerGrossVehicleWeight: new[] { 18000.0 }, + deltaCdA: 1.5, + maxLoad: 21000); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.45, 0.55 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2100, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 900, + refLoad: 4400, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 8400); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.MunicipalUtility, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.45, 0.55 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2100, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 600, + refLoad: 3000, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 8400); } /// <summary> @@ -829,29 +903,69 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(4, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.2, 0.25 }, - trailerAxleWeightDistribution: new[] { 0.55 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 19300, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.LongHaulEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.15, 0.2 }, - trailerAxleWeightDistribution: new[] { 0.40, 0.25 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 26500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.25, 0.25 }, - trailerAxleWeightDistribution: new[] { 0.5 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 12900, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[3], vehicleData: vehicleData, missionType: MissionType.RegionalDeliveryEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.175, 0.25 }, - trailerAxleWeightDistribution: new[] { 0.35, 0.225 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 17500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.2, 0.25 }, + trailerAxleWeightDistribution: new[] { 0.55 }, + trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 19300, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.LongHaulEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.15, 0.2 }, + trailerAxleWeightDistribution: new[] { 0.40, 0.25 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 26500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.25, 0.25 }, + trailerAxleWeightDistribution: new[] { 0.5 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 12900, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, maxLoad: 25000); + + AssertMission(segment.Missions[3], + vehicleData: vehicleData, + missionType: MissionType.RegionalDeliveryEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.175, 0.25 }, + trailerAxleWeightDistribution: new[] { 0.35, 0.225 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 17500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); } /// <summary> @@ -877,35 +991,87 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(5, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.2, 0.3, 0.15 }, - trailerAxleWeightDistribution: new[] { 0.35 }, trailerAxleCount: new[] { 2 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 5400.0 }, trailerType: new[] { TrailerType.T2 }, lowLoad: 2600, refLoad: 19300, - trailerGrossVehicleWeight: new[] { 18000.0 }, deltaCdA: 1.5, maxLoad: 24900); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.LongHaulEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.15, 0.2, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.225, 0.325 }, trailerAxleCount: new[] { 2, 3 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 2500, 7500.0 }, trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, lowLoad: 3500, - refLoad: 26500, trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, deltaCdA: 1.2, maxLoad: 40300, ems: true); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.35, 0.4, 0.25 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1400, - refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); - - AssertMission(segment.Missions[3], vehicleData: vehicleData, missionType: MissionType.RegionalDeliveryEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.175, 0.2, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.225, 0.3 }, trailerAxleCount: new[] { 2, 3 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 2500, 7500.0 }, trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, lowLoad: 3500, - refLoad: 17500, trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, deltaCdA: 1.2, maxLoad: 40300, ems: true); - - AssertMission(segment.Missions[4], vehicleData: vehicleData, missionType: MissionType.MunicipalUtility, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.35, 0.4, 0.25 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1200, - refLoad: 6000, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.2, 0.3, 0.15 }, + trailerAxleWeightDistribution: new[] { 0.35 }, + trailerAxleCount: new[] { 2 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 5400.0 }, + trailerType: new[] { TrailerType.T2 }, + lowLoad: 2600, + refLoad: 19300, + trailerGrossVehicleWeight: new[] { 18000.0 }, + deltaCdA: 1.5, + maxLoad: 24900); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.LongHaulEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.15, 0.2, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.225, 0.325 }, + trailerAxleCount: new[] { 2, 3 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 2500, 7500.0 }, + trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, + lowLoad: 3500, + refLoad: 26500, + trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, + deltaCdA: 2.1, + maxLoad: 40300, + ems: true); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.35, 0.4, 0.25 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2200, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 1400, + refLoad: 7100, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 14300); + + AssertMission(segment.Missions[3], + vehicleData: vehicleData, + missionType: MissionType.RegionalDeliveryEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.175, 0.2, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.225, 0.3 }, + trailerAxleCount: new[] { 2, 3 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 2500, 7500.0 }, + trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, + lowLoad: 3500, + refLoad: 17500, + trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, + deltaCdA: 2.1, + maxLoad: 40300, + ems: true); + + AssertMission(segment.Missions[4], + vehicleData: vehicleData, + missionType: MissionType.MunicipalUtility, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.35, 0.4, 0.25 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2200, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 1200, + refLoad: 6000, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 14300); } /// <summary> @@ -931,29 +1097,71 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(4, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.15, 0.1, 0.2 }, - trailerAxleWeightDistribution: new[] { 0.55 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 19300, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.LongHaulEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.125, 0.15, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.375, 0.25 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 26500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.2, 0.1, 0.2 }, - trailerAxleWeightDistribution: new[] { 0.5 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 12900, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[3], vehicleData: vehicleData, missionType: MissionType.RegionalDeliveryEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.15, 0.15, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.35, 0.25 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 17500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.15, 0.1, 0.2 }, + trailerAxleWeightDistribution: new[] { 0.55 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 19300, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.LongHaulEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.125, 0.15, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.375, 0.25 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 26500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.2, 0.1, 0.2 }, + trailerAxleWeightDistribution: new[] { 0.5 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 12900, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000); + + AssertMission(segment.Missions[3], + vehicleData: vehicleData, + missionType: MissionType.RegionalDeliveryEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.15, 0.15, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.35, 0.25 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 17500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); } /// <summary> @@ -979,41 +1187,102 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(6, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.2, 0.225, 0.225 }, - trailerAxleWeightDistribution: new[] { 0.35 }, trailerAxleCount: new[] { 2 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 5400.0 }, trailerType: new[] { TrailerType.T2 }, lowLoad: 2600, refLoad: 19300, - trailerGrossVehicleWeight: new[] { 18000.0 }, deltaCdA: 1.5, maxLoad: 24900); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.LongHaulEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.15, 0.2, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.225, 0.325 }, trailerAxleCount: new[] { 2, 3 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 2500, 7500.0 }, trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, lowLoad: 3500, - refLoad: 26500, trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, deltaCdA: 1.2, maxLoad: 40300, ems: true); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1400, - refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); - - AssertMission(segment.Missions[3], vehicleData: vehicleData, missionType: MissionType.RegionalDeliveryEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.175, 0.2, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.225, 0.3 }, trailerAxleCount: new[] { 2, 3 }, bodyCurbWeight: 2200, - trailerCurbWeight: new[] { 2500, 7500.0 }, trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, lowLoad: 3500, - refLoad: 17500, trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, deltaCdA: 1.2, maxLoad: 40300, ems: true); - - AssertMission(segment.Missions[4], vehicleData: vehicleData, missionType: MissionType.MunicipalUtility, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1200, - refLoad: 6000, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); - - AssertMission(segment.Missions[5], vehicleData: vehicleData, missionType: MissionType.Construction, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1400, - refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.2, 0.225, 0.225 }, + trailerAxleWeightDistribution: new[] { 0.35 }, + trailerAxleCount: new[] { 2 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 5400.0 }, + trailerType: new[] { TrailerType.T2 }, + lowLoad: 2600, + refLoad: 19300, + trailerGrossVehicleWeight: new[] { 18000.0 }, + deltaCdA: 1.5, + maxLoad: 24900); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.LongHaulEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.15, 0.2, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.225, 0.325 }, + trailerAxleCount: new[] { 2, 3 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 2500, 7500.0 }, + trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, + lowLoad: 3500, + refLoad: 26500, + trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, + deltaCdA: 2.1, + maxLoad: 40300, + ems: true); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, bodyCurbWeight: 2200, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 1400, + refLoad: 7100, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 14300); + + AssertMission(segment.Missions[3], + vehicleData: vehicleData, + missionType: MissionType.RegionalDeliveryEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.175, 0.2, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.225, 0.3 }, + trailerAxleCount: new[] { 2, 3 }, + bodyCurbWeight: 2200, + trailerCurbWeight: new[] { 2500, 7500.0 }, + trailerType: new[] { TrailerType.Dolly, TrailerType.ST1 }, + lowLoad: 3500, + refLoad: 17500, + trailerGrossVehicleWeight: new[] { 12000.0, 24000 }, + deltaCdA: 2.1, + maxLoad: 40300, + ems: true); + + AssertMission(segment.Missions[4], + vehicleData: vehicleData, + missionType: MissionType.MunicipalUtility, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2200, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 1200, + refLoad: 6000, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 14300); + + AssertMission(segment.Missions[5], + vehicleData: vehicleData, + missionType: MissionType.Construction, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.35, 0.35, 0.3 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 2200, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 1400, + refLoad: 7100, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 14300); } /// <summary> @@ -1039,35 +1308,88 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(5, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.LongHaul, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.15, 0.15, 0.15 }, - trailerAxleWeightDistribution: new[] { 0.55 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 19300, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[1], vehicleData: vehicleData, missionType: MissionType.LongHaulEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.125, 0.15, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.375, 0.25 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 26500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); - - AssertMission(segment.Missions[2], vehicleData: vehicleData, missionType: MissionType.RegionalDelivery, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.2, 0.15, 0.15 }, - trailerAxleWeightDistribution: new[] { 0.5 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, refLoad: 12900, - trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000); - - AssertMission(segment.Missions[3], vehicleData: vehicleData, missionType: MissionType.RegionalDeliveryEMS, - cosswindCorrection: "RigidTrailer", axleWeightDistribution: new[] { 0.15, 0.15, 0.1 }, - trailerAxleWeightDistribution: new[] { 0.35, 0.25 }, trailerAxleCount: new[] { 3, 2 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0, 5400 }, trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, lowLoad: 3500, - refLoad: 17500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); - - AssertMission(segment.Missions[4], vehicleData: vehicleData, missionType: MissionType.Construction, - cosswindCorrection: "TractorSemitrailer", axleWeightDistribution: new[] { 0.2, 0.15, 0.15 }, - trailerAxleWeightDistribution: new[] { 0.5 }, trailerAxleCount: new[] { 3 }, bodyCurbWeight: 0, - trailerCurbWeight: new[] { 7500.0 }, trailerType: new[] { TrailerType.ST1 }, lowLoad: 2600, - refLoad: 12900, trailerGrossVehicleWeight: new[] { 24000.0 }, deltaCdA: 0, maxLoad: 25000, ems: false); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.LongHaul, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.15, 0.15, 0.15 }, + trailerAxleWeightDistribution: new[] { 0.55 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 19300, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000); + + AssertMission(segment.Missions[1], + vehicleData: vehicleData, + missionType: MissionType.LongHaulEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.125, 0.15, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.375, 0.25 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 26500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); + + AssertMission(segment.Missions[2], + vehicleData: vehicleData, + missionType: MissionType.RegionalDelivery, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.2, 0.15, 0.15 }, + trailerAxleWeightDistribution: new[] { 0.5 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 12900, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000); + + AssertMission(segment.Missions[3], + vehicleData: vehicleData, + missionType: MissionType.RegionalDeliveryEMS, + cosswindCorrection: "RigidTrailer", + axleWeightDistribution: new[] { 0.15, 0.15, 0.1 }, + trailerAxleWeightDistribution: new[] { 0.35, 0.25 }, + trailerAxleCount: new[] { 3, 2 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0, 5400 }, + trailerType: new[] { TrailerType.ST1, TrailerType.T2 }, + lowLoad: 3500, + refLoad: 17500, + trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, + deltaCdA: 1.5, + maxLoad: 39600, + ems: true); + + AssertMission(segment.Missions[4], + vehicleData: vehicleData, + missionType: MissionType.Construction, + cosswindCorrection: "TractorSemitrailer", + axleWeightDistribution: new[] { 0.2, 0.15, 0.15 }, + trailerAxleWeightDistribution: new[] { 0.5 }, + trailerAxleCount: new[] { 3 }, + bodyCurbWeight: 0, + trailerCurbWeight: new[] { 7500.0 }, + trailerType: new[] { TrailerType.ST1 }, + lowLoad: 2600, + refLoad: 12900, + trailerGrossVehicleWeight: new[] { 24000.0 }, + deltaCdA: 0, + maxLoad: 25000, + ems: false); } /// <summary> @@ -1093,18 +1415,27 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(1, segment.Missions.Length); - AssertMission(segment.Missions[0], vehicleData: vehicleData, missionType: MissionType.Construction, - cosswindCorrection: "RigidSolo", axleWeightDistribution: new[] { 0.25, 0.25, 0.25, 0.25 }, - trailerAxleWeightDistribution: new double[] { }, trailerAxleCount: new int[] { }, bodyCurbWeight: 0, - trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 2600, refLoad: 12900, - trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 28500); + AssertMission(segment.Missions[0], + vehicleData: vehicleData, + missionType: MissionType.Construction, + cosswindCorrection: "RigidSolo", + axleWeightDistribution: new[] { 0.25, 0.25, 0.25, 0.25 }, + trailerAxleWeightDistribution: new double[] { }, + trailerAxleCount: new int[] { }, + bodyCurbWeight: 0, + trailerCurbWeight: new double[] { }, + trailerType: new TrailerType[] { }, + lowLoad: 2600, + refLoad: 12900, + trailerGrossVehicleWeight: new double[] { }, + deltaCdA: 0, + maxLoad: 28500); } public static void AssertMission(Mission m, dynamic vehicleData, MissionType missionType, string cosswindCorrection, double[] axleWeightDistribution, double[] trailerAxleWeightDistribution, int[] trailerAxleCount, - double bodyCurbWeight, - double[] trailerCurbWeight, TrailerType[] trailerType, double lowLoad, double refLoad, double maxLoad, - double[] trailerGrossVehicleWeight, double deltaCdA, bool ems = false) + double bodyCurbWeight, double[] trailerCurbWeight, TrailerType[] trailerType, double lowLoad, double refLoad, + double maxLoad, double[] trailerGrossVehicleWeight, double deltaCdA, bool ems = false) { Assert.AreEqual(missionType, m.MissionType); Assert.AreEqual(cosswindCorrection, m.CrossWindCorrectionParameters);