Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/21/13 16:24:41 (11 years ago)
Author:
ascheibe
Message:

#2069 use directory values instead of string values for the robocode path

Location:
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3
Files:
4 edited

Legend:

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

    r9880 r9892  
    5757      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
    5858    }
    59     public ILookupParameter<StringValue> RobocodePathParameter {
    60       get { return (ILookupParameter<StringValue>)Parameters[RobocodePathParamaterName]; }
     59    public ILookupParameter<DirectoryValue> RobocodePathParameter {
     60      get { return (ILookupParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
    6161    }
    6262    #endregion
     
    7272      Parameters.Add(new LookupParameter<Solution>(BestSolutionParameterName, "The best tank program."));
    7373      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection of the algorithm."));
    74       Parameters.Add(new LookupParameter<StringValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
     74      Parameters.Add(new LookupParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
    7575    }
    7676
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs

    r9891 r9892  
    3535
    3636      string interpretedProgram = InterpretProgramTree(tree.Root, robotName);
    37       string formattedPath = path.Replace("/", "\\");
    3837      string battleRunnerPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
    3938
     
    4746      ProcessStartInfo javaCompileInfo = new ProcessStartInfo();
    4847      javaCompileInfo.FileName = "cmd.exe";
    49       javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " +
    50                                   formattedPath + "\\robots\\Evaluation\\" + robotName + ".java";
     48      javaCompileInfo.Arguments = "/C javac -cp " + path + "\\libs\\robocode.jar " +
     49                                  path + "\\robots\\Evaluation\\" + robotName + ".java";
    5150      javaCompileInfo.RedirectStandardOutput = true;
    5251      javaCompileInfo.RedirectStandardError = true;
     
    7473
    7574      evaluateCodeInfo.FileName = "cmd.exe";
    76       evaluateCodeInfo.Arguments = "/C java -classpath " + battleRunnerPath + ";" + formattedPath + "\\libs\\robocode.core-1.8.1.0.jar;" + formattedPath + "\\libs\\robocode.jar;" +
    77                                    formattedPath + "\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation." +
    78                                    robotName + "* " + formattedPath;
     75      evaluateCodeInfo.Arguments = "/C java -classpath " + battleRunnerPath + ";" + path + "\\libs\\robocode.core-1.8.1.0.jar;" + path + "\\libs\\robocode.jar;" +
     76                                   path + "\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation." +
     77                                   robotName + "* " + path;
    7978      if (showUI)
    8079        evaluateCodeInfo.Arguments += " true";
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeEvaluator.cs

    r9881 r9892  
    4444      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[TankProgramParameterName]; }
    4545    }
    46     public ILookupParameter<StringValue> RobocodePathParameter {
    47       get { return (ILookupParameter<StringValue>)Parameters[RobocodePathParamaterName]; }
     46    public ILookupParameter<DirectoryValue> RobocodePathParameter {
     47      get { return (ILookupParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
    4848    }
    4949    #endregion
     
    5757      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The solution quality of the Robocode tank program."));
    5858      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(TankProgramParameterName, "The Robocode tank program to evaluate represented as a symbolic expression tree."));
    59       Parameters.Add(new LookupParameter<StringValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
     59      Parameters.Add(new LookupParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
    6060    }
    6161
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs

    r9880 r9892  
    5555      get { return (IValueParameter<Grammar>)Parameters[TankGrammarParameterName]; }
    5656    }
    57     public IFixedValueParameter<StringValue> RobocodePathParameter {
    58       get { return (IFixedValueParameter<StringValue>)Parameters[RobocodePathParamaterName]; }
     57    public IFixedValueParameter<DirectoryValue> RobocodePathParameter {
     58      get { return (IFixedValueParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
    5959    }
    6060    #endregion
     
    7070    public RobocodeProblem()
    7171      : base(new RobocodeEvaluator(), new RampedHalfAndHalfTreeCreator()) {
     72      DirectoryValue robocodeDir = new DirectoryValue();
     73      robocodeDir.Value = @"C:\robocode";
     74
    7275      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramDepthParameterName, "Maximal depth of the Robocode tank program.", new IntValue(6)));
    7376      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramLengthParameterName, "Maximal length of the tank program.", new IntValue(1000)));
    7477      Parameters.Add(new ValueParameter<Grammar>(TankGrammarParameterName, "Grammar for the tank program.", new Grammar()));
    75       Parameters.Add(new FixedValueParameter<StringValue>(RobocodePathParamaterName, "Path of the Robocode installation.", new StringValue("C:/robocode")));
     78      Parameters.Add(new FixedValueParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation.", robocodeDir));
    7679
    7780      Maximization.Value = true;
Note: See TracChangeset for help on using the changeset viewer.