Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/02/13 15:11:53 (11 years ago)
Author:
ascheibe
Message:

#2069

  • renamed path parameter to robocode path
  • made number of rounds configurable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs

    r9898 r9926  
    2929
    3030namespace HeuristicLab.Problems.Robocode {
    31   public class Interpreter {
    32     public static double EvaluateTankProgram(ISymbolicExpressionTree tree, string path, string robotName = null, bool showUI = false) {
     31  public static class Interpreter {
     32    public static double EvaluateTankProgram(ISymbolicExpressionTree tree, string path, string robotName = null, bool showUI = false, int nrOfRounds = 3) {
    3333      if (robotName == null)
    3434        robotName = GenerateRobotName();
     
    4343      string srcRobotPath = Path.Combine(robotsPath, robotName + ".java");
    4444
    45       try {
    46         File.WriteAllText(srcRobotPath, interpretedProgram, System.Text.Encoding.Default);
    47       }
    48       catch (Exception ex) {
    49         throw;
    50       }
     45      File.WriteAllText(srcRobotPath, interpretedProgram, System.Text.Encoding.Default);
    5146
    5247      ProcessStartInfo javaCompileInfo = new ProcessStartInfo();
     
    8176                                  ";" + picocontainerJar + ";" + " BattleRunner Evaluation." + robotName + "* " + path;
    8277
    83       if (showUI)
    84         evaluateCodeInfo.Arguments += " true";
     78      if (showUI) {
     79        evaluateCodeInfo.Arguments += " true " + nrOfRounds;
     80      } else {
     81        evaluateCodeInfo.Arguments += " false " + nrOfRounds;
     82      }
    8583
    8684      evaluateCodeInfo.RedirectStandardOutput = true;
Note: See TracChangeset for help on using the changeset viewer.