From fcfbd316ed2bbbaa8af762a340401daa5dc1bae8 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Tue, 28 Aug 2018 08:28:22 +0200 Subject: [PATCH] try to search operating point once more, in case the first one was due to an engine speed too high --- .../Models/SimulationComponent/Impl/Driver.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 892a126ddb..81d4df08be 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -141,7 +141,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Radian gradient, IResponse previousResponse = null) { - DrivingAction = DrivingAction.Accelerate; + DrivingAction = DrivingAction.Accelerate; IterationStatistics.Increment(this, "Accelerate"); Log.Debug("DrivingAction Accelerate"); var operatingPoint = ComputeAcceleration(ds, targetVelocity); @@ -267,6 +267,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal.Switch(). Case<ResponseSuccess>(() => operatingPoint = nextOperatingPoint). Case<ResponseGearShift>(() => operatingPoint = nextOperatingPoint). + Case<ResponseOverload>( + r => { + nextOperatingPoint = SearchOperatingPoint(absTime, ds, gradient, operatingPoint.Acceleration, + r); + DriverAcceleration = nextOperatingPoint.Acceleration; + retVal = NextComponent.Request(absTime, nextOperatingPoint.SimulationInterval, + nextOperatingPoint.Acceleration, gradient); + }). Default( r => { throw new UnexpectedResponseException("DrivingAction Accelerate after Overload", r); -- GitLab