diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 70ee78fb3084d40e47f383a492c92190968c68c1..2f2a94e8fa17afba911e3dc26322831bb661a5f0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -235,6 +235,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // search again for operating point, transmission may have shifted inbetween nextOperatingPoint = SearchOperatingPoint(absTime, ds, gradient, operatingPoint.Acceleration, response); + if (nextOperatingPoint == null) { + throw new VectoException("DrivingActionAccelerate: Failed to find operating point after Overload"); + } DriverAcceleration = nextOperatingPoint.Acceleration; retVal = NextComponent.Request(absTime, nextOperatingPoint.SimulationInterval, nextOperatingPoint.Acceleration, gradient); @@ -564,7 +567,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient); var gearChanged = !(DataBus.Gear == gear && DataBus.TCLocked == tcLocked); - if (DataBus.GearboxType.AutomaticTransmission() && gearChanged && retVal is ResponseOverload) { + if (DataBus.GearboxType.AutomaticTransmission() && gearChanged && (retVal is ResponseOverload || retVal is ResponseUnderload)) { Log.Debug("Gear changed after a valid operating point was found - braking is no longer applicable due to overload"); return null; }