From e7f71fd38ef08d182cc08786c55723fadd7d71b3 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Fri, 27 May 2016 09:50:25 +0200
Subject: [PATCH] remove estimation of distance to drive before switching to
 coasting. no longer possible with new coasting model

---
 .../Impl/DefaultDriverStrategy.cs             | 25 -------------------
 1 file changed, 25 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
index cde387fdb2..170b2b7417 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
@@ -460,31 +460,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 			MeterPerSecond targetVelocity, Radian gradient, IResponse response, out Meter newSimulationDistance);
 
 		public abstract void ResetMode();
-
-		protected Meter EstimateAccelerationDistanceBeforeBrake(IResponse retVal, DrivingBehaviorEntry nextAction)
-		{
-			// estimate the distance to drive when accelerating with the current acceleration (taken from retVal) and then 
-			// coasting with the dirver's LookaheadDeceleration. 
-			// TriggerDistance - CurrentDistance = s_accelerate + s_lookahead
-			// s_coast(dt) = - (currentSpeed + a * dt + nextTargetSpeed) * (nextTargetSpeed - (currentSpeed + a * dt))  / (2 * a_lookahead)
-			// s_acc(dt) = currentSpeed * dt + a / 2 * dt^2
-			// => solve for dt, compute ds = currentSpeed * dt + a / 2 * dt^2
-			var dtList = VectoMath.QuadraticEquationSolver(
-				(retVal.Acceleration / 2 -
-				retVal.Acceleration * retVal.Acceleration / 2 / Driver.DriverData.LookAheadCoasting.Deceleration).Value(),
-				(Driver.DataBus.VehicleSpeed -
-				Driver.DataBus.VehicleSpeed * retVal.Acceleration / Driver.DriverData.LookAheadCoasting.Deceleration).Value(),
-				(nextAction.NextTargetSpeed * nextAction.NextTargetSpeed / 2 / Driver.DriverData.LookAheadCoasting.Deceleration -
-				Driver.DataBus.VehicleSpeed * Driver.DataBus.VehicleSpeed / 2 / Driver.DriverData.LookAheadCoasting.Deceleration -
-				(nextAction.TriggerDistance - Driver.DataBus.Distance)).Value());
-			dtList.Sort();
-			if (!dtList.Any(x => x > 0)) {
-				return null;
-			}
-			var dt = dtList.First(x => x > 0).SI<Second>();
-			var newds = Driver.DataBus.VehicleSpeed * dt + (retVal.Acceleration / 2 * dt * dt);
-			return newds;
-		}
 	}
 
 	//=====================================
-- 
GitLab