Dijkstra et A* corrigé
This commit is contained in:
parent
23199c947f
commit
c38b7448c7
2 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ public class AStarAlgorithm extends DijkstraAlgorithm {
|
|||
|
||||
OldDist = labels[arc.getDestination().getId()].computedCost;
|
||||
EstimatedCost = labels[arc.getDestination().getId()].destCost;
|
||||
NewDist = labels[IdxNewOrigin].computedCost + arc.getLength(); // calcul de la nouvelle distance
|
||||
NewDist = labels[IdxNewOrigin].computedCost + data.getCost(arc); // calcul de la nouvelle distance/temps
|
||||
|
||||
|
||||
// to observe the path search
|
||||
|
|
|
@ -71,7 +71,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
|
||||
if (!labels[arc.getDestination().getId()].mark){ // verif du marquage
|
||||
|
||||
NewDist = labels[IdxNewOrigin].computedCost + arc.getLength(); // calcul de la nouvelle distance
|
||||
NewDist = labels[IdxNewOrigin].computedCost + data.getCost(arc); // calcul de la nouvelle distance
|
||||
OldDist = labels[arc.getDestination().getId()].computedCost; // lecture de l'ancienne
|
||||
|
||||
if (Double.isInfinite(OldDist)
|
||||
|
|
Loading…
Reference in a new issue