Fixed infinity error JSON
This commit is contained in:
parent
5efec08bbc
commit
9c7fec1c37
@ -24,7 +24,7 @@ public class PathNode : OsmNode
|
|||||||
PathNode retNode = new PathNode(node.nodeId, node.coordinates)
|
PathNode retNode = new PathNode(node.nodeId, node.coordinates)
|
||||||
{
|
{
|
||||||
currentPathLength = node.currentPathLength,
|
currentPathLength = node.currentPathLength,
|
||||||
currentPathWeight = node.currentPathWeight,
|
currentPathWeight = double.IsPositiveInfinity(node.currentPathWeight) ? double.MaxValue : node.currentPathWeight,
|
||||||
directDistanceToGoal = node.directDistanceToGoal
|
directDistanceToGoal = node.directDistanceToGoal
|
||||||
};
|
};
|
||||||
return retNode;
|
return retNode;
|
||||||
|
@ -32,8 +32,6 @@ public static partial class Pathfinder
|
|||||||
{
|
{
|
||||||
neighbor.previousPathNode = closestNodeToGoal;
|
neighbor.previousPathNode = closestNodeToGoal;
|
||||||
neighbor.currentPathLength = newPotentialLength;
|
neighbor.currentPathLength = newPotentialLength;
|
||||||
neighbor.currentPathWeight = closestNodeToGoal.currentPathWeight +
|
|
||||||
EdgeWeight(closestNodeToGoal, edge, Tag.SpeedType.road, regionManager);
|
|
||||||
neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode);
|
neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode);
|
||||||
|
|
||||||
if (neighbor.Equals(goalNode))
|
if (neighbor.Equals(goalNode))
|
||||||
|
Reference in New Issue
Block a user