Class Search

java.lang.Object
edu.uky.ai.planning.Search
Direct Known Subclasses:
PlanGraphSearch, PlanSpaceSearch, StateSpaceSearch, SubgraphSearch

public abstract class Search extends Object
A search is the process of exploring some space while looking for solutions to a problem. There are many different kinds of search spaces. Note that if a search space contains any solutions it probably contains many solutions, so this class provides ways to get one solution after another.
Author:
Stephen G. Ware
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The search budget for this problem
    final Problem
    The problem being solved
  • Constructor Summary

    Constructors
    Constructor
    Description
    Search(Problem problem, SearchBudget budget)
    Constructs a new search for the given problem.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Returns the total number of nodes that have been generated in this search since it was created.
    abstract int
    Returns the total number of nodes that have been visited in this search space since it was created.
    abstract Plan
    Searches the space until a solution is found.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • problem

      public final Problem problem
      The problem being solved
    • budget

      public final SearchBudget budget
      The search budget for this problem
  • Constructor Details

    • Search

      public Search(Problem problem, SearchBudget budget)
      Constructs a new search for the given problem.
      Parameters:
      problem - the problem to be solved
      budget - the search budget
  • Method Details

    • countVisited

      public abstract int countVisited()
      Returns the total number of nodes that have been visited in this search space since it was created.
      Returns:
      the number of visited nodes
    • countGenerated

      public abstract int countGenerated()
      Returns the total number of nodes that have been generated in this search since it was created.
      Returns:
      the number of expanded ndoes
    • solve

      public abstract Plan solve()
      Searches the space until a solution is found.
      Returns:
      the solution found