Giter Site home page Giter Site logo

pellierd / pddl4j Goto Github PK

View Code? Open in Web Editor NEW
141.0 16.0 63.0 45.22 MB

PDDL4J is an open source library under LGPL license whose purpose of PDDL4J is to facilitate the development of JAVA tools for Automated Planning based on PDDL language (Planning Domain Description Language).

Home Page: https://lig-membres.imag.fr/pellier/

License: GNU Lesser General Public License v3.0

Java 0.36% HTML 0.01% Shell 0.01% PDDL 99.63%
automated planning java librairie pddl

pddl4j's Introduction

PDDL4J library

1. Contact

2. Description

PDDL4J is an open source library under LGPL license.

The purpose of PDDL4J is to facilitate the development of JAVA tools for Automated Planning based on PDDL language (Planning Domain Description Language). Automated planning and scheduling, in the relevant literature often denoted as simply planning, is a branch of artificial intelligence that concerns the realization of strategies or action sequences, typically for execution by intelligent agents, autonomous robots and unmanned vehicles.

PDDL was originally developed by Drew McDermott and the 1998 planning competition committee. It was inspired by the need to encourage the empirical comparison of planning systems and the exchange of planning benchmarks within the community. Its development improved the communication of research results and triggered an explosion in performance, expressivity and robustness of planning systems.

PDDL has become a de facto standard language for describing planning domains, not only for the competition but more widely, as it offers an opportunity to carry out empirical evaluation of planning systems on a growing collection of generally adopted standard benchmark domains. The emergence of a language standard will have an impact on the entire field, influencing what is seen as central and what peripheral in the development of planning systems.

The library contains:

  • A PDDL 3.1 parser and HDDL 1.0 parser and all the classes need to manipulate its concepts. The parser can be configured to accept only specified requirements of PDDL od HDDL language.
  • A set of useful pre-processing mechanisms in order to instantiate and simply actions into ground actions based on inertia properties.
  • A set of already implemented classical heuristics.
  • Several examples of planners using PDDL4J such as FastForward.

3. Dependencies

4. How to use the PDDL4J library?

A complete documentation of the library is available online. For those in a hurry to get PDDL4J and start running a planner start reading the Getting Started section. Note that PDDL4J API documentation is also available online.

5. How to cite

The library is open source. If you use it, please cite us:

D. Pellier & H. Fiorino (2017) PDDL4J: a planning domain description library for java, Journal of Experimental & Theoretical Artificial Intelligence, 30:1, 143-176 https://doi.org/10.1080/0952813X.2017.1409278

pddl4j's People

Contributors

aaronboyd92 avatar cegerard avatar fbaierl avatar fiorinoh avatar pellierd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pddl4j's Issues

other Planners

Hi Damien,
Is there is other planners (for example Graphplan) or how can i add a planner to PDDL4J
Thanks in advance

possible bug when the goal section in the problem file is empty

There is a problem if a problem file has no goals, and has one or more preferences
Kindly note the attached files for an example of such scenario, the plan is generated by OPTIC planner.

String dir = "./././directory/";String dir = "./././directory/";
String f_domain = dir + "domain.pddl";
String f_problem = dir + "problem.pddl";
Parser parser = new Parser();
try 
{
    parser.parse(f_domain, f_problem);
} 
catch (FileNotFoundException e) 
{
}
if (!parser.getErrorManager().isEmpty()) 
{
    parser.getErrorManager().printAll();
    System.exit(0);
}
Domain domain = parser.getDomain();
Problem problem = parser.getProblem();
Exp goal = problem.getGoal();
System.out.println(goal);

we will get an UncaughtException

if we debug and check out the object goal in Exp goal = problem.getGoal(); mentioned in the code above, we will find that there is something wrong with it, and also the variable problem it self
will have the msg: com.sun.jdi.InvocationException occurred invoking method.

Thanks for your time and efforts
Sincere regards.
domain.txt
plan.txt
problem.txt

Creating Exp using another Exp

Exp conditions = domain.getOperators().get(0).getPreconditions();
Exp conditions_copy = new Exp(conditions);

when the conditions are literals there is no problem, and the copy is correct

    :condition (and 
            (at start (in ?p ?l1))
                    (at start (haspower ?p))
                )

1- But the problem shows up when one of the conditions has numbers

    :condition (and 
            (at start (in ?p ?l1))
            (at start (< (money ?p) 50))
                )

