Class PlannerConfiguration

java.lang.Object
java.util.Dictionary<K,​V>
java.util.Hashtable<Object,​Object>
java.util.Properties
fr.uga.pddl4j.planners.PlannerConfiguration
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,​Object>

public class PlannerConfiguration extends Properties
This class implements a planner configuration. A planner configuration is used to create a planner.

To create a planner with a specific configuration use the following example code:

 
         // The path to the benchmarks directory
         final String benchmarks = "src/test/resources/benchmarks/pddl/ipc2002/depots/strips-automatic/";

         // Gets the default configuration from the planner
         PlannerConfiguration config = HSP.getDefaultConfiguration();
         // Sets the domain of the problem to solve
         config.setProperty(HSP.DOMAIN_SETTING, benchmarks + "domain.pddl");
         // Sets the problem to solve
         config.setProperty(HSP.PROBLEM_SETTING, benchmarks + "p01.pddl");
         // Sets the timeout allocated to the search.
         config.setProperty(HSP.TIME_OUT_SETTING, 1000);
         // Sets the log level
         config.setProperty(HSP.LOG_LEVEL_SETTING, LogLevel.INFO);
         // Sets the heuristic used to search
         config.setProperty(HSP.HEURISTIC_SETTING, GoalCostHeuristic.Name.MAX);
         // Sets the weight of the heuristic
         config.setProperty(HSP.WEIGHT_HEURISTIC_SETTING, 1.2);

         // Creates an instance of the HSP planner with the specified configuration
         Planner planner = Planner.getInstance(Planner.Name.HSP, config);

         // Runs the planner and print the solution
         try {
             planner.solve();
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
  
 
Since:
4.0
See Also:
Serialized Form
  • Constructor Details

    • PlannerConfiguration

      public PlannerConfiguration(PlannerConfiguration other)
      Creates a configuration from another.
      Parameters:
      other - the other configuration.
    • PlannerConfiguration

      public PlannerConfiguration()
      Creates new default configuration.
  • Method Details

    • setProperty

      public String setProperty(String key, Object value)
      Sets the value of a specific key properties. This method converts the value object into string for storing by using the method toString().
      Parameters:
      key - the key property name.
      value - the value to set.
      Returns:
      the string representation of the previous object linked to the key property, or null is if it did not have one.
    • toString

      public String toString()
      Returns a string representation of this configuration.
      Overrides:
      toString in class Properties
      Returns:
      a string representation of this configuration.