diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 1f97bce7dae8ff58bdd6a5dda2e092d62c73f8b9..35b0f90a070923547442bae487609e119803d0f2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -229,7 +229,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies } if ((DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate || DataBus.DriverInfo.DrivingAction == DrivingAction.Brake) && allUnderload) { if (ElectricMotorCanPropellDuringTractionInterruption || DataBus.GearboxInfo.GearEngaged(absTime)) { - best = eval.MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>())); + var filtered = eval.Where(x => !x.IgnoreReason.InvalidEngineSpeed()).OrderBy(x => currentGear - x.Gear).ToArray(); + if (!filtered.Any()) { + filtered = eval.OrderBy(x => currentGear - x.Gear).ToArray(); + } + best = filtered.MaxBy( + x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>())); } } if (DataBus.DriverInfo.DrivingAction == DrivingAction.Brake && dryRun) {