From 384fe2078eff8432ad524676bc67fa1c1a682912 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Thu, 18 May 2017 11:23:27 +0200 Subject: [PATCH] update payload10% computation: use separate lookup, make pc-formula in segment table more explicit, i.e. use pc50 or pc75 instead and map to according lookup --- .../Models/Declaration/DeclarationData.cs | 18 ++- .../VectoCore/Models/Declaration/Mission.cs | 7 +- .../VectoCore/Models/Declaration/Payloads.cs | 12 +- .../VectoCore/Models/Declaration/Segments.cs | 39 +++-- .../Resources/Declaration/Payloads.csv | 6 +- .../Resources/Declaration/SegmentTable.csv | 58 ++++---- .../Integration/FullCycleDeclarationTest.cs | 2 +- .../Models/Declaration/DeclarationDataTest.cs | 136 +++++++++--------- .../XML/XMLDeclarationInputTest.cs | 2 +- 9 files changed, 157 insertions(+), 123 deletions(-) diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index a937b6c80b..ed5ffc5965 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -72,19 +72,23 @@ namespace TUGraz.VectoCore.Models.Declaration /// Formula for calculating the payload for a given gross vehicle weight. /// (so called "pc-formula", Whitebook Apr 2016, Part 1, p.187) /// </summary> - public static Kilogram GetPayloadForGrossVehicleWeight(Kilogram grossVehicleWeight, MissionType missionType) + public static Kilogram GetPayloadForGrossVehicleWeight(Kilogram grossVehicleWeight, string equationName) { - return missionType == MissionType.LongHaul - ? Payloads.Lookup75Percent(grossVehicleWeight) - : Payloads.Lookup50Percent(grossVehicleWeight); + if (equationName.ToLower().StartsWith("pc10")) { + return Payloads.Lookup10Percent(grossVehicleWeight); + } + if (equationName.ToLower().StartsWith("pc75")) { + return Payloads.Lookup75Percent(grossVehicleWeight); + } + return Payloads.Lookup50Percent(grossVehicleWeight); } /// <summary> /// Returns the payload for a trailer. This is 75% of (GVW-CurbWeight). /// </summary> - public static Kilogram GetPayloadForTrailerWeight(Kilogram grossVehicleWeight, Kilogram curbWeight) + public static Kilogram GetPayloadForTrailerWeight(Kilogram grossVehicleWeight, Kilogram curbWeight, bool lowLoading) { - return Payloads.LookupTrailer(grossVehicleWeight, curbWeight); + return Payloads.LookupTrailer(grossVehicleWeight, curbWeight) / (lowLoading ? 7.5 : 1); } public static int PoweredAxle() @@ -164,7 +168,7 @@ namespace TUGraz.VectoCore.Models.Declaration public static readonly KilogramSquareMeter EngineBaseInertia = 0.41.SI<KilogramSquareMeter>(); public static readonly SI EngineDisplacementInertia = (0.27 * 1000).SI().Kilo.Gramm.Per.Meter; // [kg/m] - + public const double TorqueLimitGearboxFactor = 0.9; public const double TorqueLimitVehicleFactor = 0.95; diff --git a/VectoCore/VectoCore/Models/Declaration/Mission.cs b/VectoCore/VectoCore/Models/Declaration/Mission.cs index 1a4793c849..06b7a485dd 100644 --- a/VectoCore/VectoCore/Models/Declaration/Mission.cs +++ b/VectoCore/VectoCore/Models/Declaration/Mission.cs @@ -40,6 +40,7 @@ namespace TUGraz.VectoCore.Models.Declaration { FullLoading, ReferenceLoad, + LowLoading, EmptyLoading, } @@ -52,6 +53,8 @@ namespace TUGraz.VectoCore.Models.Declaration return "F"; case LoadingType.ReferenceLoad: return "R"; + case LoadingType.LowLoading: + return "L"; case LoadingType.EmptyLoading: return "E"; default: @@ -73,6 +76,7 @@ namespace TUGraz.VectoCore.Models.Declaration public List<MissionTrailer> Trailer; public Kilogram MinLoad; + public Kilogram LowLoad; public Kilogram RefLoad; public Kilogram MaxLoad; @@ -82,9 +86,8 @@ namespace TUGraz.VectoCore.Models.Declaration { get { return new Dictionary<LoadingType, Kilogram> { - { LoadingType.EmptyLoading, MinLoad }, + { LoadingType.LowLoading, LowLoad }, { LoadingType.ReferenceLoad, RefLoad }, - { LoadingType.FullLoading, MaxLoad } }; } } diff --git a/VectoCore/VectoCore/Models/Declaration/Payloads.cs b/VectoCore/VectoCore/Models/Declaration/Payloads.cs index 4ea0aa48e4..d2debbf27d 100644 --- a/VectoCore/VectoCore/Models/Declaration/Payloads.cs +++ b/VectoCore/VectoCore/Models/Declaration/Payloads.cs @@ -52,12 +52,20 @@ namespace TUGraz.VectoCore.Models.Declaration /// <summary> /// Obsolete. Call Lookup50Percent, Lookup75Percent or LookupTrailer instead! /// </summary> - [Obsolete("Call Lookup50Percent, Lookup75Percent or LookupTrailer!", true)] + [Obsolete("Call Lookup10Percent, Lookup50Percent, Lookup75Percent or LookupTrailer!", true)] private new PayloadEntry Lookup(Kilogram grossVehicleWeight) { throw new InvalidOperationException("Call Lookup50Percent, Lookup75Percent or LookupTrailer!"); } + public Kilogram Lookup10Percent(Kilogram grossVehicleWeight) + { + var section = Data.GetSection(d => d.Key > grossVehicleWeight); + return VectoMath.Interpolate(section.Item1.Key, section.Item2.Key, + section.Item1.Value.Payload10Percent, section.Item2.Value.Payload10Percent, + grossVehicleWeight); + } + public Kilogram Lookup50Percent(Kilogram grossVehicleWeight) { var section = Data.GetSection(d => d.Key > grossVehicleWeight); @@ -85,6 +93,7 @@ namespace TUGraz.VectoCore.Models.Declaration .ToDictionary( kv => kv.ParseDouble("grossvehicleweight").SI<Kilogram>(), kv => new PayloadEntry { + Payload10Percent = kv.ParseDouble("payload10%").SI<Kilogram>(), Payload50Percent = kv.ParseDouble("payload50%").SI<Kilogram>(), Payload75Percent = kv.ParseDouble("payload75%").SI<Kilogram>() }); @@ -92,6 +101,7 @@ namespace TUGraz.VectoCore.Models.Declaration public sealed class PayloadEntry { + public Kilogram Payload10Percent; public Kilogram Payload50Percent; public Kilogram Payload75Percent; } diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index c9bd41e31d..632f9c272f 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -53,8 +53,7 @@ namespace TUGraz.VectoCore.Models.Declaration protected override string ErrorMessage { - get - { + get { return "ERROR: Could not find the declaration segment for vehicle. Category: {0}, AxleConfiguration: {1}, GrossVehicleWeight: {2}"; } @@ -116,8 +115,8 @@ namespace TUGraz.VectoCore.Models.Declaration return (considerInvalid || isValid == "1") && category == vehicleCategory.ToString() && axleConf == axleConfiguration.GetName() - // MK 2016-06-07: normally the next condition should be "mass > massMin", except for 7.5t where is should be ">=" - // in any case ">=" is also correct, because the segment table is sorted by weight. + // MK 2016-06-07: normally the next condition should be "mass > massMin", except for 7.5t where is should be ">=" + // in any case ">=" is also correct, because the segment table is sorted by weight. && massMin <= grossVehicleMassRating && grossVehicleMassRating <= massMax; }); } catch (InvalidOperationException e) { @@ -145,8 +144,9 @@ namespace TUGraz.VectoCore.Models.Declaration return new[] { "1", "2", "3", "4" }.Contains(r.Field<string>("hdvclass")) && massMin <= grossVehicleMassRating && grossVehicleMassRating <= massMax; }); - if (rigidGVWrow != null) + if (rigidGVWrow != null) { vehicleHeight = rigidGVWrow.ParseDouble("height").SI<Meter>(); + } } return vehicleHeight; @@ -196,17 +196,17 @@ namespace TUGraz.VectoCore.Models.Declaration var maxLoad = gvw - curbWeight - body.CurbWeight - trailers.Sum(t => t.TrailerCurbWeight).DefaultIfNull(0); - var refLoadValue = row.ParseDoubleOrGetDefault(missionType.ToString(), double.NaN); - Kilogram refLoad; - if (double.IsNaN(refLoadValue)) { - refLoad = DeclarationData.GetPayloadForGrossVehicleWeight(grossVehicleWeight, missionType) + - trailers.Sum(t => DeclarationData.GetPayloadForTrailerWeight(t.TrailerGrossVehicleWeight, t.TrailerCurbWeight)) - .DefaultIfNull(0); + var payloads = row.Field<string>(missionType.ToString()).Split('/'); + Kilogram refLoad = null, lowLoad = 0.SI<Kilogram>(); + if (payloads.Length == 2) { + lowLoad = GetLoading(payloads[0], grossVehicleWeight, missionType, trailers, true); + refLoad = GetLoading(payloads[1], grossVehicleWeight, missionType, trailers, false); } else { - refLoad = refLoadValue.SI<Kilogram>(); + refLoad = GetLoading(row.Field<string>(missionType.ToString()), grossVehicleWeight, missionType, trailers, false); } - refLoad = VectoMath.Min(refLoad, maxLoad); + refLoad = refLoad.LimitTo(0.SI<Kilogram>(), maxLoad); + lowLoad = lowLoad.LimitTo(0.SI<Kilogram>(), maxLoad); var mission = new Mission { MissionType = missionType, @@ -221,6 +221,7 @@ namespace TUGraz.VectoCore.Models.Declaration MinLoad = 0.SI<Kilogram>(), MaxLoad = maxLoad, RefLoad = refLoad, + LowLoad = lowLoad, TotalCargoVolume = body.CargoVolume + trailers.Sum(t => t.CargoVolume).DefaultIfNull(0), }; missions.Add(mission); @@ -228,6 +229,18 @@ namespace TUGraz.VectoCore.Models.Declaration return missions.ToArray(); } + private static Kilogram GetLoading(string payloadStr, Kilogram grossVehicleWeight, MissionType missionType, IEnumerable<MissionTrailer> trailers, bool lowLoading) + { + var refLoadValue = payloadStr.ToDouble(double.NaN); + if (double.IsNaN(refLoadValue)) { + return DeclarationData.GetPayloadForGrossVehicleWeight(grossVehicleWeight, payloadStr) + + trailers.Sum( + t => DeclarationData.GetPayloadForTrailerWeight(t.TrailerGrossVehicleWeight, t.TrailerCurbWeight, lowLoading)) + .DefaultIfNull(0); + } + return refLoadValue.SI<Kilogram>(); + } + /// <summary> /// Checks if a trailer should be used for the current missionType. /// </summary> diff --git a/VectoCore/VectoCore/Resources/Declaration/Payloads.csv b/VectoCore/VectoCore/Resources/Declaration/Payloads.csv index fe7c5c6c52..711ef50d78 100644 --- a/VectoCore/VectoCore/Resources/Declaration/Payloads.csv +++ b/VectoCore/VectoCore/Resources/Declaration/Payloads.csv @@ -1,3 +1,3 @@ -Gross Vehicle Weight,Payload 50%,Payload 75% -7500,1250,1900 -16000,4600,6900 +Gross Vehicle Weight,Payload 10%,Payload 50%,Payload 75% +7500,250,1250,1900 +16000,920,4600,6900 diff --git a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv index 33237c7de1..7705976756 100644 --- a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv +++ b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv @@ -1,29 +1,29 @@ -Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Height,DesignSpeed,Body,Trailer,EMS ,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - EMS,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Truck Axles - Long haul EMS,Truck Axles - Other EMS,Trailer Axles - Long haul EMS,Trailer Axles - Other EMS,Long haul ,Long haul EMS ,Regional delivery ,Regional delivery EMS,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach,CdxA_Construction -## 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- , ,pc10(R)/pc(R) , ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , , -1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,3.6 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,3.6 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,3.75 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,10 ,12 ,2 ,3.75 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,3.9 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,12 ,16 ,3 ,3.9 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc10(R)/pc(R) ,- ,pc10(R)/pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,4.0 ,85 ,B4 ,T2 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,20/30 ,45/55 ,50 , , , , , ,1900/14000 ,- ,900/4400 ,- ,- ,600/3000 ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,16 ,99 ,5 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,20/25 ,25/25 ,55 ,50 ,15/20 ,17.5/25 ,40/25 ,35/22.5 ,2600/19300 ,3500/26500 ,260012900 ,3500/17500 ,- ,- ,- ,- ,- ,- ,- ,- , -0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 ,3.75 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- , -0 ,RigidTruck ,4x4 ,16 ,99 ,7 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,Tractor ,4x4 ,16 ,99 ,8 ,4.0 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,4.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,2600/19300 ,3500/26500 ,1400/7100 ,3500/17500 ,- ,1200/6000 ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,6x2 ,0 ,99 ,10 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,2600/19300 ,3500/26500 ,2600/12900 ,3500/17500 ,- ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,6x4 ,0 ,99 ,11 ,4.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/22.5/22.5 ,35/35/30 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,2600/19300 ,3500/26500 ,1400/7100 ,3500/17500 ,- ,1200/6000 ,1400/7100 ,- ,- ,- ,- ,- ,8.5 -1 ,Tractor ,6x4 ,0 ,99 ,12 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/15/15 ,20/15/15 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,2600/19300 ,3500/26500 ,2600/12900 ,3500/17500 ,- ,- ,2600/12900 ,- ,- ,- ,- ,- ,8.8 -0 ,RigidTruck ,6x6 ,0 ,99 ,13 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,Tractor ,6x6 ,0 ,99 ,14 ,3.6 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,RigidTruck ,8x2 ,0 ,99 ,15 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,8x4 ,0 ,99 ,16 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , ,25/25/25/25 , , , , , , ,- ,- ,- ,- ,- ,- ,2600/12900 ,- ,- ,- ,- ,- , -0 ,RigidTruck ,8x6 ,0 ,99 ,17 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- ,9.0 -0 ,RigidTruck ,8x8 ,0 ,99 ,17 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,CityBus ,4x2 ,0 ,18 ,B1 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , -0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , -0 ,Coach ,4x2 ,0 ,18 ,B3 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , -0 ,CityBus ,6x2 ,18 ,99 ,B4 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , -0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , -0 ,Coach ,6x2 ,18 ,99 ,B6 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , \ No newline at end of file +Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Height,DesignSpeed,Body,Trailer,EMS ,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - EMS,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Truck Axles - Long haul EMS,Truck Axles - Other EMS,Trailer Axles - Long haul EMS,Trailer Axles - Other EMS,Long haul ,Long haul EMS ,Regional delivery ,Regional delivery EMS,Urban delivery ,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach,CdxA_Construction +## 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- , ,pc10(R)/pc50(R) , ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , , +1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,3.6 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,3.6 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,3.75 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc10(R)/pc75(R) ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,10 ,12 ,2 ,3.75 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc10(R)/pc75(R) ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,3.9 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,12 ,16 ,3 ,3.9 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc10(R)/pc50(R) ,- ,pc10(R)/pc50(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,4.0 ,85 ,B4 ,T2 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,20/30 ,45/55 ,50 , , , , , ,1900/14000 ,- ,900/4400 ,- ,- ,600/3000 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,16 ,99 ,5 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,20/25 ,25/25 ,55 ,50 ,15/20 ,17.5/25 ,40/25 ,35/22.5 ,2600/19300 ,3500/26500 ,2600/12900 ,3500/17500 ,- ,- ,- ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 ,3.75 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,16 ,99 ,7 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,4x4 ,16 ,99 ,8 ,4.0 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,4.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,2600/19300 ,3500/26500 ,1400/7100 ,3500/17500 ,- ,1200/6000 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,6x2 ,0 ,99 ,10 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,2600/19300 ,3500/26500 ,2600/12900 ,3500/17500 ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x4 ,0 ,99 ,11 ,4.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/22.5/22.5 ,35/35/30 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,2600/19300 ,3500/26500 ,1400/7100 ,3500/17500 ,- ,1200/6000 ,1400/7100 ,- ,- ,- ,- ,- ,8.5 +1 ,Tractor ,6x4 ,0 ,99 ,12 ,4.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/15/15 ,20/15/15 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,2600/19300 ,3500/26500 ,2600/12900 ,3500/17500 ,- ,- ,2600/12900 ,- ,- ,- ,- ,- ,8.8 +0 ,RigidTruck ,6x6 ,0 ,99 ,13 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,6x6 ,0 ,99 ,14 ,3.6 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x2 ,0 ,99 ,15 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,8x4 ,0 ,99 ,16 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , ,25/25/25/25 , , , , , , ,- ,- ,- ,- ,- ,- ,2600/12900 ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x6 ,0 ,99 ,17 ,3.6 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- ,9.0 +0 ,RigidTruck ,8x8 ,0 ,99 ,17 ,4.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,CityBus ,4x2 ,0 ,18 ,B1 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,4x2 ,0 ,18 ,B3 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , +0 ,CityBus ,6x2 ,18 ,99 ,B4 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,6x2 ,18 ,99 ,B6 ,4.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Integration/FullCycleDeclarationTest.cs b/VectoCore/VectoCoreTest/Integration/FullCycleDeclarationTest.cs index dff3dbc69b..c6d9c328b6 100644 --- a/VectoCore/VectoCoreTest/Integration/FullCycleDeclarationTest.cs +++ b/VectoCore/VectoCoreTest/Integration/FullCycleDeclarationTest.cs @@ -208,7 +208,7 @@ namespace TUGraz.VectoCore.Tests.Integration var jobContainer = new JobContainer(sumData); jobContainer.AddRuns(factory); - var i = 8; + var i = 5; jobContainer.Runs[i].Run.Run(); Assert.IsTrue(jobContainer.Runs[i].Run.FinishedWithoutErrors, string.Format("{0}", jobContainer.Runs[i].ExecException)); diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index a0914613b2..7025dc8702 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -467,11 +467,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X2(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x2, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x2, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -484,11 +484,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X4(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x4, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x4, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -709,21 +709,24 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 9813.2353, trailerGrossVehicleWeight: new[] { 10500.0 }, + 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, trailerCurbWeight: new double[] { }, - trailerType: new TrailerType[] { }, minLoad: 0, refLoad: 2984.1176, trailerGrossVehicleWeight: new double[] { }, + 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, trailerCurbWeight: new double[] { }, - trailerType: new TrailerType[] { }, minLoad: 0, refLoad: 2984.1176, trailerGrossVehicleWeight: new double[] { }, + trailerType: new TrailerType[] { }, lowLoad: 596.8235, refLoad: 2984.1176, + trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 4150); } @@ -750,13 +753,13 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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[] { }, minLoad: 0, refLoad: 3811.7647, + 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[] { }, minLoad: 0, refLoad: 3811.7647, + trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 762.3529, refLoad: 3811.7647, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 6150); } @@ -786,19 +789,19 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 14000, + 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[] { }, minLoad: 0, refLoad: 4400, + 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[] { }, minLoad: 0, refLoad: 4400, + trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 600, refLoad: 3000, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 8400); } @@ -828,25 +831,25 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 19300, + 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 }, minLoad: 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 }, minLoad: 0, refLoad: 12900, + 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 }, minLoad: 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); } @@ -876,32 +879,32 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 19300, + 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 }, minLoad: 0, + 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[] { }, minLoad: 0, + 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 }, minLoad: 0, + 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[] { }, minLoad: 0, - refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); + trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1200, + refLoad: 6000, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); } /// <summary> @@ -930,25 +933,25 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 19300, + 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 }, minLoad: 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 }, minLoad: 0, refLoad: 12900, + 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 }, minLoad: 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); } @@ -978,37 +981,37 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 19300, + 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 }, minLoad: 0, + 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[] { }, minLoad: 0, + 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 }, minLoad: 0, + 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[] { }, minLoad: 0, - refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); + 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[] { }, minLoad: 0, + trailerCurbWeight: new double[] { }, trailerType: new TrailerType[] { }, lowLoad: 1400, refLoad: 7100, trailerGrossVehicleWeight: new double[] { }, deltaCdA: 0, maxLoad: 14300); } @@ -1038,26 +1041,32 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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 }, minLoad: 0, refLoad: 19300, + 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 }, minLoad: 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 }, minLoad: 0, refLoad: 12900, + 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 }, minLoad: 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); } /// <summary> @@ -1086,14 +1095,14 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration 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[] { }, minLoad: 0, refLoad: 12900, + 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 minLoad, double refLoad, double maxLoad, + double[] trailerCurbWeight, TrailerType[] trailerType, double lowLoad, double refLoad, double maxLoad, double[] trailerGrossVehicleWeight, double deltaCdA, bool ems = false) { Assert.AreEqual(missionType, m.MissionType); @@ -1110,7 +1119,8 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration CollectionAssert.AreEqual(trailerAxleCount, m.Trailer.Select(t => t.TrailerWheels.Count)); Assert.IsNotNull(m.CycleFile); Assert.IsTrue(!string.IsNullOrEmpty(new StreamReader(m.CycleFile).ReadLine())); - Assert.AreEqual(minLoad.SI<Kilogram>(), m.MinLoad); + Assert.AreEqual(0.SI<Kilogram>(), m.MinLoad); + AssertHelper.AreRelativeEqual(lowLoad, m.LowLoad); AssertHelper.AreRelativeEqual(refLoad, m.RefLoad); Assert.AreEqual(maxLoad.SI<Kilogram>(), m.MaxLoad); CollectionAssert.AreEqual(trailerGrossVehicleWeight, m.Trailer.Select(t => t.TrailerGrossVehicleWeight.Value())); @@ -1163,19 +1173,19 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration var dataReader = new DeclarationModeVectoRunDataFactory(dataProvider, null); var runs = dataReader.NextRun().ToList(); - Assert.AreEqual(9, runs.Count); + Assert.AreEqual(6, runs.Count); var withT1 = new[] { 6.0, 6.0, 4.5, 4.5 }; + CollectionAssert.AreEqual(withT1, runs[0].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(withT1, runs[1].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withT1, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); var bodyOnly = new[] { 6.0, 6.0 }; + + CollectionAssert.AreEqual(bodyOnly, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(bodyOnly, runs[3].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(bodyOnly, runs[4].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(bodyOnly, runs[5].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[6].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[7].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[8].VehicleData.AxleData.Select(a => a.Inertia.Value())); } [TestCase] @@ -1187,19 +1197,17 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration var dataReader = new DeclarationModeVectoRunDataFactory(dataProvider, null); var runs = dataReader.NextRun().ToList(); - Assert.AreEqual(9, runs.Count); + Assert.AreEqual(6, runs.Count); var withT1 = new[] { 14.9, 14.9, 19.2, 19.2 }; CollectionAssert.AreEqual(withT1, runs[0].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(withT1, runs[1].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withT1, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); var bodyOnly = new[] { 14.9, 14.9 }; + CollectionAssert.AreEqual(bodyOnly, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(bodyOnly, runs[3].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(bodyOnly, runs[4].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(bodyOnly, runs[5].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[6].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[7].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(bodyOnly, runs[8].VehicleData.AxleData.Select(a => a.Inertia.Value())); } [TestCase] @@ -1212,7 +1220,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration var runs = dataReader.NextRun().ToList(); Assert.AreEqual(VehicleClass.Class5, runs[0].VehicleData.VehicleClass); - Assert.AreEqual(12, runs.Count); + Assert.AreEqual(8, runs.Count); //var bodyOnly = new[] { 14.9, 14.9 }; var withST1 = new[] { 14.9, 14.9, 19.2, 19.2, 19.2 }; @@ -1220,19 +1228,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration CollectionAssert.AreEqual(withST1, runs[0].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(withST1, runs[1].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(withST1andT2, runs[2].VehicleData.AxleData.Select(a => a.Inertia.Value())); CollectionAssert.AreEqual(withST1andT2, runs[3].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1andT2, runs[4].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1andT2, runs[5].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1, runs[6].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1, runs[7].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1, runs[8].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(withST1, runs[4].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(withST1, runs[5].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1andT2, runs[9].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1andT2, runs[10].VehicleData.AxleData.Select(a => a.Inertia.Value())); - CollectionAssert.AreEqual(withST1andT2, runs[11].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(withST1andT2, runs[6].VehicleData.AxleData.Select(a => a.Inertia.Value())); + CollectionAssert.AreEqual(withST1andT2, runs[7].VehicleData.AxleData.Select(a => a.Inertia.Value())); } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs index dbe5451fe9..6cff5ae60a 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs @@ -310,7 +310,7 @@ namespace TUGraz.VectoCore.Tests.XML jobContainer.AddRuns(runsFactory); - Assert.AreEqual(12, jobContainer.Runs.Count); + Assert.AreEqual(8, jobContainer.Runs.Count); } [TestMethod] -- GitLab