diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 475f4f0dc27889418d074283637ac355dbe39898..8ca89e3e592ef79ba810a497f9e7a490393624a3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -562,10 +562,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }, evaluateFunction: acc => { - var tmp = ComputeTimeInterval(acc, ds); - retVal.SimulationInterval = tmp.SimulationInterval; - retVal.SimulationDistance = tmp.SimulationDistance; - return NextComponent.Request(absTime, tmp.SimulationInterval, acc, gradient, true); + // calculate new time interval only when vehiclespeed and acceleration are != 0 + // else: use same timeinterval as before. + if (!(acc.IsEqual(0) && DataBus.VehicleSpeed.IsEqual(0))) { + var tmp = ComputeTimeInterval(acc, ds); + retVal.Acceleration = tmp.Acceleration; + retVal.SimulationInterval = tmp.SimulationInterval; + retVal.SimulationDistance = tmp.SimulationDistance; + } + return NextComponent.Request(absTime, retVal.SimulationInterval, acc, gradient, true); }, criterion: response => { if (response is ResponseEngineSpeedTooLow) {