void writeSampler() {

    List<String[]> samplingParams = theSampler.getSamplerParameterList();

    logFile.write("<Sampler>");
    logFile.writeParametersXML(samplingParams, 1);
    logFile.write("</Sampler>");
  }
  void writeGeneral() {

    List<String[]> simParams = new ArrayList<String[]>();
    if (seed > 0) {
      simParams.add(new String[] {"Seed", "" + seed});
    }
    simParams.add(new String[] {"Path", simpath});
    simParams.add(new String[] {"Rootname", simname});
    simParams.add(new String[] {"Nreps", "" + nreps});
    simParams.add(new String[] {"Tauleap", "" + tauleap});

    logFile.write("<General>");
    logFile.writeParametersXML(simParams, 1);
    logFile.write("</General>");
  }
Example #3
0
 @SuppressWarnings("deprecation")
 public SpecialLogger(MetaPlugin plugin, String folderName) {
   this.plugin = plugin;
   this.folderName = folderName;
   dayNumber = Calendar.getInstance().get(Calendar.DATE);
   file =
       new File(
           Main.getLogFolderName()
               + File.separator
               + plugin.getPluginName()
               + File.separator
               + (folderName.isEmpty() ? "" : (folderName + File.separator))
               + new StringBuilder()
                   .append(Calendar.getInstance().get(Calendar.YEAR))
                   .append(".")
                   .append(Calendar.getInstance().get(Calendar.MONTH) + 1)
                   .append(".")
                   .append(Calendar.getInstance().get(Calendar.DATE))
                   .append(":")
                   .append(Calendar.getInstance().get(Calendar.HOUR_OF_DAY))
                   .append(".")
                   .append(Calendar.getInstance().get(Calendar.MINUTE))
                   .append(".")
                   .append(Calendar.getInstance().get(Calendar.SECOND))
               + ".log");
   file.getParentFile().mkdirs();
   try {
     file.createNewFile();
   } catch (IOException e) {
     Logger.write("Core", Level.WARN, "Couldn't create Log File!");
   }
 }
  void closeFile() {
    logFile.write("</DSPS>");
    logFile.closeFile();

    System.out.println(
        "Finished writing parameters to " + logFile.path + logFile.name + logFile.ext);
  }
  void openFile() {
    logFile = new Logger();
    logFile.setEchoEvery(0);
    logFile.setPath(path);
    logFile.setName(rootname + "_params");
    logFile.setExt(".xml");
    logFile.openFile();
    logFile.write("<DSPS>");

    System.out.println("Writing xml parameters to " + logFile.path + logFile.name + logFile.ext);
  }
  void writePopulationStructure() {

    List<String[]> populationParams = new ArrayList<String[]>();
    populationParams.add(new String[] {"NumberOfDemes", "" + numberOfDemes});
    populationParams.add(new String[] {"NetworkType", popType.toString()});
    populationParams.add(new String[] {"Directed", dirType});

    if (popType.equals(PopulationType.RANDOM)) {
      populationParams.add(new String[] {"ProbabilityConnect", "" + probConnect});
    }

    populationParams.add(new String[] {"ModelType", modelType.toString()});
    populationParams.add(infectionParams);
    populationParams.add(new String[] {"DemeType", demeType});
    populationParams.add(new String[] {"NumberOfHostsPerDeme", "" + hostsInDeme});
    populationParams.add(new String[] {"ProbabilityInfectionAnyOtherDeme", "" + pinfectother});

    populationParams.add(new String[] {"ReportSummary", reportSummary});

    logFile.write("<PopulationStructure>");
    logFile.writeParametersXML(populationParams, 1);
    logFile.write("</PopulationStructure>");
  }