diff --git a/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 3f290bed9338f8543d677af5b65ee847ec8b4cdc..4c337a6f825e60ee7fa4f291e24481e763e3365f 100644 --- a/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -343,6 +343,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { IResponse response = null; + DriverStrategy.DriverBehavior = DrivingBehavior.Driving; var velocity = targetVelocity; if (DriverStrategy.OverspeedAllowed(gradient, targetVelocity)) { velocity += DriverData.OverSpeedEcoRoll.OverSpeed; diff --git a/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 8f49ccf2d7483f9c1d72568ef6f79cbc1bad8883..3a94c883545d0f4644910da687f73f8f027c632a 100644 --- a/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -635,10 +635,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Default(r => { throw new UnexpectedResponseException("Unknown response type.", r); }); } var delta = origDelta; - + var auxPower = initialResponse.AuxiliariesPowerDemand; var retryCount = 0; do { - debug.Add(new { delta, acceleration = retVal.Acceleration, searchInterval }); + debug.Add(new { delta, acceleration = retVal.Acceleration, searchInterval, auxPower }); // check if a correct searchInterval was found (when the delta changed signs, we stepped through the 0-point) // from then on the searchInterval can be bisected. @@ -663,7 +663,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var response = (ResponseDryRun)NextComponent.Request(absTime, retVal.SimulationInterval, retVal.Acceleration, gradient, true); delta = actionRoll ? response.GearboxPowerRequest : (coasting ? response.DeltaDragLoad : response.DeltaFullLoad); - + auxPower = response.AuxiliariesPowerDemand; if (response is ResponseEngineSpeedTooLow) { LogManager.EnableLogging(); Log.Debug("Got EngineSpeedTooLow during SearchOperatingPoint. Aborting!"); diff --git a/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs b/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs index c0f26753151d426ae6ac42f63488bb18cc48276b..c90dbd7a2fc619fd549d50df538ac685599364f7 100644 --- a/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs +++ b/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs @@ -31,7 +31,10 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using NLog; +using TUGraz.VectoCore.Models.Simulation.Impl; +using TUGraz.VectoCore.Models.SimulationComponent.Impl; using TUGraz.VectoCore.Tests.Utils; +using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries { @@ -1104,5 +1107,24 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries //} //#endregion + + + [TestMethod, TestCategory("CycleTest")] + public void Coach_AAUX_Accelerate_0_40_downhill_1_overspeed() + { + var cycle = SimpleDrivingCycles.ReadDeclarationCycle("Coach"); + var run = CoachAdvancedAuxPowertrain.CreateEngineeringRun(cycle, + "Coach_AAUX_CoachCycle.vmod", true); + + //((DistanceBasedDrivingCycle)((VehicleContainer)run.GetContainer()).Cycle).SetDriveOffDistance(123613.SI<Meter>()); + + run.Run(); + Assert.IsTrue(run.FinishedWithoutErrors); + + //GraphWriter.Write("Coach_AAUX_Accelerate_0_40_downhill_1-overspeed.vmod", + // @"..\..\TestData\Integration\BusAuxiliaries\Vecto2.0_Overspeed\24t Coach_AAUX_Cycle_Accelerate_0_40_downhill_1.vmod"); + } + + //@"E:\QUAM\Workspace\VECTO_quam\Generic Vehicles\Engineering Mode\24t Coach\24t Coach_AAux.vecto" } } \ No newline at end of file