Block World Documentation


General Information

  • This implementation of the Block World is developed on Java as Java Applet. It consists of three parts:
          a) Main logic, developed as a Java class, that represents the STRIPS planning algorithm;
          b) Java Applet, developed as a class, that takes the input from the user (initial and goal state of the world), displays the generated plan, and draws the movement of the blocks in the Block World;
          c) HTML pages that embed the Java Applet and represent some more information about the application.

  • The implementation uses STRIPS planning algorithm, shown below:

  • STRIPS Planning Algorithm

    Graphical User Interface

  • The algorithm that is used works properly with more than 5 blocks but the interface is designed to display no more than 7 blocks.
  • The GUI represents the user's input and the output - plan generation and visualization. The delay between each step during the plan vizualization is 2 seconds.
  • The plan execution starts from the Initial State of the Block World and ends with the Goal State of the world. It is important when the plan execution starts to see the label "Initial state" above the robot arm. Sometimes while the browser is loading the Java Applet the execution of the plan has already begun and the user is not able to see the whole plan representation. (Note: This behavior is a browser's effect. This effect does not present when the applet is started without using a web browser.) If this behavior happens, when the plan is followed to the end, the browser will start again the plan execution but this time it will show the label "Initial State". When the Goal State is achieved, a label "The goal state is reached! :-)" will be displayed above the robot arm.
  • The application is tested on the following web browsers: Internet Explorer (v. 6.0), Mozilla Firefox (v. 1.0). Some of the input states that are used for testing can be found here.


  • Input

  • The Java applet shows two dialog windows where the user has to enter the inital and the goal state respectively. The names of the blocks have to be consecutive numbers starting from 1 to N, where N is the last block in the world;
  • Before generating the planning algorithm, the application displays a window for starting confirmation;
  • After displaying the generated plan (if exists), the application shows a window for planning execution confirmation.


  • Output

  • If a correct input is entered by the user, the Java Applet will show the generated plan - how to get to the goal state starting from the initial state; After user confirmation, the application executes the plan, by displaying each action step by step in a graphical mode;
  • If the input is correct but the initial state is equal to the goal state, the Java Applet will display an appropriate message saying that the states are equal. In this case a plan will not be generated and no visualization will be displayed;
  • If the initial state and/or are not correct, the Java Applet will show an appropriate message saying that the input has to be checked and re-entered.


  • Menu

    [Start again] - By clicking on the link, the Java Applet will be loaded once again and will ask the user for the input.
    [Assignment] - By clicking on the link, the text of the assignment will be shown; It represents the main idea of Block World.
    [Examples] - By clicking on the link, some examples of initial state and goal will be shown as well as the corresponding generated plan in a table format.
    [Documentation] - By clicking on the link, the the current page will be displayed; It consists of some basic information about the application.


    Scenarios