added extratime variable
This commit is contained in:
parent
5733b0edb3
commit
9b88996439
@ -30,8 +30,8 @@ public class Pathfinder
|
|||||||
this.roadPriorityFactor = roadPriorityFactor;
|
this.roadPriorityFactor = roadPriorityFactor;
|
||||||
this.turnAngle = turnAngle;
|
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;
|
DateTime startCalc = DateTime.Now;
|
||||||
_speedType = vehicle;
|
_speedType = vehicle;
|
||||||
@ -70,7 +70,7 @@ public class Pathfinder
|
|||||||
Console.WriteLine($"Removed {removed}");*/
|
Console.WriteLine($"Removed {removed}");*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found && DateTime.Now - startCalc > firstFound.Multiply(2))
|
if (found && DateTime.Now - startCalc > firstFound.Multiply(extraTime))
|
||||||
stop = true;
|
stop = true;
|
||||||
|
|
||||||
foreach (OsmEdge edge in currentNode.edges)
|
foreach (OsmEdge edge in currentNode.edges)
|
||||||
|
Reference in New Issue
Block a user