From 1c4bc2fb00ea12dd77bf0a4b20dfba77a52f5e45 Mon Sep 17 00:00:00 2001 From: Clement LACAU Date: Sat, 18 May 2024 17:05:39 +0200 Subject: [PATCH] TIME mode --- .../insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f8ca147..4ee1528 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 @@ -74,7 +74,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { // we know its origin and destination for (Arc arc : x.getNode().getSuccessors()) { if (successor.getNode().equals(arc.getDestination())) { - arc_cost = arc.getLength(); + arc_cost = (float) data.getCost(arc); } } final float possible_path_cost = x.getCost() + arc_cost; @@ -140,7 +140,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { this.pathCost = labels.get(data.getDestination().getId()).getTotalCost(); } - return solution; + return solution; } public float getCostPath() {