-
Notifications
You must be signed in to change notification settings - Fork 68
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
Is it possible to get intermediate states rather than just action sequences through the API #81
Comments
From the coded problem, you can obtain the initial state with the method getInit(). It returns a BitExp. You have to create a BitState from this BitExp. Then, you have to apply the actions of the plan to get the intermediate states with method apply(). |
Is this the case with the latest PDDL4j 4.0.0? Is there an easy way to do this? I think there is a big difference between 4.0.0 and 3.8.3 |
I didn't change this point. The intermediate states are not stored in the plan. |
Could you provide an example? I couldn't effectively navigate the code to do this. |
In case anyone else need to get the intermediate states, here is the solution in Scala: val planner = new FF()
// ...
val problem = planner.instantiate(parsedProblem)
val plan = planner.solve(problem)
val state = new State(problem.getInitialState())
val states = plan.actions.asScala.toList.foldLeft(List(problem.toString(state)))((iStates, action) =>
state.apply(action.getConditionalEffects())
problem.toString(state) :: iStates
) You can adapt this to Java as needed. |
As stated above, please let me know which function can be implemented if possible, thanks
The text was updated successfully, but these errors were encountered: