added extratime variable

This commit is contained in:
glax 2023-04-24 19:39:19 +02:00
parent 5733b0edb3
commit 9b88996439

View File

@ -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)