Added priority queue with changable priority.

This commit is contained in:
2023-04-23 14:49:09 +02:00
parent 97a8c2ea6f
commit 5f6cccd17d
2 changed files with 38 additions and 2 deletions

View File

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