Package fr.uga.pddl4j.planners
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>
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
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
ConstructorDescriptionCreates new default configuration.Creates a configuration from another. -
Method Summary
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, values
-
Constructor Details
-
PlannerConfiguration
Creates a configuration from another.- Parameters:
other
- the other configuration.
-
PlannerConfiguration
public PlannerConfiguration()Creates new default configuration.
-
-
Method Details
-
setProperty
Sets the value of a specific key properties. This method converts the value object into string for storing by using the methodtoString()
.- 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
Returns a string representation of this configuration.- Overrides:
toString
in classProperties
- Returns:
- a string representation of this configuration.
-