Skip to content
Algorithms for solving temporal planning problems
Python C++ CMake Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin problem with sequential planner having actions starting with push- Jun 18, 2018
domains
fd_copy
universal-pddl-parser @ 6e69d15 update repository to make compilation simpler Jul 12, 2019
.gitignore gitignore Jun 8, 2018
.gitmodules
LICENSE
README.md
SConstruct
build.sh update repository to make compilation simpler Jul 12, 2019

README.md

Temporal Planning

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

  1. Installation
    1. Fast Downward Compilation
    2. TPSHE, TP and STP Compilation
    3. 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

You can find information of the domains contained in this repository in the corresponding folder (link).

The CP4TP (Classical Planning for Temporal Planning) planner is a portfolio planner that integrates the different temporal planners implemented in this repository (TPSHE, TP and STP). It was the runner-up of the temporal track of the International Planning Competition (IPC) in 2018. You can find further information in the official page of the competition. The code of the portfolio is uploaded here.

Installation

Firstly, you have to either clone or download this repository. To clone it, you can use the following command:

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

This repository references the universal-pddl-parser repository. There are two ways of referencing that repository:

  1. You use the universal-pddl-parser submodule inside this repository.
  2. You use the PDDL_PARSER_PATH environment variable, which should contain the path to the universal-pddl-parser repository.

The following subsections explain how to compile the two components of the repository: (1) the modified version of Fast Downward and (2) the TPSHE, TP and STP planners.

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 following command in the root directory:

cd temporal-planning
./build.sh

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

In addition, that command also compiles a domain generator called generator for the Allen Algebra domain, which is stored in temporal-planning/domains/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, TP or STP) 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

You can’t perform that action at this time.