- Timestamp:
- 06/03/13 15:02:05 (11 years ago)
- Location:
- branches/Robocode/HeuristicLab.Problems.Robocode
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode/HeuristicLab.Problems.Robocode/BestSolutionAnalyzer.cs
r9565 r9570 165 165 //int shots = ShotsParameter.ActualValue.Value; 166 166 //int moves = MovesParameter.ActualValue.Value; 167 var bestSolution = new Solution(bestTree, actualQuality);//, moves, shots);167 var bestSolution = new Solution(bestTree, RobocodePathParameter.ActualValue.Value);//, moves, shots); 168 168 // store the new solution in the best solution parameter 169 169 BestSolutionParameter.ActualValue = bestSolution; -
branches/Robocode/HeuristicLab.Problems.Robocode/Evaluator.cs
r9567 r9570 116 116 117 117 ISymbolicExpressionTree tree = TankProgramParameter.ActualValue; 118 XmlDocument doc = new XmlDocument();118 //XmlDocument doc = new XmlDocument(); 119 119 //doc.Load("../tank.xml"); 120 XmlNode node = doc.FirstChild.Clone();120 XmlNode node = null; 121 121 string path = RobocodePathParameter.ActualValue.Value; 122 122 -
branches/Robocode/HeuristicLab.Problems.Robocode/Solution.cs
r9565 r9570 31 31 } 32 32 33 private double quality;33 private string path; 34 34 [Storable] 35 public double Quality35 public string Path 36 36 { 37 get { return quality; }38 private set { this. quality= value; }37 get { return path; } 38 private set { this.path = value; } 39 39 } 40 40 … … 49 49 } 50 50 51 public Solution(ISymbolicExpressionTree tree, double quality)// int moves, int shots)51 public Solution(ISymbolicExpressionTree tree, string path)// int moves, int shots) 52 52 : base("Solution", "A tank program.") 53 53 { 54 54 this.tree = tree; 55 this. quality = quality;55 this.path = path; 56 56 //this.moves = moves; 57 57 //this.shots = shots; -
branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.cs
r9565 r9570 21 21 public partial class SolutionCodeView : NamedItemView 22 22 { 23 private string Path { get; set; } 24 23 25 public new Solution Content 24 26 { … … 30 32 { 31 33 InitializeComponent(); 34 this.Path = "F:/robocode/"; 32 35 this.programCode.Text = ""; 33 36 } … … 42 45 else 43 46 { 47 this.Path = Content.Path; 44 48 string code = Interpreter.InterpretProgramTree(Content.Tree.Root); 45 49 code = code.Replace("class output extends", "class BestSolution extends"); 46 50 this.programCode.Text = code; 47 File.AppendAllText( "F:/robocode/robots/Evaluation/PreviousBestSolution.java", "\r\n/**********************************************/\r\n" + code);48 File.WriteAllText( "F:/robocode/robots/Evaluation/BestSolution.java", code, System.Text.Encoding.Default);51 File.AppendAllText(Path + "/robots/Evaluation/PreviousBestSolution.java", "\r\n/**********************************************/\r\n" + code); 52 File.WriteAllText(Path + "/robots/Evaluation/BestSolution.java", code, System.Text.Encoding.Default); 49 53 } 50 54 } … … 52 56 private void btnRunInRobocode_Click(object sender, EventArgs e) 53 57 { 58 string formattedPath = Path.Replace("/", "\\"); 54 59 ProcessStartInfo javaCompileInfo = new ProcessStartInfo(); 55 60 javaCompileInfo.FileName = "cmd.exe"; 56 javaCompileInfo.Arguments = "/C javac -cp F:\\robocode\\libs\\robocode.jar F:\\robocode\\robots\\Evaluation\\BestSolution.java";61 javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " + formattedPath + "\\robots\\Evaluation\\BestSolution.java"; 57 62 javaCompileInfo.RedirectStandardOutput = true; 58 63 javaCompileInfo.RedirectStandardError = true; … … 68 73 evaluateCodeInfo.FileName = "cmd.exe"; 69 74 //javaCompileInfo.Arguments = "/C javac -cp C:\\robocode\\libs\\robocode.jar \"" + path + "\\Spaced Up\\output.java\""; 70 evaluateCodeInfo.Arguments = "/C java -classpath F:\\robocode\\libs;F:\\robocode\\libs\\robocode.core-1.8.1.0.jar;F:\\robocode\\libs\\robocode.jar;F:\\robocode\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation.BestSolution*";75 evaluateCodeInfo.Arguments = "/C java -classpath " + formattedPath + "\\libs;" + formattedPath + "\\libs\\robocode.core-1.8.1.0.jar;" + formattedPath + "\\libs\\robocode.jar;" + formattedPath + "\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation.BestSolution*"; 71 76 //Console.WriteLine(javaCompileInfo.Arguments); 72 77 evaluateCodeInfo.RedirectStandardOutput = true;
Note: See TracChangeset
for help on using the changeset viewer.