From 9a087af3922a97a76c3f7b8eb88afc34a1713724 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Mon, 31 Dec 2018 10:22:39 +0100
Subject: [PATCH] driver strategy: slight acceleration after a too early stop
 may result in underload (due to high engine inertia) - apply brakes

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

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
index 61fd208ca1..054ad5684a 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
@@ -652,6 +652,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 				}
 
 				response = Driver.DrivingActionAccelerate(absTime, ds, 1.KMPHtoMeterPerSecond(), gradient);
+				if (response is ResponseUnderload) {
+					response = Driver.DrivingActionBrake(absTime, ds, 1.KMPHtoMeterPerSecond(), gradient, response);
+				}
 			} else {
 				response = Driver.DrivingActionBrake(
 					absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed,
-- 
GitLab