ajout de commentaires

This commit is contained in:
Tiphaine Pellerin 2026-06-01 21:36:59 +02:00
parent b798f06053
commit fc6268576e
5 changed files with 4 additions and 2 deletions

View file

@ -8,7 +8,7 @@ public class AStarAlgorithm extends DijkstraAlgorithm {
super(data);
}
//@Override
// creates an 'empty' labelstar for the node given in argument
public LabelStar newLabel(Node s, ShortestPathData dataPath) {
return new LabelStar(s, false, Integer.MAX_VALUE, null,
s.getPoint().distanceTo(dataPath.getDestination().getPoint()));

View file

@ -16,6 +16,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
super(data);
}
// creates an 'empty' label for the node given in argument
public Label newLabel(Node s) {
return new Label(s, false, Double.MAX_VALUE, null);
}
@ -43,7 +44,6 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
notifyOriginProcessed(nod);
}
}
Label xl = tas.findMin();
// iterations

View file

@ -37,11 +37,13 @@ public class Label implements Comparable<Label> {
return this.cout;
}
// updates the label with the given arc and cost
public void update(Arc p, double c){
this.pere = p;
this.cout = c;
}
// compares the labels in term of cost
@Override
public int compareTo(Label l) {
if (this.getCost() < l.getCost()) {