Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 38cffd2c authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

hybrid strategy: in case the selected solution has a too high engine speed and...

hybrid strategy: in case the selected solution has a too high engine speed and the engine is off - leave the engine off
parent 00a0f4d0
Branches
Tags
No related merge requests found
......@@ -476,7 +476,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
return best;
}
private static HybridStrategyResponse CreateResponse(HybridResultEntry best, uint currentGear)
private HybridStrategyResponse CreateResponse(HybridResultEntry best, uint currentGear)
{
var retVal = new HybridStrategyResponse() {
CombustionEngineOn = !best.ICEOff,
......@@ -486,6 +486,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
NextGear = best.Gear, // gs?.Item2 ?? 0,
EvaluatedSolution = best,
};
if ((best.IgnoreReason & HybridConfigurationIgnoreReason.EngineSpeedTooHigh) != 0 && !DataBus.EngineInfo.EngineOn) {
// ICE is off, selected solution has a too high engine speed - keep ICE off
retVal.CombustionEngineOn = false;
}
return retVal;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment