Compare commits
No commits in common. "45f43559ff223a12f2ca6ab7212a6bdecc0f6947" and "c91585c90d9d1f1b3ee81dfc5723224c519da726" have entirely different histories.
45f43559ff
...
c91585c90d
2 changed files with 8 additions and 6 deletions
|
|
@ -47,14 +47,16 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
for (Label l : List){
|
||||
if (l.getSommet()==y){
|
||||
if(!l.isMarque()){
|
||||
double cout = l.getCost();
|
||||
System.out.println("c = " + cout);
|
||||
Boolean changé = false;
|
||||
if (x.getCost()+data.getCost(suivant) < l.getCost()){
|
||||
changé = true;
|
||||
}
|
||||
if(changé){
|
||||
l.setCost(Math.min(l.getCost(), x.getCost()+suivant.getLength()));
|
||||
System.out.println("l = " + l.getCost());
|
||||
System.out.println("x = " + x.getCost());
|
||||
if(cout != l.getCost()){
|
||||
if (arcs.size() < i ){
|
||||
System.out.println("arc");
|
||||
}else if (l.getCost() < arcs.get(i-1).getLength()){
|
||||
}else if (cout < arcs.get(i-1).getLength()){
|
||||
arcs.remove(i-1);
|
||||
}
|
||||
Tas.insert(l);
|
||||
|
|
@ -62,7 +64,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
arcs.add(suivant);
|
||||
l.setMarque(true);
|
||||
}
|
||||
l.setCost(Math.min(l.getCost(), x.getCost()+data.getCost(suivant)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue