mirror of
https://github.com/RAIRLab/Spectra.git
synced 2025-11-02 23:01:20 +00:00
TORA example
This commit is contained in:
parent
2624b0c411
commit
32e7a8fe4c
6 changed files with 88 additions and 8 deletions
|
|
@ -132,7 +132,14 @@ public class Action {
|
|||
|
||||
public List<Variable> openVars() {
|
||||
|
||||
return freeVariables;
|
||||
Set<Variable> variables = Sets.newSet();
|
||||
|
||||
variables.addAll(freeVariables);
|
||||
|
||||
List<Variable> variablesList = CollectionUtils.newEmptyList();
|
||||
|
||||
variablesList.addAll(variables);
|
||||
return variablesList;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,15 +42,18 @@ public class Sandbox {
|
|||
|
||||
public static void main(String[] args) throws com.naveensundarg.shadow.prover.utils.Reader.ParsingException {
|
||||
|
||||
List<PlanningProblem> planningProblemList = (PlanningProblem.readFromFile(Sandbox.class.getResourceAsStream("../problems/tora/sodacan.clj")));
|
||||
List<PlanningProblem> planningProblemList = (PlanningProblem.readFromFile(Sandbox.class.getResourceAsStream("../problems/tora/attend.clj")));
|
||||
|
||||
Planner depthFirstPlanner = new DepthFirstPlanner();
|
||||
|
||||
PlanningProblem planningProblem = planningProblemList.stream().filter(problem -> problem.getName().equals("soda can challenge")).findFirst().get();
|
||||
PlanningProblem planningProblem = planningProblemList.stream().filter(problem -> problem.getName().equals("soda can challenge 2")).findFirst().get();
|
||||
|
||||
|
||||
depthFirstPlanner.plan(planningProblem.getBackground(), planningProblem.getActions(), planningProblem.getStart(), planningProblem.getGoal()).ifPresent(
|
||||
System.out::println
|
||||
y->{
|
||||
|
||||
System.out.println(y);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue