mirror of
https://github.com/RAIRLab/Spectra.git
synced 2025-10-05 22:21:20 +00:00
More tweaks
This commit is contained in:
parent
598f9b3dff
commit
f3ddd342c6
22 changed files with 710 additions and 175 deletions
|
@ -33,8 +33,8 @@ public class DepthFirstPlannerTest {
|
|||
|
||||
Planner depthFirstPlanner = new DepthFirstPlanner();
|
||||
|
||||
PlanningProblem planningProblem = planningProblemList.get(2);
|
||||
System.out.println(depthFirstPlanner.plan(planningProblem.getBackground(), planningProblem.getActions(), planningProblem.getStart(), planningProblem.getGoal()));
|
||||
PlanningProblem planningProblem = planningProblemList.get(5);
|
||||
depthFirstPlanner.plan(planningProblem.getBackground(), planningProblem.getActions(), planningProblem.getStart(), planningProblem.getGoal()).get().forEach(System.out::println);
|
||||
}
|
||||
|
||||
@DataProvider
|
||||
|
|
56
src/test/java/edu/rpi/rair/GoalTrackerTest.java
Normal file
56
src/test/java/edu/rpi/rair/GoalTrackerTest.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package edu.rpi.rair;
|
||||
|
||||
import com.diogonunes.jcdp.color.ColoredPrinter;
|
||||
import com.diogonunes.jcdp.color.api.Ansi;
|
||||
import com.naveensundarg.shadow.prover.utils.Reader;
|
||||
import edu.rpi.rair.utils.GoalTrackingProblem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
/**
|
||||
* Created by naveensundarg on 1/15/17.
|
||||
*/
|
||||
public class GoalTrackerTest {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Reader.ParsingException {
|
||||
|
||||
List<GoalTrackingProblem> goalTrackingProblemList = (GoalTrackingProblem.readFromFile(Planner.class.getResourceAsStream("goal_tracking_tests.clj")));
|
||||
|
||||
|
||||
GoalTrackingProblem goalTrackingProblem = goalTrackingProblemList.get(0);
|
||||
|
||||
GoalTracker goalTracker = new GoalTracker(goalTrackingProblem.getPlanningProblem().getBackground(),
|
||||
goalTrackingProblem.getPlanningProblem().getStart(),
|
||||
goalTrackingProblem.getPlanningProblem().getActions());
|
||||
|
||||
|
||||
ColoredPrinter cp = new ColoredPrinter.Builder(1, false).build();
|
||||
|
||||
|
||||
cp.setForegroundColor(Ansi.FColor.WHITE);
|
||||
cp.setBackgroundColor(Ansi.BColor.BLUE); //setting format
|
||||
cp.println("Adding goal G1");
|
||||
cp.clear();
|
||||
|
||||
boolean res1 = goalTracker.adoptGoal(goalTrackingProblem.getGoalNamed("G1"));
|
||||
|
||||
cp.setForegroundColor(Ansi.FColor.WHITE);
|
||||
cp.setBackgroundColor(Ansi.BColor.BLUE); //setting format
|
||||
cp.println("Adding goal G2");
|
||||
cp.clear();
|
||||
|
||||
goalTracker.adoptGoal(goalTrackingProblem.getGoalNamed("G2"));
|
||||
|
||||
cp.setForegroundColor(Ansi.FColor.WHITE);
|
||||
cp.setBackgroundColor(Ansi.BColor.BLUE); //setting format
|
||||
cp.println("Adding goal G3");
|
||||
cp.clear();
|
||||
goalTracker.adoptGoal(goalTrackingProblem.getGoalNamed("G3"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue