conflict fix

This commit is contained in:
Clement Lacau 2024-05-20 01:42:54 +02:00
parent 2ec3d4200f
commit add3470b71

View file

@ -73,6 +73,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
// This loop serves to get the length of the arc as // This loop serves to get the length of the arc as
// we know its origin and destination // we know its origin and destination
for (Arc arc : x.getNode().getSuccessors()) { for (Arc arc : x.getNode().getSuccessors()) {
if (successor.getNode().equals(arc.getDestination())) { if (successor.getNode().equals(arc.getDestination())) {
// data.getcost(arc) returns a cost considering the mode chosen: // data.getcost(arc) returns a cost considering the mode chosen:
// TIME or LENGTH // TIME or LENGTH
@ -82,7 +83,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
} }
final float possible_path_cost = x.getCost() + arc_cost; final float possible_path_cost = x.getCost() + arc_cost;
if (successor.getCost() >= possible_path_cost) { if (successor.getCost() > possible_path_cost) {
// Mise à jour du label // Mise à jour du label
successor.setPathCost(possible_path_cost); successor.setPathCost(possible_path_cost);
successor.setParentNode(x.getNode()); successor.setParentNode(x.getNode());