fastest path
This commit is contained in:
parent
026f99c0e6
commit
b18a939270
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
for (Arc suc:x.getSommet().getSuccessors() ) {
|
||||
int index=suc.getDestination().getId();
|
||||
if (!tab.get(index).getMarque()) {
|
||||
if (data.isAllowed(suc) && tab.get(index).getCost()>x.getCost()+suc.getLength()) {
|
||||
if (data.isAllowed(suc) && tab.get(index).getCost()>x.getCost()+data.getCost(suc)) {
|
||||
/*on vérifie si présent dans le tas ou pas en utilisant remove */
|
||||
try {
|
||||
tas.remove(tab.get(index));
|
||||
|
@ -59,7 +59,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
notifyDestinationReached(tab.get(index).getSommet());
|
||||
}
|
||||
}
|
||||
tab.get(index).setCoutmin(x.getCost()+suc.getLength());
|
||||
tab.get(index).setCoutmin(x.getCost()+data.getCost(suc));
|
||||
tab.get(index).setPere(suc);
|
||||
/*insertion dans le tas */
|
||||
tas.insert(tab.get(index));
|
||||
|
|
Loading…
Reference in a new issue