This is a project that contains a simple planner, operating on a grounded representation. You can either use the planner as the C# code or use the CLI interface to get plans. The planner expects a grounded representation of a PDDL domain+problem, that can be obtained from the Translator. This project is also available as a dotnet tool on the NuGet Package Manager.
The easiest way to run Flash Planner is to install it as a dotnet tool by running the following command:
dotnet tool install FlashPlanner
The arguments that can be given to Flash Planner is heavily inspired by Fast Downward, where there is seperate string arguments for the translator and the search engine. Generally, it needs a domain and problem file in the PDDL format as well as a search engine. The search engine, and translation, arguments is given as a string, e.g.:
--search "greedy(hFF())"
The translator also have optional arguments, howevery they are usually not needed. Below are the different Search Engines and Heuristics that can be combined to run FlashPlanner. There is also the option to use an alias, instead of a combination of search and translator arguments.
If you dont wish to use the dotnet tool package, you can just clone the repository and use dotnet run
from the FlashPlanner
folder.
Search on a domain file called domain.pddl
and a problem file called p01.pddl
with greedy best first search and the Goal Count heuristic:
flashplanner --domain domain.pddl --problem p01.pddl --search "greedy(hGoal())"
Search on a domain file called domain.pddl
and a problem file called p01.pddl
with greedy best first search and the hColMax with Goal Count and hAdd:
flashplanner --domain domain.pddl --problem p01.pddl --search "greedy(hColMax([hGoal(),hAdd()]))"
The available search engines are:
beam(h, b)
: Beam Search. H is the heuristic, b is the beta value as an integer.ehc(h)
: Enforced Hill Climbing Search. H is the heuristic.greedy(h)
: Greedy Best First Search. H is the heuristic.greedy_underaprox(h)
: Greedy Best First Search with Under-Approximation Refinement (UAR). H is the heuristic.greedy_prefered(h)
: Greedy Best First Search with Preferred Operators (PO). H is the heuristic.greedy_defered(h)
: Greedy Best First Search with Deferred Heuristic Evaluation (DHE). H is the heuristic.greedy_lazy(h)
: Lazy Greedy Best First Search. H is the heuristic.greedy_focused(h, n, b, p)
: Greedy Best First Search with Focused Macros. H is the heuristic, N is the maximum number of macros, B is the search budget in seconds and P is the parameter limit for added macros (too many parameters kills the translator). Do note, this implementation of the macro generation is not very good, and does NOT work for all domains.
The available heuristics are:
hConstant(n)
: Returns a given constant all the time. N being the constant.hDepth()
: Simply returns a cost that is 1 lower than its parenthFF()
: Returns a cost based on a solution to the relaxed planning graph for the problemhAdd()
: Is the Additive Heuristic that returns the sum of actions needed to achive every goal fact.hMax()
: Is the Max Heuristic that returns the highest amount of actions needed to achive a goal fact.hGoal()
: Returns the amount of goals that are achived in the given state, i.e.h = allGoals - achivedGoals
hPath()
: Returns the cost of the current branch being evaluatedhWeighted(h,w)
: Takes one of the previously given heuristics, and weights its result from a constant. H is the heuristic and W is the weight.hColMax([h1,...,hn])
: Takes a set of other heuristics and returns the highest value from any of the heuristics.hColSum([h1,...,hn])
: Same as the previous one, but takes the sum of all the heuristics.
There is also a set of aliases, that can be used as a single value to setup both the search and the translator. The options are:
fast()
: Normal translator configuration with Greedy Best First search and the heuristic hFF.
To find a plan using the Greedy Best First Search engine:
var decl = new PDDLDecl(...);
var translator = new PDDLToSASTranslator(false);
var sas = translator.Translate(decl);
var greedyBFS = new GreedyBFS(new hFF());
ar plan = greedyBFS.Solve(sas);
Here is the set of requirements that the planner supports.
- STRIPS (
:strips
) - Typing (
:typing
) - Disjunctive Preconditions (
:disjunctive-preconditions
) - Equality (
:equality
) - Quantified Preconditions (
:quantified-preconditions
)- Existential Preconditions (
:existential-preconditions
) - Universal Preconditions (
:universal-preconditions
)
- Existential Preconditions (
- Conditional Effects (
:conditional-effects
) - Domain Axioms (
:domain-axioms
)- Subgoals Through Axioms (
:subgoals-through-axioms
) - Expression Evaluation (
:expression-evaluation
)
- Subgoals Through Axioms (
- ADL (
:adl
) - Fluents (
:fluents
) - Durative Actions (
:durative-actions
)- Durative Inequalities (
:durative-inequalities
) - Continuous Effects (
:continuous-effects
)
- Durative Inequalities (
- Negative Preconditions (
:negative-preconditions
) - Derived Predicates (
:derived-predicates
) - Timed Initial Literals (
:timed-initial-literals
) - Action Expansions (
:action-expansions
) - Foreach Expansions (
:forach-expansions
) - DAG Expansions (
:dag-expansions
) - Safety Constraints (
:safety-constraints
) - Open World (
:open-world
) - True Negation (
:true-negation
) - UCPOP (
:ucpop
) - Constraints (
:constraints
) - Preferences (
:preferences
)
Here are some simple coverage benchmarks to get an idea of the performance of this planner.
It is compared against Fast Downward with the configuration --evaluator \"hff=ff()\" --search \"lazy_greedy([hff], preferred=[hff])\"
.
Both are run with lazy greedy best first search with hFF.
Benchmarks are only run on the first 20 problems.
The planners have a time limit of 60 seconds and a memory limit of 4GB.
Domain | Problems | Fast Downward | Flash Planner |
---|---|---|---|
gripper | 20 | 20 | 20 |
miconic | 20 | 20 | 20 |
depot | 20 | 15 | 11 |
rovers | 20 | 20 | 19 |
zenotravel | 20 | 20 | 20 |
tpp | 20 | 20 | 14 |
satellite | 20 | 20 | 17 |
driverlog | 20 | 20 | 17 |
blocks | 20 | 20 | 20 |
logistics00 | 20 | 20 | 20 |
logistics98 | 20 | 20 | 9 |
freecell | 20 | 20 | 5 |
movie | 20 | 20 | 20 |
mprime | 20 | 20 | 5 |
trucks | 20 | 14 | 9 |
visitall-opt11-strips | 20 | 20 | 20 |
Total | 320 | 309 | 246 |