mirror of
https://github.com/RAIRLab/Spectra.git
synced 2024-11-21 16:36:29 -05:00
Fix caching bug. Getting demo to work.
This commit is contained in:
parent
5ec5169ae5
commit
cdb9c455c8
4 changed files with 7 additions and 11 deletions
|
@ -13,7 +13,7 @@ import java.util.stream.Collectors;
|
||||||
public class DepthFirstPlanner implements Planner {
|
public class DepthFirstPlanner implements Planner {
|
||||||
|
|
||||||
|
|
||||||
private static int MAX_DEPTH = 4;
|
private static int MAX_DEPTH = 5;
|
||||||
private static boolean EXHAUSTIVE_TILL_MAX_DEPTH = false;
|
private static boolean EXHAUSTIVE_TILL_MAX_DEPTH = false;
|
||||||
|
|
||||||
public static int getMaxDepth() {
|
public static int getMaxDepth() {
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class Operations {
|
||||||
}).findAny();
|
}).findAny();
|
||||||
|
|
||||||
|
|
||||||
if(cachedOptional.isPresent()){
|
if(cachedOptional.isPresent() && cachedOptional.get().getValue().isPresent()){
|
||||||
|
|
||||||
return cachedOptional.get().getValue();
|
return cachedOptional.get().getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,7 @@ public class RunDemo {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
Goal g1 = goalTrackingProblem.getGoalNamed("G1");
|
Goal g1 = goalTrackingProblem.getGoalNamed("G1");
|
||||||
Goal g2a = goalTrackingProblem.getGoalNamed("G2a");
|
Goal g2 = goalTrackingProblem.getGoalNamed("G2");
|
||||||
Goal g2b = goalTrackingProblem.getGoalNamed("G2b");
|
|
||||||
|
|
||||||
Goal g3 = goalTrackingProblem.getGoalNamed("G3");
|
Goal g3 = goalTrackingProblem.getGoalNamed("G3");
|
||||||
Goal g4 = goalTrackingProblem.getGoalNamed("G4");
|
Goal g4 = goalTrackingProblem.getGoalNamed("G4");
|
||||||
|
@ -74,8 +73,8 @@ public class RunDemo {
|
||||||
|
|
||||||
tryAndAddGoal(g1, goalTracker);
|
tryAndAddGoal(g1, goalTracker);
|
||||||
|
|
||||||
tryAndAddGoal(g2a, goalTracker);
|
tryAndAddGoal(g2, goalTracker);
|
||||||
tryAndAddGoal(g2b, goalTracker);
|
// tryAndAddGoal(g2b, goalTracker);
|
||||||
|
|
||||||
tryAndAddGoal(g3, goalTracker);
|
tryAndAddGoal(g3, goalTracker);
|
||||||
|
|
||||||
|
|
|
@ -157,16 +157,13 @@
|
||||||
:goals {G1 {:priority 1.0
|
:goals {G1 {:priority 1.0
|
||||||
:state [(not (open (door room1)))]}
|
:state [(not (open (door room1)))]}
|
||||||
|
|
||||||
G2a {:priority 1.0
|
G2 {:priority 1.0
|
||||||
:state [(in prisoner room1)]}
|
:state [(in prisoner room1)]}
|
||||||
|
|
||||||
G2b {:priority 1.0
|
|
||||||
:state [(in guard room1)]}
|
|
||||||
|
|
||||||
G3 {:priority 1.0
|
G3 {:priority 1.0
|
||||||
:state [(sameroom guard prisoner)]}
|
:state [(sameroom guard prisoner)]}
|
||||||
|
|
||||||
G4 {:priority 2.1
|
G4 {:priority 2.0
|
||||||
:state [(accompanies prisoner commander)]}
|
:state [(accompanies prisoner commander)]}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue