Interface StateSpaceSearch

All Superinterfaces:
SearchStrategy, Serializable
All Known Implementing Classes:
AbstractStateSpaceSearch, AStar, BreadthFirstSearch, DepthFirstSearch, EnforcedHillClimbing, GreedyBestFirstSearch, HillClimbing

public interface StateSpaceSearch extends SearchStrategy
This interface defines the main methods for search strategies.
Since:
3.6
  • Field Details

    • DEFAULT_HEURISTIC

      static final StateHeuristic.Name DEFAULT_HEURISTIC
      The default heuristic used (FAST_FORWARD).
    • DEFAULT_HEURISTIC_WEIGHT

      static final double DEFAULT_HEURISTIC_WEIGHT
      The default weight of the heuristic (1.0).
      See Also:
      Constant Field Values
    • DEFAULT_TIMEOUT

      static final int DEFAULT_TIMEOUT
      The default time out (600s).
      See Also:
      Constant Field Values
  • Method Details

    • getHeuristic

      StateHeuristic.Name getHeuristic()
      Returns the heuristic to use to solve the planning problem.
      Returns:
      the heuristic to use to solve the planning problem.
    • setHeuristic

      void setHeuristic(StateHeuristic.Name heuristic)
      Sets the heuristic to use to solved the problem.
      Parameters:
      heuristic - the heuristic to use to solved the problem. The heuristic cannot be null.
    • getWeight

      double getWeight()
      Returns the weight set to the heuristic.
      Returns:
      the weight set to the heuristic.
    • setWeight

      void setWeight(double weight)
      Sets the wight of the heuristic.
      Parameters:
      weight - the weight of the heuristic. The weight must be positive.
    • setTimeOut

      void setTimeOut(int timeout)
      Sets the time out of the planner.
      Parameters:
      timeout - the time allocated to the search in second.
    • getTimeout

      int getTimeout()
      Returns the time out of the planner.
      Returns:
      the time out of the planner, i.e., the time allocated to the search in second.
    • getSearchingTime

      long getSearchingTime()
      Returns the time spend to find a solution.
      Returns:
      the time spend to find a solution.
    • setSearchingTime

      void setSearchingTime(long searchingTime)
      Sets the time spend to find a solution.
      Parameters:
      searchingTime - the time spend to find a solution.
    • getMemoryUsed

      long getMemoryUsed()
      Returns the amount of memory used for the search.
      Returns:
      the amount of memory used for the search.
    • setMemoryUsed

      void setMemoryUsed(long memoryUsed)
      Sets the amount of memory used for the search.
      Parameters:
      memoryUsed - the amount of memory used for the search.
    • getExploredNodes

      int getExploredNodes()
      Returns the number of explored nodes.
      Returns:
      the number of explored nodes.
    • setExploredNodes

      void setExploredNodes(int exploredNodes)
      Sets the number of explored nodes.
      Parameters:
      exploredNodes - the number of explored nodes.
    • getPendingNodes

      int getPendingNodes()
      Returns the number of pending nodes.
      Returns:
      the number of pending nodes.
    • setPendingNodes

      void setPendingNodes(int pendingNodes)
      Sets the number of pending nodes.
      Parameters:
      pendingNodes - the number of pending nodes.
    • getCreatedNodes

      int getCreatedNodes()
      Returns the number of created nodes.
      Returns:
      the number of created nodes.
    • setCreatedNodes

      void setCreatedNodes(int createdNodes)
      Sets the number of created nodes.
      Parameters:
      createdNodes - the number of created nodes.
    • search

      Node search(Problem codedProblem)
      Solves the planning problem and returns the first solution node found.
      Parameters:
      codedProblem - the problem to be solved. The problem cannot be null.
      Returns:
      a solution search or null if it does not exist.
    • searchSolutionNode

      Node searchSolutionNode(Problem codedProblem)
      Search a solution node to a specified domain and problem.
      Parameters:
      codedProblem - the problem to be solved. The problem cannot be null.
      Returns:
      the solution node or null.
    • searchPlan

      Plan searchPlan(Problem codedProblem)
      Search a solution plan to a specified domain and problem.
      Parameters:
      codedProblem - the problem to be solved. The problem cannot be null.
      Returns:
      the solution plan or null.
    • extractPlan

      Plan extractPlan(Node solutionNode, Problem codedProblem)
      Extract a plan from a solution node for the specified planning problem.
      Parameters:
      solutionNode - the solution node.
      codedProblem - the problem to be solved.
      Returns:
      the solution plan or null is no solution was found.
    • getInstance

      static StateSpaceSearch getInstance(SearchStrategy.Name name)
      Returns an instance of a specified search strategy with the default heuristic, weight and timeout.
      Parameters:
      name - the name of the search strategy.
      Returns:
      the search strategy.
    • getInstance

      static StateSpaceSearch getInstance(SearchStrategy.Name name, StateHeuristic.Name heuristic)
      Returns an instance of a specified search strategy withe the default weight and timeout.
      Parameters:
      name - the name of the search strategy.
      heuristic - the heuristic to used bt the search strategy.
      Returns:
      the search strategy.
    • getInstance

      static StateSpaceSearch getInstance(SearchStrategy.Name name, StateHeuristic.Name heuristic, double weight)
      Returns an instance of a specified search strategy with ethe default timeout.
      Parameters:
      name - the name of the search strategy.
      heuristic - the heuristic to used bt the search strategy.
      weight - the weight of the heuristic to used of the search strategy.
      Returns:
      the search strategy.
    • getInstance

      static StateSpaceSearch getInstance(SearchStrategy.Name name, StateHeuristic.Name heuristic, double weight, int timeout)
      Returns an instance of a specified search strategy.
      Parameters:
      name - the name of the search strategy.
      heuristic - the heuristic to used bt the search strategy.
      weight - the weight of the heuristic to used of the search strategy.
      timeout - the timeout of the search strategy.
      Returns:
      the search strategy.