Package libai.search

Class State

  • All Implemented Interfaces:
    java.lang.Comparable<State>

    public abstract class State
    extends java.lang.Object
    implements java.lang.Comparable<State>
    • Constructor Summary

      Constructors 
      Constructor Description
      State()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract int compareTo​(State o)
      Compare two states
      abstract boolean equals​(java.lang.Object o)
      Determines if two states are equals or equivalents
      abstract java.util.ArrayList<State> getCandidates()
      Returns a list with all the possible candidates from this state
      abstract double getCost()
      Get the cost of the current state
      abstract double getHeuristicCost()
      Get the heuristic cost of the current state
      abstract int hashCode()
      Hash code of the state MUST BE implemented to keep track of the visited states
      abstract boolean isSolution()
      Determines if the current state is a solution or not
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • State

        public State()
    • Method Detail

      • getCost

        public abstract double getCost()
        Get the cost of the current state
        Returns:
        cost of the current state
      • getHeuristicCost

        public abstract double getHeuristicCost()
        Get the heuristic cost of the current state
        Returns:
        heuristic cost of the current state
      • getCandidates

        public abstract java.util.ArrayList<State> getCandidates()
        Returns a list with all the possible candidates from this state
        Returns:
        list with all the possible candidates from this state
      • compareTo

        public abstract int compareTo​(State o)
        Compare two states
        Specified by:
        compareTo in interface java.lang.Comparable<State>
      • hashCode

        public abstract int hashCode()
        Hash code of the state MUST BE implemented to keep track of the visited states
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public abstract boolean equals​(java.lang.Object o)
        Determines if two states are equals or equivalents
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - o
      • isSolution

        public abstract boolean isSolution()
        Determines if the current state is a solution or not
        Returns:
        true if the current state is a solution and false otherwise