amélioration de l'algo en lien avec le problème ouvert
This commit is contained in:
parent
8de2ae972b
commit
42cc651834
2 changed files with 5 additions and 5 deletions
|
|
@ -47,8 +47,8 @@ public class Marathon extends ShortestPathAlgorithm {
|
||||||
Node dest = dataInput.getOrigin().getSuccessors().get(0).getDestination() ;
|
Node dest = dataInput.getOrigin().getSuccessors().get(0).getDestination() ;
|
||||||
|
|
||||||
Label xl = tas.findMin();
|
Label xl = tas.findMin();
|
||||||
boolean possible = True ;
|
boolean possible = true ;
|
||||||
boolean fini = False ;
|
boolean fini = false ;
|
||||||
|
|
||||||
// iterations
|
// iterations
|
||||||
while (!tas.isEmpty() && fini && possible) {
|
while (!tas.isEmpty() && fini && possible) {
|
||||||
|
|
@ -56,7 +56,7 @@ public class Marathon extends ShortestPathAlgorithm {
|
||||||
Node x = xl.getSommetCourant();
|
Node x = xl.getSommetCourant();
|
||||||
notifyNodeMarked(x);
|
notifyNodeMarked(x);
|
||||||
xl.marque = true;
|
xl.marque = true;
|
||||||
possible = False ;
|
possible = false ;
|
||||||
for (Arc a : x.getSuccessors()) {
|
for (Arc a : x.getSuccessors()) {
|
||||||
if (dataInput.isAllowed(a)) {
|
if (dataInput.isAllowed(a)) {
|
||||||
Node n = a.getDestination();
|
Node n = a.getDestination();
|
||||||
|
|
@ -64,8 +64,8 @@ public class Marathon extends ShortestPathAlgorithm {
|
||||||
listLabel[n.getId()] = newLabelMarathon(n);
|
listLabel[n.getId()] = newLabelMarathon(n);
|
||||||
}
|
}
|
||||||
if (!listLabel[n.getId()].getMarque()) {
|
if (!listLabel[n.getId()].getMarque()) {
|
||||||
possible = True ;
|
possible = true ;
|
||||||
listLabel[n.getId()].update(x,x.getCost());
|
listLabel[n.getId()].update(a, listLabel[x.getId()].getCost() + dataInput.getCost(a));
|
||||||
|
|
||||||
if ((!n.equals(dest)) && (listLabel[n.getId()].getCost()) < 43){
|
if ((!n.equals(dest)) && (listLabel[n.getId()].getCost()) < 43){
|
||||||
tas.insert(listLabel[n.getId()]) ;
|
tas.insert(listLabel[n.getId()]) ;
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue