private String getLogFileName(String agentName) { String filename = agentName + fileDateFormat.format(runStart) + ".log"; File resultDir = experiment.getResultDirectory();  if (resultDir == null) return filename; Trial trial = experiment.getTrials()[currentTrial]; String dirname = resultDir.getAbsolutePath() + File.separatorChar + experiment.getExperimentName() + File.separatorChar + trial.getShortName() + File.separatorChar + "Results-" + fileDateFormat.format(runStart); try { File f = new File(dirname);  if (!f.exists() && !f.mkdirs() && !f.exists()) return filename; } catch (Exception e) { if(log.isErrorEnabled()) { log.error("Couldn't create results directory: ", e); }
private String getLogFileName(String nodeName) { String filename = nodeName + fileDateFormat.format(runStart) + ".log"; String dirname = makeResultDirectory(); if (dirname == null)
  private String getLogFileName(String agentName) {    String filename = agentName + fileDateFormat.format(runStart) + ".log";    File resultDir = experiment.getResultDirectory();    // if user didn't specify results directory, save in local directory    if (resultDir == null)      return filename;     Trial trial = experiment.getTrials()[currentTrial];    String dirname = resultDir.getAbsolutePath() + File.separatorChar +       experiment.getExperimentName() + File.separatorChar +      trial.getShortName() + File.separatorChar +      "Results-" + fileDateFormat.format(runStart);    try {      File f = new File(dirname);      // guarantee that directories exist      if (!f.exists() && !f.mkdirs() && !f.exists()) 	return filename;    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Couldn't create results directory: ", e);      }      return filename;    }    return dirname + File.separatorChar + filename;  }