pb ouvert-ready
This commit is contained in:
父節點
320b07bc7f
當前提交
96d19c91e8
共有 1 個文件被更改,包括 14 次插入 和 5 次删除
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
import org.insa.graphs.algorithm.AbstractSolution.Status;
|
import org.insa.graphs.algorithm.AbstractSolution.Status;
|
||||||
import org.insa.graphs.algorithm.utils.BinaryHeap;
|
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.Node;
|
||||||
import org.insa.graphs.model.Path;
|
import org.insa.graphs.model.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -31,6 +33,8 @@ import org.insa.graphs.model.Node;
|
||||||
|
|
||||||
this.nbnodes=0;
|
this.nbnodes=0;
|
||||||
|
|
||||||
|
int mul=1;//problème ouvert
|
||||||
|
|
||||||
final ShortestPathData data = getInputData();
|
final ShortestPathData data = getInputData();
|
||||||
ShortestPathSolution solution = new ShortestPathSolution(data,Status.UNKNOWN);//modifié
|
ShortestPathSolution solution = new ShortestPathSolution(data,Status.UNKNOWN);//modifié
|
||||||
|
|
||||||
|
@ -75,17 +79,22 @@ import org.insa.graphs.model.Node;
|
||||||
y=arcy.getDestination().getId();
|
y=arcy.getDestination().getId();
|
||||||
//System.out.println(tas.isValid());
|
//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) {
|
if (tablabel[y].getCost()!=Float.MAX_VALUE) {
|
||||||
tas.remove(tablabel[y]);
|
tas.remove(tablabel[y]);
|
||||||
this.notifyNodeReached(arcy.getDestination());
|
this.notifyNodeReached(arcy.getDestination());
|
||||||
}
|
}
|
||||||
|
|
||||||
tablabel[y].cout=tablabel[x].getCost()+(float)data.getCost(arcy);
|
tablabel[y].cout=tablabel[x].getCost()+mul*(float)data.getCost(arcy);
|
||||||
tablabel[y].pere=arcy;//ligne non dans le poly
|
tablabel[y].pere=arcy;
|
||||||
tas.insert(tablabel[y]);
|
tas.insert(tablabel[y]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
載入中…
Reference in a new issue