mise a jour labelstar
This commit is contained in:
parent
71002bb285
commit
d8adbb955c
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package org.insa.graphs.algorithm.shortestpath;
|
package org.insa.graphs.algorithm.shortestpath;
|
||||||
|
|
||||||
|
|
||||||
|
import org.insa.graphs.algorithm.AbstractInputData;
|
||||||
//import org.insa.graphs.model.Arc;
|
//import org.insa.graphs.model.Arc;
|
||||||
import org.insa.graphs.model.Node;
|
import org.insa.graphs.model.Node;
|
||||||
//import org.insa.graphs.model.Point;
|
//import org.insa.graphs.model.Point;
|
||||||
|
@ -14,9 +15,13 @@ public class LabelStar extends Label{
|
||||||
|
|
||||||
/* CONSTRUCTEUR */
|
/* CONSTRUCTEUR */
|
||||||
|
|
||||||
public LabelStar(Node sommetCourant, Node Dest) {
|
public LabelStar(Node sommetCourant, Node Dest, AbstractInputData.Mode leMode) {
|
||||||
super(sommetCourant) ;
|
super(sommetCourant) ;
|
||||||
this.estimationCostDest = sommetCourant.getPoint().distanceTo(Dest.getPoint());
|
if (leMode == AbstractInputData.Mode.LENGTH) {
|
||||||
|
this.estimationCostDest = sommetCourant.getPoint().distanceTo(Dest.getPoint());
|
||||||
|
} else {
|
||||||
|
this.estimationCostDest = sommetCourant.getPoint().distanceTo(Dest.getPoint()) / Dest.getSuccessors().get(0).getMinimumTravelTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* METHODES */
|
/* METHODES */
|
||||||
|
|
Loading…
Reference in a new issue