The copy will be (at start (< (money ?p) null))
2- similarly there is a problem when the condition contains

    :condition (and 
            (at start (in ?p ?l1))
            (at start (< (money ?p) (somemoney)))
                )

note: (somemoney) is a fluent defined in domain.pddl as
(:functions
..
..
..
(somemoney)
)
and assigned a value in the problem.pddl
(:init
......
.....
(= (somemoney) 50)
)

domain.txt
problem.txt

parse problem.pddl error when problem.pddl contains point

problem.pddl like this.

(define (problem securitySolver)
(:domain security)
(:objects 
 192.168.12.220
 192.168.12.10
 192.168.13.10
 192.168.13.220
 192.168.14.10
 192.168.14.220
 192.168.11.10
 192.168.11.220
 192.168.88.251
 192.168.12.0/24
 192.168.12.1
 192.168.14.0/24
 192.168.14.1
 192.168.88.0/24
 192.168.88.1
 192.168.11.0/24
 192.168.11.1
 192.168.13.0/24
 192.168.13.1
)
(:INIT
(compromised 192.168.88.251)

(isquagga 192.168.12.1)
(islinux_kernal3 192.168.12.1)
(islinux 192.168.12.1)
(belong 192.168.12.1 192.168.12.0/24)
)
(:goal
(compromised 192.168.14.220)
)
(:metric minimize(total-cost))
)

then the parse code like this

