CSE 5361 - Assignments - Assignment 1 (Programming 1)

Due dates


Task

Implement three different planning algorithms (a linear planner, POP, and a continuous planner) for the blocks world. The allowed actions are as specified on page 382 of the textbook.

Input/Output

1. Linear planner

Input: Program lplan should take two commandline arguments:

lplan initial_state goal

The first argument is the name of a text file describing the initial state as a set of statements. The second argument is the name of a text file describing the goal as a set of statements. Here are some examples of initial state files, and here are some examples of goal description files. Your programs have to work with those files and arbitrary files in the same format.

Note that there can be an arbitrary number of blocks, and they can have arbitrary names (e.g., a, b, block123, block5423, etc). Your planner should not assume that the names of the blocks are limited.

Output: For the linear planner, the plan should be saved as a text file called "output.txt". You can use whatever format you like, but it should be reasonably easy to read.

2. POP

Input: Program pop takes the exact same commandline arguments as program lplan.

Output: For POP, the plan should be saved as two text files called "unordered.txt" and "ordered.txt". Again, the formats should be reasonably easy to read. File "unordered.txt" should store a description of the unordered plan, specifying also the minimal ordering constraints established between actions. One possibility is to assign a numeric ID to each action, and indicate for each action the IDs of actions that are constrained to happen before or after this action. File "ordered.txt" should contain a linearized, totally ordered plan that, of course, should be consistent with the partially ordered plan.

3. Continuous planner

The continuous planner program should have a somewhat different interface, so that we can test it against "adverse" conditions, where something unexpected has happened to the world. This program takes seven commandline arguments:

cplan current_state goal current_plan_unordered revised_plan_unordered revised_plan_ordered next_state next_plan_unordered

Here is a description of each of the arguments:

  1. The first argument names an input file that describes the current state, in the same format that we use to describe initial states for lplan and pop.
  2. The second argument names an input file that describes the goal, in the same format that we use to describe goals for lplan and pop.
  3. The third argument names an input file that describes a current plan, in partially ordered form. If there is no current plan (i.e., if the specified file is empty or does not exist), the program should use POP to come up with such a plan. If there is a current plan, the program should check to see if the current state satisfies all the preconditions of the plan, and adjust the plan accordingly if needed.
  4. The fourth argument names a file where the program stores, in partially ordered form (same format as in the pop program), the revised plan (which is the same as the current plan if and only if the current state satisfies all the preconditions of the current plan).
  5. The fifth argument names a file where the program stores a totally ordered version (same format as in the pop program) of the revised plan.
  6. The sixth argument names a file where the program stores the state that results after performing the first action of the totally ordered plan stored in the file named by the fifth argument.
  7. The seventh argument names a file where the program stores (in partially ordered form) the remaining plan, after removing the first action.
This somewhat complicated commandline interface allows us to execute a plan step-by-step. Each invocation of cplan will consider the current state, revise the current plan, execute one action, and save the next state and the remainder of the plan. The next invocation of cplan will use as input files some of the output files of the previous invocation.

You have to make sure that the output files that your cplan program produces can indeed be used as input files for the next invocation of the program.


Grading

The assignment will be graded out of 100 points: 30 points for correctness of each of the different planners, and 10 points for quality of code and quality of output.

How to submit homeworks using zip

1. Log into omega or gamma.
2. Create a homework directory assignment_No. (replace the No. by the homework number being submitted.)
3. Now use the following command to create a zip file.
zip -r assignment_No.zip assignment_No
4. For reference, to decompress assignment_No.zip you can use unzip assignment_No.zip.

Submission guidelines

Implementations in LISP, C, C++, and Java will be accepted. If you would like to use another language, please first check with the instructor via e-mail.

Submit a zipped directory (no other forms of compression accepted) via e-mail to athitsos AT uta DOT edu and to rosina.khan@uta.edu, with subject "CSE 5361, assignment 1". THE ATTACHMENT SHOULD NOT EXCEED 800KB in size. The directory should contain source code (compiled binaries are optional), and a file called readme.txt, which should SPECIFY PRECISELY:

Insufficient or unclear instructions will be penalized severely. Code that does not run on at least one of the gamma and omega machines gets zero points.