Package libai.search

Class AStar

  • All Implemented Interfaces:
    Search

    public class AStar
    extends java.lang.Object
    implements Search
    JUST USEFUL FOR MINIMIZATION PROBLEMS!!
    • Constructor Summary

      Constructors 
      Constructor Description
      AStar()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      State search​(State init)
      Do a search from the init state, until the current state becomes a solution (State.isSolution()) If the algorithm finds a solution return the current state as the solution.
      • Methods inherited from class java.lang.Object

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

      • AStar

        public AStar()
    • Method Detail

      • search

        public State search​(State init)
        Description copied from interface: Search
        Do a search from the init state, until the current state becomes a solution (State.isSolution()) If the algorithm finds a solution return the current state as the solution. That internal representation of the state must contain all the information needed to reconstruct the path or any other operation needed by the user. If there is no solution this method must return null.
        Specified by:
        search in interface Search
        Parameters:
        init - Initial state of the search
        Returns:
        The final state that become a solution or null if there is no solution.