mise a jour labelstar

This commit is contained in:
Lea Norgeux 2023-04-19 18:22:47 +02:00
parent 71002bb285
commit d8adbb955c

View file

@ -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 */