Package libai.search

Class BFS

  • All Implemented Interfaces:
    Search

    public class BFS
    extends java.lang.Object
    implements Search
    • Constructor Summary

      Constructors 
      Constructor Description
      BFS()  
    • 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

      • BFS

        public BFS()
    • 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.