mirror of
https://github.com/RAIRLab/Spectra.git
synced 2025-12-15 00:00:47 +00:00
Improvements to BreadthFirstPlanner
- Allow for unbounded search - Allow for a way to look for a certain number of plans - Use Pair from standard library
This commit is contained in:
parent
88b5ceee7a
commit
08b9c01f3e
4 changed files with 90 additions and 87 deletions
|
|
@ -44,17 +44,17 @@ public final class Runner {
|
|||
return;
|
||||
}
|
||||
|
||||
Planner breadthFirstPlanner = new BreadthFirstPlanner();
|
||||
BreadthFirstPlanner breadthFirstPlanner = new BreadthFirstPlanner();
|
||||
|
||||
for (PlanningProblem planningProblem : planningProblemList) {
|
||||
Optional<Set<Plan>> optionalPlans = breadthFirstPlanner.plan(
|
||||
Set<Plan> plans = breadthFirstPlanner.plan(
|
||||
planningProblem.getBackground(),
|
||||
planningProblem.getActions(),
|
||||
planningProblem.getStart(),
|
||||
planningProblem.getGoal());
|
||||
|
||||
if(optionalPlans.isPresent()) {
|
||||
System.out.println(optionalPlans.get().toString());
|
||||
if(plans.size() > 0) {
|
||||
System.out.println(plans.toString());
|
||||
}
|
||||
else {
|
||||
System.out.println("FAILED");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue