Skip to content

aig-upf/temporal-planning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temporal Planning

This documentation aims to explain how experiments with the planners introduced by [Jiménez, Jonsson and Palacios, 2015] can be run.

  1. Installation
    1. Universal PDDL Parser
    2. Planner Compilation
      1. Fast Downward Compilation
      2. TPSHE, TP and STP Compilation
    3. Domain Generator Compilation
    4. Plan Validator (VAL)
  2. Usage
    1. Automatic Usage
    2. Manual Usage
      1. Generator of Domains and Problems
      2. Running TPSHE
      3. Running TP and STP
  3. Credits
  4. References

Installation

Universal PDDL Parser

The input domains and problems will be parsed using the Universal PDDL Parser. You can clone it by executing the following command:

git clone https://github.com/aig-upf/universal-pddl-parser.git

Afterwards, you should compile it using scons:

cd universal-pddl-parser
scons

Planner Compilation

Firstly, you have to either clone or download this repository. It is important to have the folder next to the universal-pddl-parser folder so that it can be properly referenced. To clone it, you can use the following command:

git clone https://github.com/aig-upf/temporal-planning.git

Fast Downward Compilation

The Fast Downward version in this repository contains modifications to support temporal planning. However, the steps for compiling it are the same (see section "Compiling the planner" here.

For example, in case you wanted to compile the 64-bit version you should run the following commands:

cd temporal-planning
python fd_copy/build.py release64

TPSHE, TP and STP Compilation

The TPSHE, TP and STP can be compiled by running the scons command in the root directory:

cd temporal-planning
scons

After running these commands, executable files will be created in the temporal-planning/bin directory.

Domain Generator Compilation

The Allen Algebra domain requires a generator to create the problems that will be used as the planner's input. You can compile this generator by running the following commands:

cd temporal-planning/domains/AllenAlgebra
scons

After executing such commands, a file called generator will be created inside AllenAlgebra/problems.

Plan Validator (VAL)

The VAL tool by [Howey, Long and Fox, 2004] can be used to validate the resulting temporal plans. You can get the code from their repository. To run the script in the next section, the VAL folder must be in the same folder than the Universal PDDL Parser and the Temporal Planning Folders.

To compile the tool, use the make command.

Usage

Automatic Usage

A Python script called plan.py inside the bin folder encapsulates all the required calls in order to get a plan given a planner (TPSHE or TP) and a temporal planning problem. You can run it as follows:

plan.py [-h] [--generator GENERATOR] [--time TIME] [--memory MEMORY] [--iterated] [--no-iterated] planner domain problem

where:

  • planner: Name of the algorithm you want to use.

    • If you want to use TPSHE, you must write she.

    • If you want to use TP, you must write tempo-i where i is the bound you want to use. For example, for bound 2 you should use tempo-2, while for bound 3 you should use tempo-3.

    • If you want to use STP, you must write stp-i where i is the bound you want to use. For example, for bound 2 you should use stp-2, while for bound 3 you should use stp-3.

  • domain: Path to the input domain.

  • problem: Path to the input problem.

  • --generator: Path to the executable generator for transforming the input domain and problem. It is just needed for the Allen Algebra domain.

  • --time: Maximum number of seconds during which Fast Downward will try to find a solution. Default: 3600 seconds.

  • --memory: Maximum number of MiB that Fast Downward will use to find a solution. Default: 4096 MiB.

  • --iterated, --no-iterated: Whether to continue searching after getting the first solution, or stop after getting the first solution. These flags only work with TPSHE. Default: search more after the first solution (iterated).

  • -h: Shows information about how to use the program.

The temporal solutions obtained by Fast Downward will be written to files whose name will begin with tmp_sas_plan. followed by a number indicating the solution number to the problem (e.g. tmp_sas_plan.2 would be the second solution that solves the problem).

Besides, in case a plan is produced, it will be validated using the VAL tool previously introduced. The output of the validator will be written to a file called plan.validation.

Example 1

cd temporal-planning
python bin/plan.py she domains/AllenAlgebra/domain/domain.pddl domains/AllenAlgebra/problems/pfile10.pddl --generator domains/AllenAlgebra/problems/generator

Example 2

cd temporal-planning
python bin/plan.py tempo-2 domains/tempo-sat/Driverlog/domain/domain.pddl domains/tempo-sat/Driverlog/problems/p1.pddl

Manual Usage

Generator of Domains and Problems

As explained before, a generator is used for the AllenAlgebra domain so as to obtain the temporal domains and problems. The generator is found in the domains/AllenAlgebra/problems folder.

The command for obtaining temporal domains and problems is the following:

./generator <input-domain>  <input-problem> > <output-domain> 2> <output-problem>

Assuming that we are in the folder temporal-planning (the root), an example would be:

./domains/AllenAlgebra/problems/generator domains/AllenAlgebra/domain/domain.pddl domains/AllenAlgebra/problems/pfile10.pddl > tdom.pddl 2> tins.pddl

Running TPSHE

To use TPSHE, you have to run the binary compileSHE placed in the bin folder. The command follows this structure:

./compileSHE <domain> <problem> > <output-domain> 2> <output-problem>

The following command is an example of how it is used for the Driverlog domain given that we are in the temporal-planning (the root) folder:

./bin/compileSHE domains/tempo-sat/Driverlog/domain/domain.pddl domains/tempo-sat/Driverlog/problems/p10.pddl > dom.pddl 2> ins.pddl

Once the domain and the problem have been converted, we can use Fast Downward using the LAMA-2011 setting. The command is the following (use the build you used to compile Fast Downward):

python fd_copy/fast-downward.py --build release64 --alias seq-sat-lama-2011 dom.pddl ins.pddl

Since LAMA-2011 is used for TPSHE, a classical plan will be obtained instead of a temporal plan. The name of such plans begins with sas_plan. To convert a classical plan into a temporal plan, you can use the planSchedule tool of the bin folder as follows:

./planSchedule <temporal-domain> <classical-domain> <temporal-problem> <classical-plan> > <temporal-plan>

Running TP and STP

To use TP, you have to run the binary compileTempo placed in the bin folder. The command follows this structure:

./compileTempo <domain> <problem> <bound> > <output-domain> 2> <output-problem>

On the other hand, to use STP, you have to run the binary compileTempoParallel. The command follows the same structure than in TP:

./compileTempoParallel <domain> <problem> <bound> > <output-domain> 2> <output-problem>

The following command is an example of how TP could be used for the Driverlog domain using bound 2 given that we are in the temporal-planning (the root) folder. In the case of STP, remember that you only have to change compileTempo by compileTempoParallel:

./bin/compileTempo domains/tempo-sat/Driverlog/domain/domain.pddl domains/tempo-sat/Driverlog/problems/p10.pddl 2 > dom.pddl 2> ins.pddl

Once the domain and the problem have been converted, we can use Fast Downward using the TP-LAMA setting. The command is the following (use the build you used to compile Fast Downward):

python fd_copy/fast-downward.py --build release64 --alias tp-lama dom.pddl ins.pddl

The output of Fast Downward will consist of temporal plans (the name of the files starts with tmp_sas_plan.) unlike with TPSHE.

Credits

The planner is a modified version of the Fast Downward distribution to support temporal planning.

References

About

Algorithms for solving temporal planning problems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published