Esempio n. 1
0
  /**
   * Build an object only for pre experiment purposes
   *
   * @param experimentFile
   * @param logPath
   */
  public PreExperiment(String experimentFile, String logPath) {
    logPath = logPath + "/";
    System.out.println("[+] Setting up experiment at " + logPath);

    ElementWrapper root = XMLExperimentParser.loadRoot(experimentFile);

    System.out.println("[+] Creating directories");
    File file = new File(logPath);
    file.mkdirs();

    System.out.println("[+] Copying files");
    IOUtils.copyFile(experimentFile, logPath + "/experiment.xml");
    String mazeFile = root.getChild("universe").getChild("params").getChildText("maze");
    IOUtils.copyFile(mazeFile, logPath + "/maze.xml");

    System.out.println("[+] Saving git status");
    IOUtils.exec("git status", ".");
    System.out.println("[+] Saving current commit");
    IOUtils.exec("git log --pretty=format:'%h' -n 1", ".");
    System.out.println("[+] Saving date");
    IOUtils.exec("date", ".");

    setUniverse(UniverseLoader.getInstance().load(root, logPath));

    // Load tasks and plotters
    beforePlotters =
        PlotterLoader.getInstance().load(root.getChild("beforeExperimentPlotters"), logPath);
    beforeLoggers =
        LoggerLoader.getInstance().load(root.getChild("beforeExperimentLoggers"), logPath);
  }
Esempio n. 2
0
 @Override
 public void plot() {
   String logPath = getLogPath();
   System.out.println("Gathering plots on " + logPath);
   new File(logPath + "/plots/").mkdir();
   IOUtils.exec("find . -iname *.pdf -exec ln {} plots/ ;", logPath);
   IOUtils.exec("find . -iname *.png -exec ln {} plots/ ;", logPath);
 }