diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs index 10723ec1b2fabcb5acb8d896b6115642904f7867..03f7d5f96e8ca44bfa7c49d880061090aedd8c68 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs @@ -181,18 +181,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl continue; } - var gear = DataBus.GearboxInfo.Gear; - var maxSpeed = VectoMath.Min(DataBus.GearboxInfo.GetGearData(gear.Gear).MaxSpeed, - DataBus.EngineInfo.EngineN95hSpeed); - if (!dryRun && retVal is ResponseSuccess && DataBus.GearboxInfo.GearEngaged(absTime) && retVal.Gearbox.InputSpeed.IsGreater(maxSpeed)) { - Strategy.AllowEmergencyShift = true; - retryCount++; - retry = true; - Strategy.OperatingpointChangedDuringRequest(absTime, dt, outTorque, outAngularVelocity, false, retVal); - continue; - } - - if (!dryRun && strategySettings.CombustionEngineOn && retVal is ResponseEngineSpeedTooHigh && !strategySettings.ProhibitGearshift) { + var gear = DataBus.GearboxInfo.Gear; + var maxSpeed = VectoMath.Min(DataBus.GearboxInfo.GetGearData(gear.Gear).MaxSpeed, + DataBus.EngineInfo.EngineN95hSpeed); + if (!dryRun && retVal is ResponseSuccess && DataBus.GearboxInfo.GearEngaged(absTime) && retVal.Gearbox.InputSpeed.IsGreater(maxSpeed)) { + Strategy.AllowEmergencyShift = true; + retryCount++; + retry = true; + Strategy.OperatingpointChangedDuringRequest(absTime, dt, outTorque, outAngularVelocity, false, retVal); + continue; + } + + if (!dryRun && strategySettings.CombustionEngineOn && retVal is ResponseEngineSpeedTooHigh && !strategySettings.ProhibitGearshift) { retryCount++; retry = true; Strategy.AllowEmergencyShift = true; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 0683ea1db800a1f74d264993f5b5b7cebf1fe74b..3d572afbbfb4a2c27b60bbcd3928deae27e5d094 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -1452,7 +1452,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies if (best == null) { return null; } - if (!best.IgnoreReason.InvalidEngineSpeed() || best.ICEOff || + if (!best.IgnoreReason.InvalidEngineSpeed() || /*best.ICEOff ||*/ eval.Select(x => x.Gear).Distinct().Count() <= 1) { best.SimulationInterval = dt; return best;