Parser parser = new Parser();
        try {
            parser.parseProblem(new File("C:\\workspace\\test\\src\\main\\resources\\problem.pddl"));
            Problem problem = parser.getProblem();
            ErrorManager errorManager = parser.getErrorManager();
            Set<Message> messages = errorManager.getMessages();
            if (messages.isEmpty()) {
                System.out.println(problem);
            } else {
                System.out.println(messages);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

issues:

fr.uga.pddl4j.parser.lexer.TokenMgrError: Lexical error at line 4, column 9. Encountered: "." (46), after : ""

Problem using fluents and durative-actions

Hi,
Thank you for making PDDL4J available.
I am using it for one of my projects. I have a few domains/problems which have very few requirements, but now I have to create new domain/problem definitions which use numeric fluents and (maybe) durative actions.
I tried to run the program (I tested with each available planner, HSP, EHC and FF) on small examples I found which have the :fluents and :durative-actions requirements, and the parsing is done successfully (it says parsing domain file done successfully and parsing problem file done successfully) but it does not manage to encode them (it returns the error: IllegalArgumentException: problem to encode not ADL).
Checking the source code I understand that the problem is the :fluents and :durative-action requirements, however I may be missing something but I can't figure out how I can use them.
(In attachment the domain and problem files I am trying to give as input).

example-durative-action-domain.txt
example-durative-action-problem.txt
example-fluents-domain.txt
example-fluents-problem.txt

Thank you!

Problem while parsing actions

Hi,
I'm trying to parse a domain with 6 :durative-actions, but when I pass the file to the Parser, it reads only the first action.
Can you help me?

Bug in precondition checking

Hi,
Thanks for the great lib.

I am using the library with the default planner.

The two (supposed to be the same) preconditions have different results.
first one works ok and the is a plan
but second one can not find any plan

(:action WALK
   :parameters    (?r ?prev ?loc)
   :precondition
    (and
           (exists (?b) (and (at ?r ?b))) (and  (at ?r ?prev) (walkingdistance ?prev ?loc))  )

   :effect

                    (and
                      (not (at ?r ?prev))
                       (at ?r ?loc)
                    )
)

(:action WALK
   :parameters    (?r ?prev ?loc)
   :precondition
    (and
            (and  (at ?r ?prev) (walkingdistance ?prev ?loc)) (exists (?b) (and (at ?r ?b))) )

   :effect

                    (and
                      (not (at ?r ?prev))
                       (at ?r ?loc)
                    )
)

I will attach the full domain and problem but i do not think they should matter

to string :condition / :durative-action

Good morning.

:condition gets posted as :conditions and :durative-action is returned as :action.
Would be very nice, if you could fix those.

sincerely Richard

1. problem file Constraints is NULL if it contains a preference (within t φ) 2. (always-within tφψ) is not handled correctly maybe

Greetings,
Kindly note the attachment as it contains three files: domain, problem, and plan
According to the BNF grammar of PDDL3.0, the input problem and domain are correct. (tested also using lpg-syntax) and OPTIC Planner generates a sound plan (also in the attachment).

String dir = "./././directory/";
String f_domain = dir + "domain.pddl";
String f_problem = dir + "problem.pddl";
Parser parser = new Parser();
try 
{
    parser.parse(f_domain, f_problem);
} 
catch (FileNotFoundException e) 
{
}
if (!parser.getErrorManager().isEmpty()) 
{
    parser.getErrorManager().printAll();
    System.exit(0);
}
Domain domain = parser.getDomain();
Problem problem = parser.getProblem();

No errors are shown by the Error manager, However if i try:
1- Exp myConstraints = problem.getConstraints(); // this returns null
or
2- put a breakpoint near the final line (shown above in the code section) "Problem problem = parser.getProblem();", then debug and navigate to see the problem variable, the constraints field is NULL

It should contain all the things i have in the constraints section in the problem file (in the attachment).

After running some tests,
i found out two issues:
1- The preference within is causing the whole constraints object to be null
(preference b4 (within 72 (in p1 street4)))
2- The preference always-within
(preference b8 (always-within 25 (in p1 street1)(in p1 street2)))
is considered and showed by PDDL4J as (sometime-before 25.0 (in p1 street1))) and i think this is not correct.
Thanks for your time and efforts.
Sincere regards

domain.txt
plan.txt
problem.txt

Bug in the types declaration when multiple inheritance

Example from IPC7 Strorage tempo-sat:

(define (domain Storage-Time)
(:requirements :typing :durative-actions)
(:types hoist surface place area - object
container depot - place
storearea transitarea - area
area crate - surface)
....

Parser pushes an error: Type "area" already defined.

To solve this bug until this issue is not closed, write instead:
(define (domain Storage-Time)
(:requirements :typing :durative-actions)
(:types hoist surface place - object
area - (either object surface)
container depot - place
storearea transitarea - area
crate - surface)
....

Question about old version of code

Hello Damien,

A couple of years ago I used an older version of your PDDL4J code for my PhD. I had implemented a variation of the SAPA planner with the help of your code. The planner required online action instantiation (see this paper). For this, I found the Exp structures along with Substitution very useful.

I see that the code provided here has since changed quite a bit. Back then I had used the version cloned from @gerryai in this PDDL4J repository. I had to do a few modifications and fixed a few minor things to this code.

Now I am re-working my planner code in order to get ready for publishing it. For this, I will need to have my modified version of your old PDDL4J code published somewhere. Unfortunately I don't have the time to change to the new pddl4j structures in this repository (also I can't find Substitution any more), and would just like to use what I already have.

To the point: I would like to know if you have any preferences in terms of how to go about this, since it is a clone of an old PDDL4J version. I have put up my changes in my fork of @gerryai's repository (branch pddl4j_buehler). There is a file describing my modifications in there. A few things from the old code have been discarded, and some new things have been added (for example parsing of PDDL3.1 is done with the help of ANTLR).

At this point I see the following options:

  • I can post a PR to the fork of @gerryai. Though my changes are quite significant (in that some stuff gets deleted) and I'm not sure the code there is being maintained at all any more. I am thinking to open an issue in gerryai's repository for this as well, but wanted to first ask you as the author.
  • You may want to revive the old version of your code, maybe under a different name, for which I'd be happy to send you a PR to whichever repository you choose.
  • I can re-publish your code (as it is in my fork now), of course keeping the license of your choice and referencing your name, explaining that this is a copy of an old version of PDDL4J. In this case I'd be getting possible issues, questions etc. and you wouldn't have to look after the repository. I'm happy to do this.

It will be great if you let me know which solution you'd prefer, or if you have any other suggestions on how to go about this.

Best regards
Jennifer

Running planner as library

Hi

I just cloned and tested pddl4j. I can get it working as a separate project (following the example given in the getting started wiki and adding the correct arguments) but when I try to call it as a library from another (Maven) project I can't seem to do it. It seems like the VM options I used previously are wrong. Is it possible to run the planner from another maven project? And if so, how should the VM options be set?

Kind regards
Christof

Question about the use of negative literal for the derived predicate

I test the (:derived ) and found that only positive literal is allowed for derived predicate. In my case, I would like to derive the negative predicates like the following example

(:derive (not (predicate_x) ) (predicate_y) )

Is there any other way to meet this need?

Thanks,

PDDL4J unable to solve high arity predicates and actions?

Hi!

Using the files attached here:
domain.txt
problem.txt

A solution can be found using other planners including the online one here.

I am running the source code directly in an IDE to help debug. I think I have chased the problem down to the CodedProblem being generated not having the correct goal state. The only thing weird about the predicate and action here is that they have very high arity.

Will appreciate any help in figuring this out further!

Question about the variables declared in derived predicates

I tested with the following example and the parser say that ?x is undefined.

(:derived  (TEST_5 ?z)  (TEST_4 ?x ?y)    )

The question is the number of variables declared in derived predicate (TEST_5 ?z) must be exactly the same as variables used in the basic predicate (TEST_4 ?x ?y) ?

I am very new to PDDL, I tried to apply the :derived in my project. And I saw the example from http://www.sciencedirect.com/science/article/pii/S0004370205000810 and test with your parser. The test result is not as I thought. However, please help advising that. Thank you very much.

version 3.0.34 fails parser tests

Hello,

I downloaded this version, installed gradle and hit 'gradle build' (on Windows 10). The build failed on some parser tests (see attached reports).

tests.zip

Thanks
Roman

Problem running using JDK 9.0.4

I'm facing a bug when trying to use the library with the latest version of jdk (9.0.4 today). I've tried to execute the library and got the following error

screen shot 2018-04-04 at 9 16 13 am

I've downgraded the Java version and it started working perfectly, so it may be a bug caused by the new modifications that were introduced in this new jdk version.

Mismatches in Timeout Specification

In Planner.java, timeout is said to be specified in Seconds

* The default CPU time allocated to the search in seconds.

However, in actual implementations, the values used are milliseconds:

Similar discrepancies exist in a couple other places too.

Bug type object declaration

Parser pushes an error when the type object is used in the left part the type declaration: Type "object" already defined.

Example from IPC7 Tinybot seq-mco:
(define (domain TIDYBOT)
(:requirements :strips :typing :equality)
(:types robot cart object xc yc xrel yore)
....

Wiki not updated

Old Code in the wiki

// Parse the domain and the problem
      ErrorManager errorManager = factory.parseString(domain, problem);
      if (!errorManager.isEmpty()) {
            errorManager.printAll();
            System.exit(0);
      }

Need to be fixed like this.

// Parse the domain and the problem
      ErrorManager errorManager;
      try{        
        errorManager = factory.parse(domain, problem);
        if (!errorManager.isEmpty()) {
                errorManager.printAll();
                System.exit(0);
          }
      }catch(IOException e){
          
      }

Despite this the function

planner.search(pb);

trigger an error:

Exception in thread "main" java.lang.IllegalStateException: Instrumentation environment not initialised.
at fr.uga.pddl4j.util.MemoryAgent.sizeOf(MemoryAgent.java:152)
at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:190)
at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:170)
at fr.uga.pddl4j.planners.hsp.HSP.search(HSP.java:241)
at provapddl.ProvaPDDL.main(ProvaPDDL.java:149)

empty precondition

Hello Damien,

When using Actions with empty preconditions, which as far as my rather limited understanding of pddl is allowed, i get problems with your parser. "expected ':precondition ...'"
Would it be possible to support empty preconditions?

Best regards
Richard

parse request via string

Hi again,
This is not really an issue, but a feature request.
At the moment, if I didn't oversee some functionality it is only possible to parse extern files. If i have already loaded the pddl file to my program for whatever reason, then i have to write it back to the file to use your parser.
Id be interested in a direct String input, maybe even for parts of the pddl say only parsing one action. Not sure if that is possible with your architecture however.

Kind regards Richard

Parser problem

New to PDDL, so this may be a rookie error!

The domain file below fails to parse in pddl4j. It runs properly at http://editor.planning.domains.

I use

java -jar build/libs/pddl4j-3.8.3.jar -o gt/domain.pddl -f gt/problem.pddl

and get the error

Lexical error at line 10, column 3, file (gt/domain.pddl) : unexpected token "(".

(define (domain gt)
	(:requirements :strips :typing)
	(:types person
		location)
  
	(:predicates (person-at ?p - person ?loc - location))
  
	(:action go-to
		:parameters (?p - person ?loc - location)
		:precondition (not (person-at ?p ?loc))
		:effect (person-at ?p ?loc))
)

Test not completing

FFAnytimeTest is not completing or is taking a very long time.

<==========---> 81% EXECUTING [15m 43s]

:test > 84 tests completeduga.pddl4j.test.planners.statespace.ff.FFAnytimeTest
:test > Executing test fr.uga.pddl4j.test.planners.statespace.ff.FFAnytimeTest

Simple example to understand how to use PDDL4J

Hi,

I would like to use your Java planning tool (PDDL4J) as a library (i.e. invoking directly its classes from my Java program) and I should just need to pass it the domain description and the problem description and then to invoke a planner.

Is there a straightforward way to do this?

I tried to find an example in order to understand how to do this but I only found an example (in the sourceforge release) that works with version 1.0 of the tool and that is “incompatible” with the new version (3.5.0). In the GitHub repository, as far as I can see, there are no examples (and this seems quite strange to me). There is one in the Wiki but it works only "stand-alone" and it doesn't work when I integrate it in my Java code (I don't want to build it with Gradle, for this reason I'm using the JAR, and I don't want to run it as a Java agent)

