From 2a71b37a7b761fb121de97d32714bbce40240a6e Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 29 Jun 2016 10:10:07 +0200
Subject: [PATCH] fix in driver strategy: when checking if the request exceeds
 the next action use the brake trigger, not driving action (brake trigger may
 change during braking phase!)

---
 .../Models/SimulationComponent/Impl/DefaultDriverStrategy.cs  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
index 1dbbacea8f..28332b8c11 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
@@ -439,7 +439,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 			}
 
 			var newOperatingPoint = VectoMath.ComputeTimeInterval(DataBus.VehicleSpeed, response.Acceleration, DataBus.Distance,
-				ds);
+				newds);
 			if (newOperatingPoint.SimulationInterval.IsSmaller(Constants.SimulationSettings.LowerBoundTimeInterval)) {
 				// the next time interval will be too short, this may lead to issues with inertia etc. 
 				// instead of accelerating, drive at constant speed.
@@ -751,7 +751,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 		protected override IResponse CheckRequestDoesNotExceedNextAction(Second absTime, Meter ds,
 			MeterPerSecond targetVelocity, Radian gradient, IResponse response, out Meter newds)
 		{
-			var nextAction = DriverStrategy.NextDrivingAction;
+			var nextAction = DriverStrategy.BrakeTrigger;
 			newds = ds;
 			if (nextAction == null) {
 				return response;
-- 
GitLab