cleanup
This commit is contained in:
parent
7856f1c66c
commit
5b8a1d1e10
@ -68,8 +68,7 @@ public class Pathfinder
|
|||||||
OsmNode? neighbor = regionManager.GetNode(edge.neighborId, edge.neighborRegion);
|
OsmNode? neighbor = regionManager.GetNode(edge.neighborId, edge.neighborRegion);
|
||||||
if (neighbor is not null)
|
if (neighbor is not null)
|
||||||
{
|
{
|
||||||
double tentativeGScore =
|
double tentativeGScore = gScore[currentNode] + Weight(currentNode, neighbor, edge);
|
||||||
gScore[currentNode] + Weight(currentNode, neighbor, edge);
|
|
||||||
gScore.TryAdd(neighbor, double.MaxValue);
|
gScore.TryAdd(neighbor, double.MaxValue);
|
||||||
if (tentativeGScore < gScore[neighbor])
|
if (tentativeGScore < gScore[neighbor])
|
||||||
{
|
{
|
||||||
@ -108,6 +107,7 @@ public class Pathfinder
|
|||||||
|
|
||||||
private double Heuristic(OsmNode currentNode, OsmNode neighborNode, OsmNode goalNode, OsmEdge edge)
|
private double Heuristic(OsmNode currentNode, OsmNode neighborNode, OsmNode goalNode, OsmEdge edge)
|
||||||
{
|
{
|
||||||
|
if (neighborNode.Equals(goalNode)) return 0;
|
||||||
double priority = regionManager.GetPriorityForVehicle(_speedType, edge, currentNode);
|
double priority = regionManager.GetPriorityForVehicle(_speedType, edge, currentNode);
|
||||||
if (priority == 0)
|
if (priority == 0)
|
||||||
return double.MaxValue;
|
return double.MaxValue;
|
||||||
|
Reference in New Issue
Block a user