Could you tell me if and where I can find it, please?
(also a brief snippet will be enough for my purposes)

Thanks

Java 10: Error with Memory Agent

PDDL4J works great with Java 10 except when MemoryAgent is used.

Stacktrace:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by fr.uga.pddl4j.util.MemoryAgent (file:/home/emmanuel/PDDL4J/Workspace/PDDL4J/build/libs/pddl4j-3.7.0.jar) to field java.util.ArrayList.serialVersionUID
WARNING: Please consider reporting this to the maintainers of fr.uga.pddl4j.util.MemoryAgent
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.lang.module.ModuleDescriptor.name accessible: module java.base does not "opens java.lang.module" to unnamed module @479cbee5
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:176)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:170)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:249)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:244)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:244)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:257)
	at fr.uga.pddl4j.util.MemoryAgent.deepSizeOf(MemoryAgent.java:221)
	at fr.uga.pddl4j.util.MemoryAgent.getDeepSizeOf(MemoryAgent.java:182)
	at fr.uga.pddl4j.planners.statespace.StateSpacePlannerFactory.main(StateSpacePlannerFactory.java:424)

Work in progress to resolve this issue.

com.sun.jdi.InvocationException occurred invoking method

Greetings,

Exp effect = new Exp(Connective.AND); // or other connectives e.g., Connective.AT_START
System.out.println(effect); 

