Class GSP
java.lang.Object
fr.uga.pddl4j.planners.AbstractPlanner
fr.uga.pddl4j.planners.statespace.AbstractStateSpacePlanner
fr.uga.pddl4j.planners.statespace.GSP
- All Implemented Interfaces:
Planner,StateSpacePlanner,Serializable,Callable<Integer>
This class implements a simple generic planner. It is possible to choose the search strategy and the heuristic to
solve a planning.
The command line syntax to launch the planner is as follow:
GSP [-hV] [-e="<heuristic>] [-l=<logLevel>]
[-t=<timeout>] [-w=<weight>] [-s
[=<strategies>...]]... <domain> <problem>
Description:
Solves a specified planning problem using a specified search strategy and
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).
-e, --heuristic=<heuristic>
Set the heuristics: AJUSTED_SUM, AJUSTED_SUM2,
AJUSTED_SUM2M, COMBO, MAX, FAST_FORWARD,
SET_LEVEL, SUM, SUM_MUTEX (preset: FAST_FORWARD)
-s, --search-strategies[=<strategies>...]
Set the search strategies: ASTAR,
ENFORCED_HILL_CLIMBING, BREADTH_FIRST,
GREEDY_BEST_FIRST, DEPTH_FIRST, HILL_CLIMBING
(preset: ASTAR)
-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.GSP
src/test/resources/benchmarks/pddl/ipc2002/depots/strips-automatic/domain.pddl
src/test/resources/benchmarks/pddl/ipc2002/depots/strips-automatic/p01.pddl
-s ENFORCED_HILL_CLIMBING ASTAR
-e FAST_FORWARD
-t 1000
- See Also:
PlannerConfiguration, 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_SETTINGFields 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
ConstructorsConstructorDescriptionGSP()Creates a new planner with default parameters.GSP(PlannerConfiguration configuration)Creates a new planner from a planner configuration. -
Method Summary
Modifier and TypeMethodDescriptioninstantiate(DefaultParsedProblem problem)Instantiates the planning problem from a parsed problem.static voidThe main method of theGSP.voidsetHeuristic(StateHeuristic.Name heuristic)Set the name of heuristic used by the planner to solve a planning problem.voidsetHeuristicWeight(double weight)Sets the weight of the heuristic.voidsetSearchStrategies(List<SearchStrategy.Name> strategies)Set the list of search strategies used by the planner to solve a planning problem.Methods inherited from class fr.uga.pddl4j.planners.statespace.AbstractStateSpacePlanner
addSearchStrategy, getConfiguration, getDefaultConfiguration, getHeuristic, getHeuristicWeight, getSearchStrategies, hasValidConfiguration, isSupported, setConfiguration, solve, throwInvalidConfigurationExceptionMethods inherited from class fr.uga.pddl4j.planners.AbstractPlanner
call, getDomain, getDomainFile, getLogLevel, getParser, getParserErrorManager, getProblem, getProblemFile, getStatistics, getTimeout, parse, parse, setDomain, setLogLevel, setProblem, setTimeout, solveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
GSP
public GSP()Creates a new planner with default parameters. -
GSP
Creates a new planner from a planner configuration.- Parameters:
configuration- the configuration of the planner.
-
-
Method Details
-
setHeuristicWeight
public final void setHeuristicWeight(double weight)Sets the weight of the heuristic. This method is overrided to add the command line option of the planner.- Overrides:
setHeuristicWeightin 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.
-
setHeuristic
Set the name of heuristic used by the planner to solve a planning problem. This method is overrided to add the command line options of the planner.- Overrides:
setHeuristicin classAbstractStateSpacePlanner- Parameters:
heuristic- the name of the heuristic.
-
setSearchStrategies
Set the list of search strategies used by the planner to solve a planning problem.- Overrides:
setSearchStrategiesin classAbstractStateSpacePlanner- Parameters:
strategies- the list of serach strategies to used.
-
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.
-
main
The main method of theGSP.- Parameters:
args- the arguments of the command line.
-