-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation from CPN to numeric planning #154
base: main
Are you sure you want to change the base?
Conversation
PDDL currently doesn't include effects
Move changes from personal repo to project organization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular, two things from this project may be generally useful for the main branch.
- Color-types are iterable, which works well for enum-types, but not for product-types. The function
getAllPossibleColors(ColorType type)
may be useful for implementing the iteration on product-types. - Currently the PNML parser uses the graphical UI, and therefore cannot be called in a headless environment. Some
isHeadless
have been added, which allows the PNML parser to be used in a headless enviroment.
public static ArrayList<ArrayList<Color>> getAllPossibleColors(ColorType type) { | ||
if(type.isProductColorType()) { | ||
ArrayList<Iterable<Color>> subtypes = new ArrayList<>() {{ | ||
addAll(type.getProductColorTypes()); | ||
}}; | ||
|
||
return util.cartesian(subtypes); | ||
} | ||
else { | ||
return util.cartesian(new ArrayList<Iterable<Color>>() {{ | ||
add(type); | ||
}}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be useful to implement for tuple-colors in general.
Currently, color types are iterable, and you can iterable on each element of an enum-color, but iterating on a product-color yields no elements.
Producting every possible product-color is implemented seperately here as I tried not to alter too much existing code.
@@ -36,7 +36,7 @@ public class TimedPlaceComponent extends Place { | |||
private dk.aau.cs.model.tapn.TimedPlace place; | |||
private final dk.aau.cs.model.tapn.event.TimedPlaceListener listener = timedPlaceListener(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These isHeadless
checks may be interesting to add to main, as they allow the frontend to be run in a headless environment.
Code from P10 project to translate a CPN to numeric lifted planning in PDDL.
Running
List translatable queries into stdout:
-pddl-test <model.pnml> <queries.xml>
Translate the CPN and queries to a pddl domain and task into a folder "out-dir"
-pddl-out <out-dir> <model.pnml> <queries.xml>