Class NodeComparator

java.lang.Object
fr.uga.pddl4j.planners.statespace.search.NodeComparator
All Implemented Interfaces:
Serializable, Comparator<Node>

public class NodeComparator extends Object implements Comparator<Node>, Serializable
This class implements a comparator between nodes.
See Also:
Serialized Form
  • 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

      public int compare(Node n1, Node n2)
      Compare two nodes' weight.
      Specified by:
      compare in interface Comparator<Node>
      Parameters:
      n1 - node number 1.
      n2 - node number 2.