Giter Club home page Giter Club logo

gp-planner's Introduction

GP-Planner

This project provides a Prolog implementation of the Graphplan algorithm proposed in:

Blum, Avrim L., and Merrick L. Furst. "Fast planning through planning graph analysis." Artificial intelligence 90.1-2 (1997): 281-300.

Furthermore, an explanation of the plans obtained is provided in order to visualize the intermediate states of the planning process.

Domain representation

The domains are defined according to the STRIPS representation, in this case it is also possible to specify the application cost of each action.

Two domains related to rocket scenario and public transfers are already defined.

Each domain is separated in a file containing the operations and in another file containing the initial state and the goal to be reached.

How to use

The planner has been tested with SWI-Prolog 7.6.4 and YAProlog 6.2.2.

First of all, you need to load the main module:

consult('planner_start.pl').

Then calling the predicate start_planner will display a Text GUI to interact with the planner:

start_planner.
-----------------------------------------------------------------------
                        AUTOMATIC PLANNING MODULE                      
-----------------------------------------------------------------------


1. Load domain
2. Load initial & goal state
3. Plan
4. Explanation
0. Exit

|: 

You need to specify the path of the domain and the states for the planning:

|: 1.
Insert path of domain: |: 'domain/rocket'.

Domain loaded correctly

|: 2.
Insert path of states: |: 'domain/rocket_states'.

Initial state: at(a,london)  at(b,london)  at(rocket1,london)  has_fuel(rocket1)  
Goal: at(a,paris)  at(b,paris)

Then you can start the planning:

|: 3.


Plan found. Id: 1

Step 1:  load(rocket1,london,a)  load(rocket1,london,b)  
Step 2:  move(rocket1,london,paris)  
Step 3:  unload(rocket1,paris,a)  unload(rocket1,paris,b)  
Cost: 5

Explanations are provided by specifying the id of a returned plan:

|: 4.
Plan id: |: 1.


In the state: has_fuel(rocket1)  at(a,london)  at(b,london)  at(rocket1,london)  
I applied the actions: load(rocket1,london,a)  load(rocket1,london,b)  
to obtain the new state: has_fuel(rocket1)  at(rocket1,london)  in(a,rocket1)  in(b,rocket1)  

In the state: has_fuel(rocket1)  at(rocket1,london)  in(a,rocket1)  in(b,rocket1)  
I applied the action: move(rocket1,london,paris)  
to obtain the new state: at(rocket1,paris)  in(a,rocket1)  in(b,rocket1)  

In the state: at(rocket1,paris)  in(a,rocket1)  in(b,rocket1)  
I applied the actions: unload(rocket1,paris,a)  unload(rocket1,paris,b)  
to obtain the new state: at(a,paris)  at(b,paris)

Alternatively, the planner can be used without the Text GUI by:

  1. consulting a domain
  2. calling the predicate plan/3 specifying initial state and goal and returns plans in PlanSet
  3. calling the predicate plan_explanation/1 specifying the id of the plan to be explained.

gp-planner's People

Contributors

davideprimiceri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.