28 satır
660 B
Java
28 satır
660 B
Java
package org.insa.graphs.algorithm.shortestpath;
|
|
|
|
import org.insa.graphs.model.Node;
|
|
import org.insa.graphs.model.Point;
|
|
|
|
public class LabelStar extends Label {
|
|
|
|
private final double estimatedCost;
|
|
|
|
/**
|
|
* Initalizes a LabelStar (not yet marked, with infinite cost)
|
|
*
|
|
* @param node The node associated with the label
|
|
*/
|
|
public LabelStar(Node node, double estimatedCost) {
|
|
super(node);
|
|
this.estimatedCost = estimatedCost;
|
|
}
|
|
|
|
@Override
|
|
public double getTotalCost() {
|
|
return super.getCost() + getEstimatedCost();
|
|
}
|
|
|
|
public double getEstimatedCost() {
|
|
return estimatedCost;
|
|
}
|
|
}
|