- Timestamp:
- 09/02/13 15:11:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs
r9898 r9926 29 29 30 30 namespace 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) { 33 33 if (robotName == null) 34 34 robotName = GenerateRobotName(); … … 43 43 string srcRobotPath = Path.Combine(robotsPath, robotName + ".java"); 44 44 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); 51 46 52 47 ProcessStartInfo javaCompileInfo = new ProcessStartInfo(); … … 81 76 ";" + picocontainerJar + ";" + " BattleRunner Evaluation." + robotName + "* " + path; 82 77 83 if (showUI) 84 evaluateCodeInfo.Arguments += " true"; 78 if (showUI) { 79 evaluateCodeInfo.Arguments += " true " + nrOfRounds; 80 } else { 81 evaluateCodeInfo.Arguments += " false " + nrOfRounds; 82 } 85 83 86 84 evaluateCodeInfo.RedirectStandardOutput = true;
Note: See TracChangeset
for help on using the changeset viewer.