View all files | ||||
This project is a demo of using the artificial intelligence automated planning library strips, in node.js.
Try it online at https://stripsfiddle.meteorapp.com
If you're new to STRIPS automated planning, here is a great tutorial to get you started.
The following examples show how to solve planning problems by identifying the optimal set of actions to achieve a goal. For example, stacking blocks, Towers of Hanoi, and even Starcraft can be solved by the AI (see below, it's pretty neat!).
Several examples from the Blocks World domain are included in this project, in which the AI is able to successfully plan the series of steps to move and stack blocks on a series of tables.
The AI planning works by processing a simple domain using a PEG.js grammar sheet and runs the result using a simple STRIPS problem.
The domain and problem PDDL files are parsed via PEG.js, producing a JSON object for a given domain. The JSON is then processed to identify applicable actions within a given state of the problem. The actions are then applied to the current state, producing a new set of states. This process is repeated, where applicable actions are identified for the new states, applied, and further new states produced. The resulting tree of possible states and actions may then be traversed using the A* algorithm to locate an optimal set of steps to achieve the goal state, as specified in the problem.
Domain | Problem Move blocks a, b from table x to table y. Multiple blocks are permitted on a table. The only available action is "move".
Domain | Problem Moves blocks a, b from table x to a stack ab on table y. Multiple blocks are permitted on a table. Available actions include "move", "stack", and "unstack".
Domain | Problem Unstacks blocks ba from table x to a stack ab on table y. Multiple blocks are permitted on a table. Available actions include "move", "stack", and "unstack".
Domain | Problem The fun one! Unstack blocks ba from table 1 to a stack ab on table 3. Only one block or stack is permitted on a table. The AI needs to plan for moving a block temporarily to table 2, while it sets up the correct order for stacking on table 3. Available actions include "move", "stack", and "unstack".
Blocks are stacked ab on table 1. The goal is to stack them ab on table 2. Only one block or stack is permitted per table. Here are the solutions.
Here is the AI's solution for the Blocks World Sussman Anomaly.
Now, for some fun. Here is the Starcraft domain. The task was to build a barracks. I originally wanted to build a Battlecruiser, but that was taking way too long (without a heuristic search!).
One step further, here is the AI's solution for traning a marine.
MIT
Kory Becker http://www.primaryobjects.com/kory-becker