From 9b889964399fc1fce9549d2879ee5b4ea5981aeb Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 24 Apr 2023 19:39:19 +0200 Subject: [PATCH] added extratime variable --- Pathfinding/Pathfinder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pathfinding/Pathfinder.cs b/Pathfinding/Pathfinder.cs index 77bc1dc..c649cc0 100644 --- a/Pathfinding/Pathfinder.cs +++ b/Pathfinding/Pathfinder.cs @@ -30,8 +30,8 @@ public class Pathfinder this.roadPriorityFactor = roadPriorityFactor; this.turnAngle = turnAngle; } - - public Pathfinder AStar(Coordinates startCoordinates, Coordinates goalCoordinates, SpeedType vehicle) + + public Pathfinder AStar(Coordinates startCoordinates, Coordinates goalCoordinates, SpeedType vehicle, double extraTime) { DateTime startCalc = DateTime.Now; _speedType = vehicle; @@ -70,7 +70,7 @@ public class Pathfinder Console.WriteLine($"Removed {removed}");*/ } - if (found && DateTime.Now - startCalc > firstFound.Multiply(2)) + if (found && DateTime.Now - startCalc > firstFound.Multiply(extraTime)) stop = true; foreach (OsmEdge edge in currentNode.edges)