getset
This commit is contained in:
parent
d751d66e7a
commit
f2c643c952
2 changed files with 5 additions and 5 deletions
|
|
@ -36,13 +36,13 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
Label x;
|
Label x;
|
||||||
while (MarqueExiste(List)){
|
while (MarqueExiste(List)){
|
||||||
x = Tas.findMin();
|
x = Tas.findMin();
|
||||||
x.marque = true;
|
x.setMarque(true);
|
||||||
Tas.deleteMin();
|
Tas.deleteMin();
|
||||||
for(Arc suivant : x.sommet.getSuccessors()){
|
for(Arc suivant : x.getSommet().getSuccessors()){
|
||||||
Node y = suivant.getDestination();
|
Node y = suivant.getDestination();
|
||||||
for (Label l : List){
|
for (Label l : List){
|
||||||
if (l.getSommet()==y){
|
if (l.getSommet()==y){
|
||||||
if(!l.marque){
|
if(!l.isMarque()){
|
||||||
double cout = l.getCost();
|
double cout = l.getCost();
|
||||||
System.out.println("c = " + cout);
|
System.out.println("c = " + cout);
|
||||||
l.setCost(Math.min(l.getCost(), x.getCost()+suivant.getLength()));
|
l.setCost(Math.min(l.getCost(), x.getCost()+suivant.getLength()));
|
||||||
|
|
@ -55,9 +55,9 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
arcs.remove(i-1);
|
arcs.remove(i-1);
|
||||||
}
|
}
|
||||||
Tas.insert(l);
|
Tas.insert(l);
|
||||||
l.parent = suivant;
|
l.setParent(suivant);
|
||||||
arcs.add(suivant);
|
arcs.add(suivant);
|
||||||
l.marque = true;
|
l.setMarque(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue