Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

bugfix in hybrid strategy: min ice on time - wrong comparison

parent f97ed56f
No related branches found
No related tags found
No related merge requests found
......@@ -14,5 +14,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data {
public Second AuxReserveTime { get; set; }
public Second AuxReserveChargeTime { get; set; }
public Second MinICEOnTime { get; set; }
}
}
\ No newline at end of file
......@@ -24,7 +24,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
public class HybridStrategy : LoggingObject, IHybridControlStrategy
{
public static readonly Second MIN_ICE_ON_TIME = 3.SI<Second>();
public class StrategyState
{
......@@ -91,7 +90,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
IceIdlingCosts = ModelData.EngineData.Fuels.Sum(
x => (x.ConsumptionMap.GetFuelConsumptionValue(0.SI<NewtonMeter>(), ModelData.EngineData.IdleSpeed)
* x.FuelData.LowerHeatingValueVecto * MIN_ICE_ON_TIME).Value());
* x.FuelData.LowerHeatingValueVecto * StrategyParameters.MinICEOnTime).Value());
// create testcontainer
var modData = new ModalDataContainer(runData, null, new[] { FuelData.Diesel }, null, false);
......@@ -206,7 +205,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
protected virtual bool AllowICEOff(Second absTime)
{
return PreviousState.ICEStartTStmp == null ||
PreviousState.ICEStartTStmp.IsSmaller(absTime + MIN_ICE_ON_TIME);
(PreviousState.ICEStartTStmp + StrategyParameters.MinICEOnTime).IsSmaller(absTime);
}
protected virtual void HandleBrakeAction(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, bool dryRun, List<HybridResultEntry> eval)
......
......@@ -696,7 +696,8 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid
MaxSoC = 0.8,
TargetSoC = 0.5,
AuxReserveTime = 5.SI<Second>(),
AuxReserveChargeTime = 2.SI<Second>()
AuxReserveChargeTime = 2.SI<Second>(),
MinICEOnTime = 3.SI<Second>()
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment