diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/AStarAlgorithm.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/AStarAlgorithm.java index 6e6083c..06d49bb 100644 --- a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/AStarAlgorithm.java +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/AStarAlgorithm.java @@ -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 diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java index 1073543..71fa59b 100644 --- a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java @@ -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)