When debugging effect will contain the msg : com.sun.jdi.InvocationException occurred invoking method
I think there might be something wrong in the toString() method of the Exp Class, according to stackoverflow website:
The root cause is that when debugging the java debug interface will call the toString() of your class to show the class information in the pop up box, so if the toString method is not defined correctly, this may happen.
This is causing further problems when creating an operator.

List<TypedSymbol> tempParameters = new LinkedList<TypedSymbol>();
Exp effects = new Exp(Connective.AND);
Exp preconds = new Exp(Connective.AND);
Op op = new Op(new Symbol(Kind.ACTION, "DummyAction"), tempParameters, preconds, effects);
System.out.println(tempOp);

Sincere regards

Does pddl4j support the :domain-axiom requirement?

I tested and found that the parser cannot recognize the requirement :domain-axiom (which is the feature I need to use). The question is, does pddl4j support this :domain-axiom requirement?

Thanks,

N.

The document says that HTN is supported after 3.8.1, but syntax error is reported

The document says that HTN is supported after 3.8.1, but syntax error is reported
(defdomain UnmannedCombatVehicle
(
(:operator ( !operator-move ?parameter-agent ?parameter-from ?parameter-to )
(( predicate-next ?parameter-from ?parameter-to ) )
(( predicate-at ?parameter-agent ?parameter-from ) )
(( predicate-at ?parameter-agent ?parameter-to ) )
)

(:operator ( !operator-fire ?parameter-target )
()
( ( predicate-at ?parameter-target ?parameter-to ))
()
)

(:operator ( !operator-evaluate ?parameter-target )
()
()
()
)

(:operator ( !operator-report ?parameter-target )
()
()
()
)

(:operator ( !operator-troubleshoot ?parameter-barrier )
()
()
()
)

(:operator ( !operator-hidden ?parameter-agent ?parameter-position)
()
()
()
)

(:method ( method-pursuitPosition ?parameter-agent ?parameter-from ?parameter-to )
( ( predicate-at ?parameter-agent ?parameter-from )
( predicate-next ?parameter-from ?parameter-to ) )
( ( !operator-move ?parameter-agent ?parameter-from ?parameter-to ))
( ( predicate-at ?parameter-agent ?parameter-from )
( predicate-next ?parameter-from ?parameter-x ))
( ( !operator-move ?parameter-agent ?parameter-from ?parameter-x )
( method-pursuitPosition ?parameter-agent ?parameter-x ?parameter-to ))
)

(:method ( method-attract ?parameter-agent ?parameter-from ?parameter-target ?parameter-to)
( (predicate-at ?parameter-agent ?parameter-from)
(predicate-at ?parameter-target ?parameter-to))
( (method-pursuitPosition ?parameter-agent ?parameter-from ?parameter-to)
( !operator-fire ?parameter-target )
( !operator-evaluate ?parameter-target )
( !operator-report ?parameter-target )

))	

(:method ( method-troubleshoot ?parameter-agent ?parameter-from ?parameter-barrier ?parameter-target ?parameter-to)
( (predicate-at ?parameter-agent ?parameter-from)
(predicate-at ?parameter-target ?parameter-to))
( (!operator-troubleshoot ?parameter-barrier)
(method-pursuitPosition ?parameter-agent ?parameter-from ?parameter-to)
( !operator-fire ?parameter-target )
( !operator-evaluate ?parameter-target )
( !operator-report ?parameter-target )

))

(:method ( method-hidden ?parameter-agent ?parameter-position)
()
((!operator-hidden ?parameter-agent ?parameter-position)
))
))

