All Implemented Interfaces:
Planner, StateSpacePlanner, Serializable, Callable<Integer>

public final class HSP extends AbstractStateSpacePlanner
This class implements a simple state space planner based on A* algorithm. It is possible to choose the heuristic function used and its weight.

The command line syntax to launch the planner is as follow:

 HSP [-hV] [-e=<heuristic>] [-l=<logLevel>]
                            [-t=<timeout>] [-w=<weight>] <domain> <problem>


 Solves a specified planning problem using A* search strategy.

       <domain>              The domain file.
       <problem>             The problem file.

   -l, --log=<logLevel>      Set the level of trace: ALL, DEBUG, INFO, ERROR,
                               FATAL, OFF, TRACE (preset INFO).
   -t, --timeout=<timeout>   Set the time out of the planner in seconds (
                               preset 600s).
   -w, --weight=<weight>     the weight of the heuristic (preset 1.0).
   -e, --heuristic=<heuristic>
                             Set the heuristic : AJUSTED_SUM, AJUSTED_SUM2,
                               AJUSTED_SUM2M, COMBO, MAX, FAST_FORWARD,
                               SET_LEVEL, SUM, SUM_MUTEX (preset: FAST_FORWARD)
   -h, --help                Show this help message and exit.
   -V, --version             Print version information and exit.

Command line example:

    java -cp build/libs/pddl4j-4.0-all.jar fr.uga.pddl4j.planners.statespace.HSP
         -e MAX
         -w 1.2
         -t 600
See Also:
PlannerConfiguration, Serialized Form
  • Constructor Details

    • HSP

      public HSP()
      Creates a new planner with default parameters.
    • HSP

      public HSP(PlannerConfiguration configuration)
      Creates a new planner with a default configuration.
      configuration - the configuration of the planner.
  • Method Details

    • setHeuristicWeight

      public final void setHeuristicWeight(double weight)
      Sets the weight of the heuristic.
      setHeuristicWeight in class AbstractStateSpacePlanner
      weight - the weight of the heuristic. The weight must be greater than 0.
      IllegalArgumentException - if the weight is strictly less than 0.
    • setHeuristic

      public final void setHeuristic(StateHeuristic.Name heuristic)
      Set the name of heuristic used by the planner to solve a planning problem.
      setHeuristic in class AbstractStateSpacePlanner
      heuristic - the name of the heuristic.
    • hasValidConfiguration

      public boolean hasValidConfiguration()
      Checks the planner configuration and returns if the configuration is valid. A configuration is valid if (1) the domain and the problem files exist and can be read, (2) the timeout is greater than 0, (3) the weight of the heuristic is greater than 0, (4) the heuristic is a not null and (5) the list of search strategies to use constains one search strategy : ASTAR.
      Specified by:
      hasValidConfiguration in interface Planner
      hasValidConfiguration in class AbstractStateSpacePlanner
      true if the configuration is valid false otherwise.
    • instantiate

      public Problem instantiate(DefaultParsedProblem problem)
      Instantiates the planning problem from a parsed problem.
      problem - the problem to instantiate.
      the instantiated planning problem or null if the problem cannot be instantiated.
    • main

      public static void main(String[] args)
      The main method of the HSP planner.
      args - the arguments of the command line.