Class FF
java.lang.Object
fr.uga.pddl4j.planners.AbstractPlanner
fr.uga.pddl4j.planners.statespace.AbstractStateSpacePlanner
fr.uga.pddl4j.planners.statespace.FF
- All Implemented Interfaces:
Planner
,StateSpacePlanner
,Serializable
,Callable<Integer>
This class implements Fast Forward planner based on Enforced Hill Climbing algorithm and AStar search.
The command line syntax to launch the planner is as follow:
FF [-hV] [-l=<logLevel>] [-t=<timeout>] [-w=<weight>] <domain>
<problem>
Description:
Solves a specified planning problem combining enforced hill climbing and A*
search strategies using the the delete relaxation heuristic.
Parameters:
<domain> The domain file.
<problem> The problem file.
Options:
-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> Set the weight of the heuristic (preset 1.0).
-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.FF
src/test/resources/benchmarks/pddl/ipc2002/depots/strips-automatic/domain.pdd
src/test/resources/benchmarks/pddl/ipc2002/depots/strips-automatic/p01.pddl
-t 1000
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface fr.uga.pddl4j.planners.Planner
Planner.Name
-
Field Summary
Fields inherited from interface fr.uga.pddl4j.planners.Planner
DEFAULT_DOMAIN, DEFAULT_LOG_LEVEL, DEFAULT_PROBLEM, DEFAULT_TIME_OUT, DOMAIN_SETTING, LOG_LEVEL_SETTING, PROBLEM_SETTING, TIME_OUT_SETTING
Fields inherited from interface fr.uga.pddl4j.planners.statespace.StateSpacePlanner
DEFAULT_HEURISTIC, DEFAULT_SEARCH_STRATEGIES, DEFAULT_WEIGHT_HEURISTIC, HEURISTIC_SETTING, SEARCH_STRATEGIES_SETTING, WEIGHT_HEURISTIC_SETTING
-
Constructor Summary
ConstructorDescriptionFF()
Creates a new planner with default parameters.FF(PlannerConfiguration configuration)
Creates a new planner. -
Method Summary
Modifier and TypeMethodDescriptionstatic PlannerConfiguration
This method return the default arguments of the planner.boolean
Checks the planner configuration and returns if the configuration is valid.instantiate(DefaultParsedProblem problem)
Instantiates the planning problem from a parsed problem.static void
The main method of theFF
planner.void
setHeuristicWeight(double weight)
Sets the weight of the heuristic.Methods inherited from class fr.uga.pddl4j.planners.statespace.AbstractStateSpacePlanner
addSearchStrategy, getConfiguration, getHeuristic, getHeuristicWeight, getSearchStrategies, isSupported, setConfiguration, setHeuristic, setSearchStrategies, solve, throwInvalidConfigurationException
Methods inherited from class fr.uga.pddl4j.planners.AbstractPlanner
call, getDomain, getDomainFile, getLogLevel, getParser, getParserErrorManager, getProblem, getProblemFile, getStatistics, getTimeout, parse, parse, setDomain, setLogLevel, setProblem, setTimeout, solve
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fr.uga.pddl4j.planners.Planner
getDomain, getDomainFile, getLogLevel, getParserErrorManager, getProblem, getProblemFile, getStatistics, getTimeout, parse, parse, setDomain, setLogLevel, setProblem, setTimeout, solve
-
Constructor Details
-
FF
public FF()Creates a new planner with default parameters. -
FF
Creates a new planner.- Parameters:
configuration
- the configuration of the planner.
-
-
Method Details
-
getDefaultConfiguration
This method return the default arguments of the planner.- Returns:
- the default arguments of the planner.
- See Also:
PlannerConfiguration
-
setHeuristicWeight
public void setHeuristicWeight(double weight)Sets the weight of the heuristic.- Overrides:
setHeuristicWeight
in classAbstractStateSpacePlanner
- Parameters:
weight
- the weight of the heuristic. The weight must be greater than 0.- Throws:
IllegalArgumentException
- if the weight is strictly less than 0.
-
instantiate
Instantiates the planning problem from a parsed problem.- Parameters:
problem
- the problem to instantiate.- Returns:
- the instantiated planning problem or null if the problem cannot be instantiated.
-
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 is ENFORCE_HILL_CLIMBING and ASTAR.- Specified by:
hasValidConfiguration
in interfacePlanner
- Overrides:
hasValidConfiguration
in classAbstractStateSpacePlanner
- Returns:
true
if the configuration is validfalse
otherwise.
-
main
The main method of theFF
planner.- Parameters:
args
- the arguments of the command line.
-