Skip to content
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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

HGinnerup
Copy link
Contributor

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>

PDDL currently doesn't include effects
Move changes from personal repo to project organization
Copy link
Contributor Author

@HGinnerup HGinnerup left a 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.

  1. 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.
  2. 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.

Comment on lines +68 to +81
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);
}});
}
}
Copy link
Contributor Author

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();
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant