pb ouvert-ready
This commit is contained in:
parent
320b07bc7f
commit
96d19c91e8
1 changed files with 14 additions and 5 deletions
|
@ -2,7 +2,9 @@
|
|||
|
||||
import org.insa.graphs.algorithm.AbstractSolution.Status;
|
||||
import org.insa.graphs.algorithm.utils.BinaryHeap;
|
||||
import org.insa.graphs.model.Arc;
|
||||
import org.insa.graphs.model.AccessRestrictions.AccessMode;
|
||||
import org.insa.graphs.model.AccessRestrictions.AccessRestriction;
|
||||
import org.insa.graphs.model.Arc;
|
||||
import org.insa.graphs.model.Node;
|
||||
import org.insa.graphs.model.Path;
|
||||
import java.util.ArrayList;
|
||||
|
@ -31,6 +33,8 @@ import org.insa.graphs.model.Node;
|
|||
|
||||
this.nbnodes=0;
|
||||
|
||||
int mul=1;//problème ouvert
|
||||
|
||||
final ShortestPathData data = getInputData();
|
||||
ShortestPathSolution solution = new ShortestPathSolution(data,Status.UNKNOWN);//modifié
|
||||
|
||||
|
@ -75,17 +79,22 @@ import org.insa.graphs.model.Node;
|
|||
y=arcy.getDestination().getId();
|
||||
//System.out.println(tas.isValid());
|
||||
|
||||
if (!tablabel[y].marque && data.isAllowed(arcy)) {//ligne 108 de l'excel d'avancement
|
||||
if (!tablabel[y].marque && data.isAllowed(arcy)) {
|
||||
|
||||
if (tablabel[y].getCost()>tablabel[x].getCost()+(float)data.getCost(arcy)) {
|
||||
if (arcy.getRoadInformation().getAccessRestrictions().isAllowedFor(AccessMode.MOTORCAR,
|
||||
AccessRestriction.ALLOWED))
|
||||
mul=1;
|
||||
else//ce bloc sert à l'implémentation du problème ouvert
|
||||
mul=1;
|
||||
if (tablabel[y].getCost()>tablabel[x].getCost()+mul*(float)data.getCost(arcy)) {
|
||||
|
||||
if (tablabel[y].getCost()!=Float.MAX_VALUE) {
|
||||
tas.remove(tablabel[y]);
|
||||
this.notifyNodeReached(arcy.getDestination());
|
||||
}
|
||||
|
||||
tablabel[y].cout=tablabel[x].getCost()+(float)data.getCost(arcy);
|
||||
tablabel[y].pere=arcy;//ligne non dans le poly
|
||||
tablabel[y].cout=tablabel[x].getCost()+mul*(float)data.getCost(arcy);
|
||||
tablabel[y].pere=arcy;
|
||||
tas.insert(tablabel[y]);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue