cout du chemin
This commit is contained in:
parent
fc581c42be
commit
c20c21f527
1 changed files with 2 additions and 0 deletions
|
@ -75,9 +75,11 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
else {
|
else {
|
||||||
|
|
||||||
ArrayList<Arc> arcs = new ArrayList<>();
|
ArrayList<Arc> arcs = new ArrayList<>();
|
||||||
|
Double cout=0.0; /*cout du chemin */
|
||||||
Arc arc = label_dest.getPere();
|
Arc arc = label_dest.getPere();
|
||||||
while (arc != null) {
|
while (arc != null) {
|
||||||
arcs.add(arc);
|
arcs.add(arc);
|
||||||
|
cout+= data.getCost(arc);
|
||||||
arc = tab.get(arc.getOrigin().getId()).getPere();
|
arc = tab.get(arc.getOrigin().getId()).getPere();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue