Class NodeComparator
java.lang.Object
fr.uga.pddl4j.planners.statespace.search.NodeComparator
- All Implemented Interfaces:
Serializable,Comparator<Node>
This class implements a comparator between nodes.
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionNodeComparator(double weight)Build the Node comparator object base on heuristic weight. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
NodeComparator
public NodeComparator(double weight)Build the Node comparator object base on heuristic weight.- Parameters:
weight- the heuristic weight
-
-
Method Details
-
getWeight
public double getWeight()Returns the weight of the heuristic use for the comparison.- Returns:
- the weight of the heuristic use for the comparison.
-
setWeight
public void setWeight(double weight)Sets the weight of the heuristic use for the comparison.- Parameters:
weight- the weight of the heuristic use for the comparison.
-
compare
Compare two nodes' weight.- Specified by:
comparein interfaceComparator<Node>- Parameters:
n1- node number 1.n2- node number 2.
-