(= (function) X) in init

Hello again,
for some reason, a Term (= () ) in init, has the wrong connective i gues.
FN_ATOM instead of EQUAL.
which in turn scews up the equals method.
I gues thats a bug? Or is a there a special reason for that?

sincerely
Richard

Get all solution plans

Hi,
I need to recover all the solution plans for a pddl problem.
If I use the search method I get a solution plan, ok.

But if I try to use the getSolutionPlans (codeproblem) method defined in AbstractStateSpacePlannerAnytime I get an empty Vector .

Can someone give me some information or show me some examples?

Thanks in advance

Parse domain and problem with only string file path

At this moment, it is not possible to give to the parser the path of domain and problem files.
Parser only accept two files or two string containing the whole domain and problem.

Solution : add a new method which take in parameter string path and return two files.

Empty plan

Hi,

First, I want to thank you for developing and maintaining this package. A stable OS-independent planner is really useful for building applications on top of.

I may be missing something (I have little practical experience with planners) but I think the attached files demonstrate a bug. The planner reports an empty plan for "-o bug.pddl -f p01.pddl" even though the initial state is empty and the goal contains one fact. Adding another fact to the goal ("-o bug.pddl -f p02.pddl") produces a two step plan as expected.

Roman

bug.zip

Class cannot be resolved

Hi Damien,
Im trying to use pddl4j in eclipse but im getting the following errors:
fr.uga.pddl4j.parser.lexer.Token cannot be resolved
fr.uga.pddl4j.parser.lexer.ParseException cannot be resolved
Is there a missing package ?
Thanks in advance

Consider publishing to maven central

Hi, thanks for making pddl4j available it has been a really helpful toolbox for me.

It would be great if stable releases of PDDL4J were published to maven central to enable better integration with the rest of the ecosystem. This is especially important when managing (transitive) dependencies on pddl4j and would greatly facilitate its usage and adoption.

Objects not being parsed

I just noticed some strange behaviour. This code:

Parser parser = new Parser();
parser.parse(new File("pddl/blocksworld/domain.pddl"), new File("pddl/blocksworld/p01.pddl"));
System.out.println(parser.getProblem());

Gives this output as expected:

