diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index a4e3d8fe2b9a577c4a35e754dd0c697d1fc4126b..5bc6399a0521c182a4380b1fc4498d2f0b45c5bf 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -558,12 +558,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // update action distance for current 'next action' UpdateDistancesForCurrentNextAction(); - SetNextDrivingAction(currentDistance, nextAction); + SetNextDrivingAction(currentDistance, nextAction, ds); } Log.Debug("Next Driving Action: {0}", NextDrivingAction); } - private void SetNextDrivingAction(Meter currentDistance, DrivingBehaviorEntry nextAction) + private void SetNextDrivingAction(Meter currentDistance, DrivingBehaviorEntry nextAction, Meter ds) { if (nextAction != null) { if (nextAction.HasEqualTrigger(NextDrivingAction)) { @@ -577,6 +577,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (nextAction.ActionDistance < NextDrivingAction.ActionDistance) { NextDrivingAction = nextAction; } + + if ((currentDistance + ds).IsEqual(NextDrivingAction.TriggerDistance) && Driver.DataBus.VehicleInfo.VehicleSpeed < NextDrivingAction.NextTargetSpeed) { + // the currently active NextDrivingAction already reached the target speed - ignore it. + NextDrivingAction = nextAction; + } } } else { NextDrivingAction = null;