From bfeb555b7148c7b20186a85c6e4528ffdfd20ea5 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 16 Nov 2016 14:17:57 +0100
Subject: [PATCH] gearbox: allow shortening the traction interruption interval
 by a small amount if the next time interval would become too small (e.g. due
 to inaccurate estimation of the remaining distance from the remaining time
 interval)

---
 VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
index 47a5f50001..ff961c1bf5 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
@@ -223,7 +223,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 			var shiftTimeExceeded = absTime.IsSmaller(_engageTime) &&
 									_engageTime.IsSmaller(absTime + dt, Constants.SimulationSettings.LowerBoundTimeInterval);
 			// allow 5% tolerance of shift time
-			if (shiftTimeExceeded) {
+			if (shiftTimeExceeded && (_engageTime - absTime) > Constants.SimulationSettings.LowerBoundTimeInterval/2) {
 				return new ResponseFailTimeInterval {
 					Source = this,
 					DeltaT = _engageTime - absTime,
-- 
GitLab