예제 #1
0
  public static void main(String args[]) {
    Logger.init(
        new LoggerImp() {
          @Override
          public void log(String s) {
            System.out.println(s);
          }
        });

    DriverOption option = new DriverOption();
    option.fillFromEnvironmentVariables();
    Driver<TransitionInfo> controller =
        Driver.connectToDevice(option, ".*", 13337, TransitionInfo.class);
    if (controller == null) throw new RuntimeException("Cannot initiate driver");

    ExplorerImp explorer = new ExplorerImp(controller);
    if (!explorer.init()) throw new RuntimeException("Cannot initialize teacher");

    CSet<ICommand> initialPalette =
        controller.getCurrentView().getRepresentativePoints(TouchFactory.getInstance());
    TreeLearner foo = new TreeLearner(initialPalette);

    explorer.setGuide(foo);

    Guide<ICommand, Observation> learner = foo; // = new PaletteLearnerImp(teacher);

    Exploring<ICommand, Observation> learning =
        new Exploring<ICommand, Observation>(learner, explorer);
    learning.run();
  }
예제 #2
0
  private static void prepare(Activity defaultActivity) {
    if (skipmode()) return;
    // If this is first execution of application,
    // initialize supervisor
    Logger.init(logger);

    if (supervisor == null) {
      supervisor = new SupervisorImp();
      supervisor.prepare(defaultActivity);
    }
    clearData();
  }
예제 #3
0
 public static void logUnroll(int fid) {
   if (skipmode()) return;
   supervisor.logUnroll(fid);
   Logger.log("UNROLL: " + fid);
 }
예제 #4
0
 public static void logReturn(int fid) {
   if (skipmode()) return;
   supervisor.logReturn(fid);
   Logger.log("RETURN: " + fid);
 }
예제 #5
0
 public static void logCall(int fid) {
   if (skipmode()) return;
   supervisor.logCall(fid);
   Logger.log("CALL: " + fid);
 }
예제 #6
0
 public static void logExit(int fid) {
   if (skipmode()) return;
   supervisor.logExit(fid);
   Logger.log("EXIT: " + fid);
 }
예제 #7
0
 public static void logEnter(int fid) {
   if (skipmode()) return;
   supervisor.logEnter(fid);
   Logger.log("ENTER: " + fid);
 }
예제 #8
0
 public static void start() {
   if (skipmode()) return;
   Logger.log("Supervisor Start");
   supervisor.start();
 }
예제 #9
0
 public static void logStopExit(Activity a) {
   if (skipmode()) return;
   Logger.log("Activity(" + a.toString() + ") is Stoped");
   supervisor.logStopExit(a);
 }