Coder Social home page Coder Social logo

mortimerp9 / prolog-graphplan Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 3.0 152 KB

The Graphplan algorithm is an automatic planning algorithm that can compute, given a set of rules, a plan of action to go from an initial state to a final state. This project provides an open source (GPL v3) implementation of this planner in Prolog.

License: GNU General Public License v3.0

Prolog 100.00%

prolog-graphplan's Issues

graphplan.pl returns the same plan multiple times

Hello,

I have been downloading and trying your graphplan implementation with the rocket_plan example.
But unfortunately it returns thesame plan so many times. For instance test(P) returns the same plan about 20 times (or more):

?- test(P).
P = [[load(rocket1, london, a)], [move(rocket1, london, paris)], [unload(rocket1, paris, a)]] ;
P = [[load(rocket1, london, a)], [move(rocket1, london, paris)], [unload(rocket1, paris, a)]] ;
P = [[load(rocket1, london, a)], [move(rocket1, london, paris)], [unload(rocket1, paris, a)]] ;
P = [[load(rocket1, london, a)], [move(rocket1, london, paris)], [unload(rocket1, paris, a)]] ;
P = [[load(rocket1, london, a)], [move(rocket1, london, paris)], [unload(rocket1, paris, a)]] ;

I am using swipl Vesrion 7.2.3

Any idea what could cause this?

Thank you for your help

Fabrice

Read current state inside adds

Hello, I'd like to solve a variant of your Rocket problem where:

  • the rockets have a quantifiable amount of fuel (e.g. 1000 units)
  • moving from a city to another one consumes some amount of fuel (e.g. 300 units).

In order to solve this, I thought I might add to the state a predicate: fuel(Rocket, FuelAmount).

But how can I update the state inside the adds predicate? I mean, can I somehow access the current state to read the FuelAmount of a Rocket in order to add fuel(Rocket, RemainingFuel) where RemainingFuel is FuelAmount - 300?

I'm sorry to trouble you but i'm unexperienced in Prolog and I can't tell if there's an obvious way solve this or if it's a limitation of Graphplan.

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.