Task
The task in this programming assignment is to design appropriate descriptions of facts, actions, and goals, using the PDDL language, for two planning problems: the Tower of Hanoi problem, and the 7-puzzle problem (a variation of the 8-puzzle problem where two squares are clear instead of one). You will use your descriptions as inputs to an implementation of a planning algorithm called Graphplan. If your descriptions are correct, Graphplan will produce appropriate plans.
Warning:This assignment is easier than previous ones, but debugging can be painful. Test your solutions with simple plans, requiring one or two actions, if they don't work for more complicated situations.
Compiling and Running the Software
The Graphplan software can be downloaded from graphplan.zip. See the README file in that package for additional information. To compile the software on omega, unzip the directory, and, from that directory, type
make graphplan
Once the program compiles, it can be invoked from the commandline as follows:
graphplan -o [operators_file] -f [facts_file]
For example:
graphplan -o block_ops.txt -f block_facts3.txt
- Argument operators_file specifies the location of a text file containing definitions of actions. For example, see block_ops.txt for definitions of actions appropriate for the blocks world.
- Argument facts_file specifies the location of a text file containing definitions of facts about the environment, including objects (and types for those objects), general predicates that are always true, initial state description, and goal description. For example, see block_facts2.txt, block_facts3.txt, and block_facts4.txt for example fact descriptions for the blocks world.
Once you start running the software, it will ask you three questions. Just hit enter for each question, so as to use the default settings. If your descriptions of actions and facts are correct, the program will print out a plan achieving the stated goal.
Note that the preconds in each facts file describe the initial state for that specific planning problem. The effects in each facts file describe the goal state.
Tower of Hanoi Description
A description of the Tower of Hanoi domain can be found at Wikipedia. In all problems that your program will be tested with there will be five or fewer discs (called disk1, disk2, disk3, disk4, disk5) and three pegs (called A, B, C). Note that some of the five disks may not appear in some of the planning problems.
The three planning problems you have to solve are:
Problem 1
initial state:
(on disk1 disk2)
(on disk2 A)
(clear disk1)
(clear B)
(clear C)
goal:
(on disk1 B)
Problem 2
initial state:
(on disk1 disk2)
(on disk2 disk3)
(on disk3 A)
(clear disk1)
(clear B)
(clear C)
goal:
(on disk1 disk2)
(on disk2 disk3)
(on disk3 B)
Problem 3
initial state:
(on disk1 disk2)
(on disk2 disk3)
(on disk3 disk4)
(on disk4 disk5)
(on disk5 C)
(clear disk1)
(clear A)
(clear B)
goal:
(on disk1 disk2)
(on disk2 disk3)
(on disk3 disk4)
(on disk4 disk5)
(on disk5 A)
Your solution for the Tower of Hanoi problem must include four files:
- hanoi_ops.txt, defining the actions.
- hanoi_facts1.txt, describing the initial state and goal of the first problem.
- hanoi_facts2.txt, describing the initial state and goal of the second problem.
- hanoi_facts3.txt, describing the initial state and goal of the third problem.
7-puzzle Description
7-puzzle is like 8-puzzle, except that there are only pieces numbered from 1 to 7 (not from 1 to 8), and there are two clear squares on the board. At any move, we can move a numbered piece to an adjacent clear square.
The three planning problems you have to solve are (X indicates a clear square):
Problem 1
initial state:
123
456
7XX
goal:
123
X56
4X7
Problem 2
initial state:
123
456
7XX
goal:
XX1
234
567
Problem 3
initial state:
XX7
654
321
goal:
123
456
7XX
Your solution for the 7-puzzle problem must include four files:
- puzzle_ops.txt, defining the actions.
- puzzle_facts1.txt, describing the initial state and goal of the first problem.
- puzzle_facts2.txt, describing the initial state and goal of the second problem.
- puzzle_facts3.txt, describing the initial state and goal of the third problem.
Grading
The programming assignment will be graded out of 100 points. 50 points will correspond to your solutions for the Tower of Hanoi world, and 50 points will correspond to your solutions for the 7-puzzle problem. Specifically, the point allocation is:
- 70 points: defining facts and actions correctly. The language that you define (i.e., the actions, objects, and general statements that are always true) should be sufficient not only for the specific plans that you are required to construct, but also for any other planning problems that we can define in the Tower of Hanoi domain or the 7-puzzle domain. As part of grading, we will also test your solutions on planning problems that we will make up.
- 5 points: solving any one of the six planning problems you are given (three for the Tower of Hanoi domain, three for the 7-puzzle domain). If you solve al 6 correctly, you get 30 points.
How to submit
Submissions should be made using Blackboard.
Submit a ZIPPED directory called assignment5.zip (no other forms of compression accepted, contact the instructor or TA if you do not know how to produce .zip files). The directory should contain:
- A file called answers.xxx, including your answers to the written part of the assignment. Extension xxx in your answers.xxx file depends on the file format you use, which can be PDF, text, Microsoft Word, or Open Office.
- Your four text files (hanoi_ops.txt, hanoi_facts1.txt, hanoi_facts2.txt, hanoi_facts3.txt) that are your solutions to the three Tower of Hanoi problems.
- Your four text files (puzzle_ops.txt, puzzle_facts1.txt, puzzle_facts2.txt, puzzle_facts3.txt) that are your solutions to the three 7-puzzle problems.