Added priority queue with changable priority.
This commit is contained in:
@ -49,7 +49,7 @@ public class Pathfinder
|
||||
return this;
|
||||
}
|
||||
|
||||
PriorityQueue<OsmNode, double> openSetfScore = new();
|
||||
RPriorityQueue<OsmNode, double> openSetfScore = new();
|
||||
openSetfScore.Enqueue(startNode, 0);
|
||||
gScore = new() { { startNode, 0 } };
|
||||
_cameFromDict = new();
|
||||
@ -78,7 +78,7 @@ public class Pathfinder
|
||||
_cameFromDict[neighbor] = currentNode;
|
||||
gScore[neighbor] = tentativeGScore;
|
||||
double h = Heuristic(currentNode, neighbor, goalNode, edge);
|
||||
openSetfScore.Enqueue(neighbor, tentativeGScore + h); //Currently set includes a lot of duplicates
|
||||
openSetfScore.Enqueue(neighbor, tentativeGScore + h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user