(define (problem blocks-4-0)
(:domain blocks)
(:requirements)
(:objects 
  d - BLOCK
  b - BLOCK
  a - BLOCK
  c - BLOCK
)
(:init
  (clear c)
  (clear a)
  (clear b)
  (clear d)
  (notable c)
  (notable a)
  (notable b)
  (notable d)
  (hand empty
)
(:goal   (and (on d c)
  (on c b)
  (on b a)))
)

However, this code:

Parser parser = new Parser();
parser.parseDomain("pddl/blocksworld/domain.pddl");
parser.parseProblem(new File("pddl/blocksworld/p01.pddl"));
System.out.println(parser.getProblem());

Gives this output:

(define (problem blocks-4-0)
(:domain blocks)
(:requirements)
(:init
  (clear c)
  (clear a)
  (clear b)
  (clear d)
  (notable c)
  (notable a)
  (notable b)
  (notable d)
  (hand empty
)
(:goal   (and (on d c)
  (on c b)
  (on b a)))
)

Note that in the second example, the objects have not been parsed.

Support for action costs?

Dear Demien,

Thanks for making PDDL4J available.
In my project, the problems are relatively small so the planner is able to solve them fast enough. However, it is hard to control the quality of the solution without associating costs with actions.
Would you consider adding support for actions costs? Even constant values could be helpful.

Thanks and best regards,
Roman

"the problem to encode is not ADL, ":requirements" not supported at this time" -- maybe related to numeric computation?

Hello, I encountered the error ":the problem to encode is not ADL, ":requirements" not supported at this time”, I am wondering if it’s because PDDL4J is not supporting numeric planning/do not have built-in numeric planner.

Here's the domain pddl:

(define (domain test)
(:requirements :typing :numeric-fluents :equality)
(:types server - object)

(:functions
(label ?p - server)
(number_of_pod ?p - server) - number)

(:action setNum
:parameters (?p - server)
:precondition ()
:effect (increase (number_of_pod ?p) 1)
)
)

Here's the problem pddl:

(define (problem p0) (:domain test)
(:objects
frontend master - server)

(:init
(= (number_of_pod master) 0)
(= (number_of_pod frontend) 0)

)

(:goal (and (= (number_of_pod master) 1)
(= (number_of_pod frontend) 3)
))

)

Thanks a lot!

Planner founds no plan when a plan exists

Hi,

First of all, thanks for this awesome library!
I'm learning pddl and started using PDDL4j a few days ago.

It seems the planners have a bug because editor.planning.domains finds a solution to my domain & problem files when pddl4j does not.

I managed to isolate the origin of the error to the following piece of code, which is the precondition of a move action:
(or (at ?to ?watcher) (forall (?c - character) (not (at ?to ?c))) )

This disjunction leads to a "No plan found".

However, when I remove the disjunction and just let the "forall" clause, a plan is found. If I understand correctly how disjunctions work, if one of the two clauses is true, then the action should be usable, so the disjunction should not let to a "no plan found".
Moreover, editor.planning.domains finds a solution to the problem almost instantly even with the disjunction there.

I tried with -p 0/1/2, but had the same result each time.

The complete action code is as following. Basically I want to force ?watcher to be set so at ?to ?watcher is true if it is possible, else ?watcher can be any character:

(:action move
  :parameters (?character ?watcher - character ?from ?to - place ?characterhouse - house)
  :precondition (and 
                    (at ?from ?character) 
                    ; If someone is in the room, pick it as watcher, else take someone randomly and ignore it in effects (conditional effect).
                    (or 
                        (at ?to ?watcher) 
                         (forall (?c - character) (not (at ?to ?c)))
                    )
                    
                    (not (= ?from ?to))
                    (isfromhouse ?character ?characterhouse)

                    ;Precondition: Either ?to is locked with ?key and ?character possesses ?key, either ?to is not locked.
                    (or 
                        (exists (?key - key) (and (islocked ?to ?key) (possess ?key ?character) ) )
                        (forall (?key - key) (not (islocked ?to ?key)) )
                    )
                    ;Precondition: Either ?to is not reserved to a house, either ?character is from the right house
                    (or 
                        (forall (?h - house) (not (reservedtohouse ?to ?h)) )
                        (reservedtohouse ?to ?characterhouse)    
                    )
                )
 :effect (and 
            (not (at ?from ?character)) 
            (at ?to ?character)
            (when (at ?to ?watcher) (sawatplace ?character ?watcher ?to)) 
        )
)

Do you know where it could come from?
Thanks for your help!

PDDL4J web application not working

Seems that the web application is not giving any result now. No matter what domain and problem file you put in, it always displays NO PROBLEM TO SOLVE. First I was using my own files (they are fine with editor.planning.domains). I thought it was my files' issue, but then I switched to example pddl files provided by this GitHub pddl4j website, and it still displays "No problem to solve".

image

Is this issue happening because I'm not using it correctly? Or something wrong is going on? Hope it can be solved. Thanks!

Planner finds solution to unsatisfiable problem

Hi,
I have a domain and a problem for it which has a 2 goals (a conjunction of predicates).
When one of the 2 goals becomes unsatisfiable, the planner should not find any solution. However, it does find a plan, considering only the other goal and ignoring the one which is unsatisfiable.
I have the attached the domain files and the problem files.
If I give them in input to this planner: http://editor.planning.domains/# it (correctly) says no plan can solve the problem.
However pddl4j finds the following solution: move-to banca gelateria p21 p22 , which satisfies only the second goal. The first one (which is unsatisfiable) is ignored. These are the files corresponding to this case:
domain1.txt
problem1.txt
If the second goal is satisfied, then it returns an empty plan but does not fail. These are the files corresponding to this case:
domain2.txt
problem2.txt

I have also added a brief explanation of the domain/problems below in case it helps.

Thank you!

Details about the problem:
The domain modeled is a small town where a person has to perform some tasks. The 2 goals of the problem are:

  1. be at the bank (banca) at 10am: predicate (be-at banca p20), where p20 means 10am
  2. for the final state, the person has to be at the ice-cream parlor (gelateria): predicate (be gelateria)

In the first case, in the initial state I have the predicates (be-at gelateria p20), (now p21) and(be-at banca p21)(indicating I was at 10am at the ice-cream parlor, and now it is 10.30am and I am at the bank). There should be no solution. PDDL4J instead finds a solution with an action which satisfies only the second goal (move to the ice-cream parlor).

In the second case, in the initial state I have the predicates (be-at gelateria p20) and (be gelateria), indicating I was at the ice-cream parlor at 10am and I am at the ice-cream parlor right now. The second goal is satisfied, but the first one is impossible: PDDL4J returns a plan with no actions but does not fail.

Include fluents in requirements leads to "problem to encode is not ADL"

Hi, first of all thank you for your great library! I have a working domain with a solvable problem. When I add fluents to the list of requirements, I get an error and cannot really explain why.

The error I get is:

the problem to encode is not ADL, ":requirements" not supported at this time

When I remove the fluent requirement the domain file can be parsed. But of course, I'd like to use it so I'm creating the issue.

By the way: I receive the info that the domain file and the problem file are parsed successfully.

BitState to BitExp

Hello,
First of all great job this is an excellent library. I have been trying to understand the library and a came up with a silly question. Is an easy way to convert BitState to bit BitExp?

toString spacing

Hello Damien,
another small thing.
When using the toString() of the domain there is no spacing before the :action, :preconditon and :effect. It may not be of much importance, but pasting a in pddl4j stored domain to some planners fail due to this spacing.
Would be nice if a spacing could be inserted at this positions.

Best regards
Richard

Unexpected "("

Hi
I have the next problem definition:

(define (problem xss_problem)
(:domain XSS_ACTIONS)
(:objects firewall email_server - security_device global_risk0 - global_risk
risk0 - risk
threshold0 - threshold
type_xss0 - type_xss)
(:init
(available firewall)
(available email_server)
(not (available_block_action))
(not (available_send_email_action))
(high_risk risk0)
(low_global_risk global_risk0)
(medium_threshold threshold0)
(persistent type_xss0)
)
(:goal
(or (= risk0 threshold0) (low_risk risk0) (note_risk risk0)))
)

but when I run the program it responses with unexpected "(" error
I tried change or clausule to and clausule but the program responses with null pointer exception
what's wrong with my problem?
The program shows the unexpected "(" exactly at initial parenthesis of goal

Edit: aditional info

How to generate new problem with domain, old problem and actions?

Hi,

Normally we use domain and problem files to plan for solutions.

Assume we've got a solution with 3 actions (actionA, actionB, actionC), and now actionA is done.

Somehow the environment changes, makes us want a re-plan for the actions remains to be done, e.g. actionB and actionC.
One way to do re-plan is

  1. generate a new problem with the original problem and actions already taken(actionA).
  2. And let the new problem (also updated with changed facts for environment changes), run with the original domain, which should then give new solution.

Is this the correct way of thinking about the re-plan a partially done problem?
Are there any ways to generate a new problem with actions and original problem and domain?

Thanks.

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.