From f79eb7216c3f7ce0f13aa95e8c780f7857cce162 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 18 May 2016 10:55:51 +0200
Subject: [PATCH] perform max velocity check only when accelerating

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

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs
index 63163d0fa9..49a867157f 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs
@@ -320,7 +320,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 
 			// compute speed at the end of the simulation interval. if it exceeds the limit -> return
 			var v2 = DataBus.VehicleSpeed + limitedOperatingPoint.Acceleration * limitedOperatingPoint.SimulationInterval;
-			if (v2 > maxVelocity) {
+			if (v2 > maxVelocity && limitedOperatingPoint.Acceleration.IsGreaterOrEqual(0.SI<MeterPerSquareSecond>())) {
 				Log.Debug("vehicle's velocity would exceed given max speed. v2: {0}, max speed: {1}", v2, maxVelocity);
 				return new ResponseSpeedLimitExceeded() { Source = this };
 			}
-- 
GitLab