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
ConstructorDescriptionNodeComparator(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, wait
Methods 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:
compare
in interfaceComparator<Node>
- Parameters:
n1
- node number 1.n2
- node number 2.
-