Class ForwardSearch


public abstract class ForwardSearch extends StateSpaceSearch
Represents a forward search through the space of states, starting at the initial state and ending in any state where the goal is achieved. In the graph defined by this search, nodes are states and edges are steps.
Author:
Stephen G. Ware
  • Field Details

    • root

      public final ForwardRoot root
      The root node of the search space (i.e. a plan with 0 steps)
  • Constructor Details

    • ForwardSearch

      public ForwardSearch(StateSpaceProblem problem, SearchBudget budget)
      Creates a forward state space search for a given problem.
      Parameters:
      problem - the problem whose state space will be searched
      budget - the maximum number of states that may be searched and the maximum number of milliseconds the search may take
  • Method Details

    • countVisited

      public int countVisited()
      Description copied from class: Search
      Returns the total number of nodes that have been visited in this search space since it was created.
      Specified by:
      countVisited in class Search
      Returns:
      the number of visited nodes
    • countGenerated

      public int countGenerated()
      Description copied from class: Search
      Returns the total number of nodes that have been generated in this search since it was created.
      Specified by:
      countGenerated in class Search
      Returns:
      the number of expanded ndoes