- Timestamp:
- 07/26/13 15:13:05 (11 years ago)
- Location:
- branches/Robocode.TrunkInt
- Files:
-
- 77 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/CodeNodeView.cs
r9781 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Windows.Forms; 3 24 using HeuristicLab.Core.Views; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/Plugin.cs.frame
r9787 r9790 29 29 namespace HeuristicLab.Problems.Robocode.Views 30 30 { 31 [Plugin("HeuristicLab.Problems.Robocode.Views", "The Robocode problem for genetic programming.", "3.3. 7.$WCREV$")]31 [Plugin("HeuristicLab.Problems.Robocode.Views", "The Robocode problem for genetic programming.", "3.3.8.$WCREV$")] 32 32 [PluginFile("HeuristicLab.Problems.Robocode.Views-3.3.dll", PluginFileType.Assembly)] 33 33 [PluginDependency("HeuristicLab.Data", "3.3")] -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionCodeView.cs
r9781 r9790 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 23 using System.Diagnostics; 24 using System.IO; 9 25 using System.Windows.Forms; 10 26 using HeuristicLab.Core.Views; 11 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;12 27 using HeuristicLab.MainForm; 13 using System.Diagnostics;14 using System.IO;15 28 16 29 17 namespace HeuristicLab.Problems.Robocode 18 { 19 [View("Robocode Tank Code View")] 20 [Content(typeof(Solution), IsDefaultView = true)] 21 public partial class SolutionCodeView : NamedItemView 22 { 23 private string Path { get; set; } 30 namespace HeuristicLab.Problems.Robocode { 31 [View("Robocode Tank Code View")] 32 [Content(typeof(Solution), IsDefaultView = true)] 33 public partial class SolutionCodeView : NamedItemView { 34 private string Path { get; set; } 24 35 25 public new Solution Content 26 { 27 get { return (Solution)base.Content; } 28 set { base.Content = value; } 29 } 36 public new Solution Content { 37 get { return (Solution)base.Content; } 38 set { base.Content = value; } 39 } 30 40 31 public SolutionCodeView() : base()32 33 34 35 36 41 public SolutionCodeView() 42 : base() { 43 InitializeComponent(); 44 this.Path = "F:/robocode/"; 45 this.programCode.Text = ""; 46 } 37 47 38 protected override void OnContentChanged() 39 { 40 base.OnContentChanged(); 41 if (Content == null) 42 { 43 this.programCode.Text = ""; 44 } 45 else 46 { 47 this.Path = Content.Path; 48 string code = Interpreter.InterpretProgramTree(Content.Tree.Root); 49 code = code.Replace("class output extends", "class BestSolution extends"); 50 this.programCode.Text = code; 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); 53 } 54 } 48 protected override void OnContentChanged() { 49 base.OnContentChanged(); 50 if (Content == null) { 51 this.programCode.Text = ""; 52 } else { 53 this.Path = Content.Path; 54 string code = Interpreter.InterpretProgramTree(Content.Tree.Root); 55 code = code.Replace("class output extends", "class BestSolution extends"); 56 this.programCode.Text = code; 57 File.AppendAllText(Path + "/robots/Evaluation/PreviousBestSolution.java", "\r\n/**********************************************/\r\n" + code); 58 File.WriteAllText(Path + "/robots/Evaluation/BestSolution.java", code, System.Text.Encoding.Default); 59 } 60 } 55 61 56 private void btnRunInRobocode_Click(object sender, EventArgs e) 57 { 58 string formattedPath = Path.Replace("/", "\\"); 59 ProcessStartInfo javaCompileInfo = new ProcessStartInfo(); 60 javaCompileInfo.FileName = "cmd.exe"; 61 javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " + formattedPath + "\\robots\\Evaluation\\BestSolution.java"; 62 javaCompileInfo.RedirectStandardOutput = true; 63 javaCompileInfo.RedirectStandardError = true; 64 javaCompileInfo.UseShellExecute = false; 65 javaCompileInfo.CreateNoWindow = true; 62 private void btnRunInRobocode_Click(object sender, EventArgs e) { 63 string formattedPath = Path.Replace("/", "\\"); 64 ProcessStartInfo javaCompileInfo = new ProcessStartInfo(); 65 javaCompileInfo.FileName = "cmd.exe"; 66 javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " + formattedPath + "\\robots\\Evaluation\\BestSolution.java"; 67 javaCompileInfo.RedirectStandardOutput = true; 68 javaCompileInfo.RedirectStandardError = true; 69 javaCompileInfo.UseShellExecute = false; 70 javaCompileInfo.CreateNoWindow = true; 66 71 67 68 69 70 72 Process javaCompile = new Process(); 73 javaCompile.StartInfo = javaCompileInfo; 74 javaCompile.Start(); 75 javaCompile.WaitForExit(); 71 76 72 73 74 75 76 77 78 79 77 ProcessStartInfo evaluateCodeInfo = new ProcessStartInfo(); 78 evaluateCodeInfo.FileName = "cmd.exe"; 79 //javaCompileInfo.Arguments = "/C javac -cp C:\\robocode\\libs\\robocode.jar \"" + path + "\\Spaced Up\\output.java\""; 80 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*"; 81 //Console.WriteLine(javaCompileInfo.Arguments); 82 evaluateCodeInfo.RedirectStandardOutput = true; 83 evaluateCodeInfo.RedirectStandardError = true; 84 evaluateCodeInfo.UseShellExecute = false; 80 85 81 Process evaluateCode = new Process(); 82 evaluateCode.StartInfo = evaluateCodeInfo; 83 evaluateCode.Start(); 84 evaluateCode.WaitForExit(); 85 } 86 Process evaluateCode = new Process(); 87 evaluateCode.StartInfo = evaluateCodeInfo; 88 evaluateCode.Start(); 89 evaluateCode.WaitForExit(); 86 90 } 91 } 87 92 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionProgramView.Designer.cs
r9781 r9790 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System.Windows.Forms; 23 using HeuristicLab.Core.Views;24 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 25 using HeuristicLab.MainForm;26 24 27 25 namespace HeuristicLab.Problems.Robocode { -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionProgramView.cs
r9781 r9790 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/BestSolutionAnalyzer.cs
r9781 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Core; 3 25 using HeuristicLab.Data; … … 8 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 31 10 namespace HeuristicLab.Problems.Robocode 11 { 12 [StorableClass] 13 [Item("Best Tank program Analyzer", 14 "Analyzer that stores the best tank program.")] 15 public class BestSolutionAnalyzer : SingleSuccessorOperator, 16 ISymbolicExpressionTreeAnalyzer 17 { 18 #region parameter names 19 private const string QualityParameterName = "Quality"; 20 private const string SymbolicExpressionTreeParameterName = 21 "TankProgram"; 22 private const string MovesParameterName = "Moves"; 23 private const string ShotsParameterName = "Shots"; 24 private const string BestSolutionParameterName = "Best solution"; 25 private const string ResultsParameterName = "Results"; 26 private const string RobocodePathParamaterName = "Path"; 27 private const string CoevolutionParameterName = "Coevolution"; 28 #endregion 29 30 31 #region parameters 32 public IScopeTreeLookupParameter<DoubleValue> QualityParameter 33 { 34 get 35 { 36 return (IScopeTreeLookupParameter<DoubleValue>) 37 Parameters[QualityParameterName]; 38 } 32 namespace HeuristicLab.Problems.Robocode { 33 [StorableClass] 34 [Item("Best Tank program Analyzer", 35 "Analyzer that stores the best tank program.")] 36 public class BestSolutionAnalyzer : SingleSuccessorOperator, 37 ISymbolicExpressionTreeAnalyzer { 38 #region parameter names 39 private const string QualityParameterName = "Quality"; 40 private const string SymbolicExpressionTreeParameterName = 41 "TankProgram"; 42 private const string MovesParameterName = "Moves"; 43 private const string ShotsParameterName = "Shots"; 44 private const string BestSolutionParameterName = "Best solution"; 45 private const string ResultsParameterName = "Results"; 46 private const string RobocodePathParamaterName = "Path"; 47 private const string CoevolutionParameterName = "Coevolution"; 48 #endregion 49 50 51 #region parameters 52 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 53 get { 54 return (IScopeTreeLookupParameter<DoubleValue>) 55 Parameters[QualityParameterName]; 56 } 57 } 58 public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 59 get { 60 return (IScopeTreeLookupParameter<ISymbolicExpressionTree>) 61 Parameters[SymbolicExpressionTreeParameterName]; 62 } 63 } 64 //public ILookupParameter<IntValue> MovesParameter 65 //{ 66 // get 67 // { 68 // return (ILookupParameter<IntValue>) 69 // Parameters[MovesParameterName]; 70 // } 71 //} 72 //public ILookupParameter<IntValue> ShotsParameter 73 //{ 74 // get 75 // { 76 // return (ILookupParameter<IntValue>) 77 // Parameters[ShotsParameterName]; 78 // } 79 //} 80 public ILookupParameter<Solution> BestSolutionParameter { 81 get { 82 return (ILookupParameter<Solution>) 83 Parameters[BestSolutionParameterName]; 84 } 85 } 86 public ILookupParameter<ResultCollection> ResultParameter { 87 get { 88 return (ILookupParameter<ResultCollection>) 89 Parameters[ResultsParameterName]; 90 } 91 } 92 public ILookupParameter<StringValue> RobocodePathParameter { 93 get { 94 return (ILookupParameter<StringValue>) 95 Parameters[RobocodePathParamaterName]; 96 } 97 } 98 public ILookupParameter<BoolValue> CoevolutionParameter { 99 get { 100 return (ILookupParameter<BoolValue>) 101 Parameters[CoevolutionParameterName]; 102 } 103 } 104 #endregion 105 106 [StorableConstructor] 107 protected BestSolutionAnalyzer(bool deserializing) : base(deserializing) { } 108 protected BestSolutionAnalyzer(BestSolutionAnalyzer original, 109 Cloner cloner) 110 : base(original, cloner) { 111 } 112 113 public BestSolutionAnalyzer() { 114 Parameters.Add( 115 new ScopeTreeLookupParameter<DoubleValue>( 116 QualityParameterName, 117 "The solution quality of the tank program.")); 118 Parameters.Add( 119 new ScopeTreeLookupParameter<ISymbolicExpressionTree>( 120 SymbolicExpressionTreeParameterName, 121 "The tank program to evaluate represented " + 122 "as symbolic expression tree.")); 123 Parameters.Add( 124 new LookupParameter<Solution>( 125 BestSolutionParameterName, "The best tank program.")); 126 //Parameters.Add( 127 // new LookupParameter<IntValue>( 128 // MovesParameterName, "The number of moves made.")); 129 //Parameters.Add( 130 // new LookupParameter<IntValue>( 131 // ShotsParameterName, "The shots made.")); 132 Parameters.Add( 133 new LookupParameter<ResultCollection>( 134 ResultsParameterName, "The result collection of the algorithm.")); 135 Parameters.Add( 136 new LookupParameter<StringValue>( 137 RobocodePathParamaterName, 138 "Path of the Robocode installation.")); 139 Parameters.Add( 140 new LookupParameter<BoolValue>( 141 CoevolutionParameterName, 142 "Use Coevolution")); 143 } 144 145 public override IOperation Apply() { 146 // get an array of all trees 147 // and an array of all qualities 148 var trees = SymbolicExpressionTreeParameter.ActualValue; 149 var qualities = QualityParameter.ActualValue; 150 151 // find the tree with the best quality 152 double maxQuality = double.NegativeInfinity; 153 ISymbolicExpressionTree bestTree = null; 154 for (int i = 0; i < qualities.Length; i++) { 155 if (qualities[i].Value > maxQuality) { 156 maxQuality = qualities[i].Value; 157 bestTree = trees[i]; 39 158 } 40 public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter 41 { 42 get 43 { 44 return (IScopeTreeLookupParameter<ISymbolicExpressionTree>) 45 Parameters[SymbolicExpressionTreeParameterName]; 46 } 159 } 160 161 var coevolution = CoevolutionParameter.ActualValue.Value; 162 double actualQuality = 0; 163 164 if (coevolution) 165 actualQuality = Interpreter.EvaluateTankProgram(bestTree, null, RobocodePathParameter.ActualValue.Value); 166 167 // create a solution instance 168 //int shots = ShotsParameter.ActualValue.Value; 169 //int moves = MovesParameter.ActualValue.Value; 170 var bestSolution = new Solution(bestTree, RobocodePathParameter.ActualValue.Value);//, moves, shots); 171 // store the new solution in the best solution parameter 172 BestSolutionParameter.ActualValue = bestSolution; 173 174 // also add the best solution as a result to the result collection 175 // or alternatively update the existing result 176 var resultCollection = ResultParameter.ActualValue; 177 if (!resultCollection.ContainsKey(BestSolutionParameterName)) { 178 resultCollection.Add( 179 new Result(BestSolutionParameterName, 180 "The best tank program", bestSolution)); 181 //if(coevolution) 182 // resultCollection.Add( 183 // new Result("Actual Quality", 184 // "The actual quality of the best program", new DoubleValue(actualQuality))); 185 } else { 186 resultCollection[BestSolutionParameterName].Value = bestSolution; 187 } 188 189 if (coevolution) { 190 if (!resultCollection.ContainsKey("Actual Quality")) { 191 resultCollection.Add( 192 new Result("Actual Quality", 193 "The actual quality of the best program", new DoubleValue(actualQuality))); 194 } else { 195 resultCollection["Actual Quality"].Value = new DoubleValue(actualQuality); 47 196 } 48 //public ILookupParameter<IntValue> MovesParameter 49 //{ 50 // get 51 // { 52 // return (ILookupParameter<IntValue>) 53 // Parameters[MovesParameterName]; 54 // } 55 //} 56 //public ILookupParameter<IntValue> ShotsParameter 57 //{ 58 // get 59 // { 60 // return (ILookupParameter<IntValue>) 61 // Parameters[ShotsParameterName]; 62 // } 63 //} 64 public ILookupParameter<Solution> BestSolutionParameter 65 { 66 get 67 { 68 return (ILookupParameter<Solution>) 69 Parameters[BestSolutionParameterName]; 70 } 71 } 72 public ILookupParameter<ResultCollection> ResultParameter 73 { 74 get 75 { 76 return (ILookupParameter<ResultCollection>) 77 Parameters[ResultsParameterName]; 78 } 79 } 80 public ILookupParameter<StringValue> RobocodePathParameter 81 { 82 get 83 { 84 return (ILookupParameter<StringValue>) 85 Parameters[RobocodePathParamaterName]; 86 } 87 } 88 public ILookupParameter<BoolValue> CoevolutionParameter 89 { 90 get 91 { 92 return (ILookupParameter<BoolValue>) 93 Parameters[CoevolutionParameterName]; 94 } 95 } 96 #endregion 97 98 [StorableConstructor] 99 protected BestSolutionAnalyzer(bool deserializing) : base(deserializing) { } 100 protected BestSolutionAnalyzer(BestSolutionAnalyzer original, 101 Cloner cloner) 102 : base(original, cloner) 103 { 104 } 105 106 public BestSolutionAnalyzer() 107 { 108 Parameters.Add( 109 new ScopeTreeLookupParameter<DoubleValue>( 110 QualityParameterName, 111 "The solution quality of the tank program.")); 112 Parameters.Add( 113 new ScopeTreeLookupParameter<ISymbolicExpressionTree>( 114 SymbolicExpressionTreeParameterName, 115 "The tank program to evaluate represented " + 116 "as symbolic expression tree.")); 117 Parameters.Add( 118 new LookupParameter<Solution>( 119 BestSolutionParameterName, "The best tank program.")); 120 //Parameters.Add( 121 // new LookupParameter<IntValue>( 122 // MovesParameterName, "The number of moves made.")); 123 //Parameters.Add( 124 // new LookupParameter<IntValue>( 125 // ShotsParameterName, "The shots made.")); 126 Parameters.Add( 127 new LookupParameter<ResultCollection>( 128 ResultsParameterName, "The result collection of the algorithm.")); 129 Parameters.Add( 130 new LookupParameter<StringValue>( 131 RobocodePathParamaterName, 132 "Path of the Robocode installation.")); 133 Parameters.Add( 134 new LookupParameter<BoolValue>( 135 CoevolutionParameterName, 136 "Use Coevolution")); 137 } 138 139 public override IOperation Apply() 140 { 141 // get an array of all trees 142 // and an array of all qualities 143 var trees = SymbolicExpressionTreeParameter.ActualValue; 144 var qualities = QualityParameter.ActualValue; 145 146 // find the tree with the best quality 147 double maxQuality = double.NegativeInfinity; 148 ISymbolicExpressionTree bestTree = null; 149 for (int i = 0; i < qualities.Length; i++) 150 { 151 if (qualities[i].Value > maxQuality) 152 { 153 maxQuality = qualities[i].Value; 154 bestTree = trees[i]; 155 } 156 } 157 158 var coevolution = CoevolutionParameter.ActualValue.Value; 159 double actualQuality = 0; 160 161 if (coevolution) 162 actualQuality = Interpreter.EvaluateTankProgram(bestTree, null, RobocodePathParameter.ActualValue.Value); 163 164 // create a solution instance 165 //int shots = ShotsParameter.ActualValue.Value; 166 //int moves = MovesParameter.ActualValue.Value; 167 var bestSolution = new Solution(bestTree, RobocodePathParameter.ActualValue.Value);//, moves, shots); 168 // store the new solution in the best solution parameter 169 BestSolutionParameter.ActualValue = bestSolution; 170 171 // also add the best solution as a result to the result collection 172 // or alternatively update the existing result 173 var resultCollection = ResultParameter.ActualValue; 174 if (!resultCollection.ContainsKey(BestSolutionParameterName)) 175 { 176 resultCollection.Add( 177 new Result(BestSolutionParameterName, 178 "The best tank program", bestSolution)); 179 //if(coevolution) 180 // resultCollection.Add( 181 // new Result("Actual Quality", 182 // "The actual quality of the best program", new DoubleValue(actualQuality))); 183 } 184 else 185 { 186 resultCollection[BestSolutionParameterName].Value = bestSolution; 187 } 188 189 if (coevolution) 190 { 191 if (!resultCollection.ContainsKey("Actual Quality")) 192 { 193 resultCollection.Add( 194 new Result("Actual Quality", 195 "The actual quality of the best program", new DoubleValue(actualQuality))); 196 } 197 else 198 { 199 resultCollection["Actual Quality"].Value = new DoubleValue(actualQuality); 200 } 201 } 202 203 // important return base.Apply() to make sure the 204 // next operator is queued for execution 205 return base.Apply(); 206 } 207 208 public override IDeepCloneable Clone(Cloner cloner) 209 { 210 return new BestSolutionAnalyzer(this, cloner); 211 } 212 213 // override this property to indicate that this analyzer 214 // should be enabled by default in the algorithm 215 public bool EnabledByDefault 216 { 217 get { return true; } 218 } 219 } 197 } 198 199 // important return base.Apply() to make sure the 200 // next operator is queued for execution 201 return base.Apply(); 202 } 203 204 public override IDeepCloneable Clone(Cloner cloner) { 205 return new BestSolutionAnalyzer(this, cloner); 206 } 207 208 // override this property to indicate that this analyzer 209 // should be enabled by default in the algorithm 210 public bool EnabledByDefault { 211 get { return true; } 212 } 213 } 220 214 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Crossover/RobocodeCrossover.cs
r9565 r9790 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 29 using HeuristicLab.Parameters; 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;31 31 32 32 namespace HeuristicLab.Problems.Robocode { -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Crossover/RobocodeMethodCrossover.cs
r9565 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Collections.Generic; 3 23 using System.Linq; … … 5 25 using HeuristicLab.Core; 6 26 using HeuristicLab.Data; 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 7 28 using HeuristicLab.Parameters; 8 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 10 11 namespace HeuristicLab.Problems.Robocode 12 { 13 /// <summary> 14 /// Takes two parent individuals P0 and P1 each. Selects a random node N0 of P0 and a random node N1 of P1. 15 /// And replaces the branch with root0 N0 in P0 with N1 from P1 if the tree-size limits are not violated. 16 /// When recombination with N0 and N1 would create a tree that is too large or invalid the operator randomly selects new N0 and N1 17 /// until a valid configuration is found. 18 /// </summary> 19 [Item("RobocodeMethodCrossover", "An operator which performs crossover of randomly chosen statements with a method.")] 20 [StorableClass] 21 public class RobocodeMethodCrossover : SymbolicExpressionTreeCrossover//, ISymbolicExpressionTreeSizeConstraintOperator 30 31 namespace HeuristicLab.Problems.Robocode { 32 /// <summary> 33 /// Takes two parent individuals P0 and P1 each. Selects a random node N0 of P0 and a random node N1 of P1. 34 /// And replaces the branch with root0 N0 in P0 with N1 from P1 if the tree-size limits are not violated. 35 /// When recombination with N0 and N1 would create a tree that is too large or invalid the operator randomly selects new N0 and N1 36 /// until a valid configuration is found. 37 /// </summary> 38 [Item("RobocodeMethodCrossover", "An operator which performs crossover of randomly chosen statements with a method.")] 39 [StorableClass] 40 public class RobocodeMethodCrossover : SymbolicExpressionTreeCrossover//, ISymbolicExpressionTreeSizeConstraintOperator 41 { 42 43 #region Parameter Names 44 45 private const string HomologousCrossoverPrameterName = "HomologousCrossover"; 46 private const string MaximumCrossoverMethodsParameterName = "MaximumCrossoverMethods"; 47 48 #endregion 49 50 #region Parameter Properties 51 52 public IValueLookupParameter<BoolValue> HomologousCrossoverParameter { 53 get { return (IValueLookupParameter<BoolValue>)Parameters[HomologousCrossoverPrameterName]; } 54 } 55 56 public IValueLookupParameter<IntValue> MaximumCrossoverMethodsParameter { 57 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumCrossoverMethodsParameterName]; } 58 } 59 #endregion 60 61 #region Properties 62 63 public BoolValue HomologousCrossover { 64 get { return HomologousCrossoverParameter.ActualValue; } 65 } 66 67 public IntValue MaximumCrossoverMethods { 68 get { return MaximumCrossoverMethodsParameter.ActualValue; } 69 } 70 71 #endregion 72 73 [StorableConstructor] 74 protected RobocodeMethodCrossover(bool deserializing) : base(deserializing) { } 75 protected RobocodeMethodCrossover(RobocodeMethodCrossover original, Cloner cloner) : 76 base(original, cloner) { } 77 public RobocodeMethodCrossover() 78 : base() { 79 Parameters.Add(new ValueLookupParameter<BoolValue>(HomologousCrossoverPrameterName, 80 "Specifies if the number of statements exchanged between the two parents is the same.", new BoolValue(false))); 81 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumCrossoverMethodsParameterName, 82 "The maximal methods to apply crossover on (0 or a number higher than the count of " + 83 "methods means applying crossover to them all).", new IntValue(0))); 84 } 85 86 public override IDeepCloneable Clone(Cloner cloner) { 87 return new RobocodeMethodCrossover(this, cloner); 88 } 89 90 public override ISymbolicExpressionTree Crossover(IRandom random, 91 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) { 92 return Cross(random, parent0, parent1, HomologousCrossover.Value, 93 MaximumCrossoverMethods.Value); 94 } 95 96 public static ISymbolicExpressionTree Cross(IRandom random, 97 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, 98 bool homologous, int maximumCrossoverMethods) { 99 // select a random crossover point in the first parent 100 List<CutPoint> crossoverPoints0; 101 SelectCrossoverPoint(random, parent0, maximumCrossoverMethods, out crossoverPoints0); 102 103 foreach (CutPoint c in crossoverPoints0) { 104 List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>(); 105 parent1.Root.ForEachNodePostfix((n) => { 106 if (n.Symbol.GetType() == c.Child.Symbol.GetType()) 107 allowedBranches.Add(n); 108 }); 109 110 if (allowedBranches.Count == 0) { 111 break; 112 } else { 113 ISymbolicExpressionTreeNode branch = allowedBranches.FirstOrDefault(); 114 int startBranchParent0 = (c.Child.SubtreeCount <= 2) ? 0 : random.Next(0, c.Child.SubtreeCount - 2); 115 int endBranchParent0 = (c.Child.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent0 + 1, c.Child.SubtreeCount - 1); 116 int Parent0Branches = endBranchParent0 - startBranchParent0; 117 118 for (int i = 0; i < Parent0Branches; i++) { 119 c.Child.RemoveSubtree(startBranchParent0); 120 } 121 122 if (homologous) { 123 for (int j = startBranchParent0; j <= endBranchParent0; j++) { 124 c.Child.AddSubtree(branch.GetSubtree(j)); 125 } 126 } else { 127 int startBranchParent1 = (branch.SubtreeCount <= 2) ? 0 : random.Next(0, branch.SubtreeCount - 2); 128 int endBranchParent1 = (branch.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent1 + 1, branch.SubtreeCount - 1); 129 int Parent1Branches = endBranchParent1 - startBranchParent1; 130 131 for (int j = startBranchParent1; j <= endBranchParent1 && c.Child.SubtreeCount < c.Child.Symbol.MaximumArity; j++) { 132 c.Child.AddSubtree(branch.GetSubtree(j)); 133 } 134 } 135 } 136 } 137 138 return parent0; 139 } 140 141 private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0, 142 int maximumCrossoverMethods, out List<CutPoint> crossoverPoints) { 143 List<CutPoint> MethodPoints = new List<CutPoint>(); 144 parent0.Root.ForEachNodePostfix((n) => { 145 if (n.SubtreeCount > 0 && n != parent0.Root) { 146 foreach (var child in n.Subtrees) { 147 if (child.Symbol is Run || 148 child.Symbol is OnBulletHit || 149 child.Symbol is OnBulletMissed || 150 child.Symbol is OnHitByBullet || 151 child.Symbol is OnHitRobot || 152 child.Symbol is OnHitWall || 153 child.Symbol is OnScannedRobot) 154 MethodPoints.Add(new CutPoint(n, child)); 155 } 156 } 157 }); 158 159 if (maximumCrossoverMethods == 0) 160 crossoverPoints = MethodPoints; 161 else { 162 crossoverPoints = new List<CutPoint>(); 163 for (int i = 0; i < maximumCrossoverMethods; i++) { 164 CutPoint c = MethodPoints.SelectRandom(random); 165 crossoverPoints.Add(c); 166 MethodPoints.Remove(c); 167 if (MethodPoints.Count == 0) break; 168 } 169 } 170 } 171 172 /*private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability) 22 173 { 23 24 #region Parameter Names 25 26 private const string HomologousCrossoverPrameterName = "HomologousCrossover"; 27 private const string MaximumCrossoverMethodsParameterName = "MaximumCrossoverMethods"; 28 29 #endregion 30 31 #region Parameter Properties 32 33 public IValueLookupParameter<BoolValue> HomologousCrossoverParameter 174 if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability"); 175 List<ISymbolicExpressionTreeNode> allowedInternalBranches; 176 List<ISymbolicExpressionTreeNode> allowedLeafBranches; 177 if (random.NextDouble() < internalNodeProbability) 34 178 { 35 get { return (IValueLookupParameter<BoolValue>)Parameters[HomologousCrossoverPrameterName]; } 36 } 37 38 public IValueLookupParameter<IntValue> MaximumCrossoverMethodsParameter 179 // select internal node if possible 180 allowedInternalBranches = (from branch in branches 181 where branch != null && branch.SubtreeCount > 0 182 select branch).ToList(); 183 if (allowedInternalBranches.Count > 0) 184 { 185 return allowedInternalBranches.SelectRandom(random); 186 } 187 else 188 { 189 // no internal nodes allowed => select leaf nodes 190 allowedLeafBranches = (from branch in branches 191 where branch == null || branch.SubtreeCount == 0 192 select branch).ToList(); 193 return allowedLeafBranches.SelectRandom(random); 194 } 195 } 196 else 39 197 { 40 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumCrossoverMethodsParameterName]; } 41 } 42 #endregion 43 44 #region Properties 45 46 public BoolValue HomologousCrossover 47 { 48 get { return HomologousCrossoverParameter.ActualValue; } 49 } 50 51 public IntValue MaximumCrossoverMethods 52 { 53 get { return MaximumCrossoverMethodsParameter.ActualValue; } 54 } 55 56 #endregion 57 58 [StorableConstructor] 59 protected RobocodeMethodCrossover(bool deserializing) : base(deserializing) { } 60 protected RobocodeMethodCrossover(RobocodeMethodCrossover original, Cloner cloner) : 61 base(original, cloner) { } 62 public RobocodeMethodCrossover() 63 : base() 64 { 65 Parameters.Add(new ValueLookupParameter<BoolValue>(HomologousCrossoverPrameterName, 66 "Specifies if the number of statements exchanged between the two parents is the same.", new BoolValue(false))); 67 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumCrossoverMethodsParameterName, 68 "The maximal methods to apply crossover on (0 or a number higher than the count of " + 69 "methods means applying crossover to them all).", new IntValue(0))); 70 } 71 72 public override IDeepCloneable Clone(Cloner cloner) 73 { 74 return new RobocodeMethodCrossover(this, cloner); 75 } 76 77 public override ISymbolicExpressionTree Crossover(IRandom random, 78 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) 79 { 80 return Cross(random, parent0, parent1, HomologousCrossover.Value, 81 MaximumCrossoverMethods.Value); 82 } 83 84 public static ISymbolicExpressionTree Cross(IRandom random, 85 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, 86 bool homologous, int maximumCrossoverMethods) 87 { 88 // select a random crossover point in the first parent 89 List<CutPoint> crossoverPoints0; 90 SelectCrossoverPoint(random, parent0, maximumCrossoverMethods, out crossoverPoints0); 91 92 foreach (CutPoint c in crossoverPoints0) 93 { 94 List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>(); 95 parent1.Root.ForEachNodePostfix((n) => 96 { 97 if (n.Symbol.GetType() == c.Child.Symbol.GetType()) 98 allowedBranches.Add(n); 99 }); 100 101 if (allowedBranches.Count == 0) 102 { 103 break; 104 } 105 else 106 { 107 ISymbolicExpressionTreeNode branch = allowedBranches.FirstOrDefault(); 108 int startBranchParent0 = (c.Child.SubtreeCount <= 2)? 0 : random.Next(0, c.Child.SubtreeCount - 2); 109 int endBranchParent0 = (c.Child.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent0 + 1, c.Child.SubtreeCount - 1); 110 int Parent0Branches = endBranchParent0 - startBranchParent0; 111 112 for (int i = 0; i < Parent0Branches; i++) 113 { 114 c.Child.RemoveSubtree(startBranchParent0); 115 } 116 117 if (homologous) 118 { 119 for (int j = startBranchParent0; j <= endBranchParent0; j++) 120 { 121 c.Child.AddSubtree(branch.GetSubtree(j)); 122 } 123 } 124 else 125 { 126 int startBranchParent1 = (branch.SubtreeCount <= 2) ? 0 : random.Next(0, branch.SubtreeCount - 2); 127 int endBranchParent1 = (branch.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent1 + 1, branch.SubtreeCount - 1); 128 int Parent1Branches = endBranchParent1 - startBranchParent1; 129 130 for (int j = startBranchParent1; j <= endBranchParent1 && c.Child.SubtreeCount < c.Child.Symbol.MaximumArity; j++) 131 { 132 c.Child.AddSubtree(branch.GetSubtree(j)); 133 } 134 } 135 } 136 } 137 138 return parent0; 139 } 140 141 private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0, 142 int maximumCrossoverMethods, out List<CutPoint> crossoverPoints) 143 { 144 List<CutPoint> MethodPoints = new List<CutPoint>(); 145 parent0.Root.ForEachNodePostfix((n) => 146 { 147 if (n.SubtreeCount > 0 && n != parent0.Root) 148 { 149 foreach (var child in n.Subtrees) 150 { 151 if (child.Symbol is Run || 152 child.Symbol is OnBulletHit || 153 child.Symbol is OnBulletMissed || 154 child.Symbol is OnHitByBullet || 155 child.Symbol is OnHitRobot || 156 child.Symbol is OnHitWall || 157 child.Symbol is OnScannedRobot) 158 MethodPoints.Add(new CutPoint(n, child)); 159 } 160 } 161 }); 162 163 if (maximumCrossoverMethods == 0) 164 crossoverPoints = MethodPoints; 198 // select leaf node if possible 199 allowedLeafBranches = (from branch in branches 200 where branch == null || branch.SubtreeCount == 0 201 select branch).ToList(); 202 if (allowedLeafBranches.Count > 0) 203 { 204 return allowedLeafBranches.SelectRandom(random); 205 } 165 206 else 166 207 { 167 crossoverPoints = new List<CutPoint>();168 for (int i = 0; i < maximumCrossoverMethods; i++)169 {170 CutPoint c = MethodPoints.SelectRandom(random);171 crossoverPoints.Add(c);172 MethodPoints.Remove(c);173 if (MethodPoints.Count == 0) break;174 }175 }176 }177 178 /*private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability)179 {180 if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");181 List<ISymbolicExpressionTreeNode> allowedInternalBranches;182 List<ISymbolicExpressionTreeNode> allowedLeafBranches;183 if (random.NextDouble() < internalNodeProbability)184 {185 // select internal node if possible186 208 allowedInternalBranches = (from branch in branches 187 209 where branch != null && branch.SubtreeCount > 0 188 210 select branch).ToList(); 189 if (allowedInternalBranches.Count > 0) 190 { 191 return allowedInternalBranches.SelectRandom(random); 192 } 193 else 194 { 195 // no internal nodes allowed => select leaf nodes 196 allowedLeafBranches = (from branch in branches 197 where branch == null || branch.SubtreeCount == 0 198 select branch).ToList(); 199 return allowedLeafBranches.SelectRandom(random); 200 } 201 } 202 else 203 { 204 // select leaf node if possible 205 allowedLeafBranches = (from branch in branches 206 where branch == null || branch.SubtreeCount == 0 207 select branch).ToList(); 208 if (allowedLeafBranches.Count > 0) 209 { 210 return allowedLeafBranches.SelectRandom(random); 211 } 212 else 213 { 214 allowedInternalBranches = (from branch in branches 215 where branch != null && branch.SubtreeCount > 0 216 select branch).ToList(); 217 return allowedInternalBranches.SelectRandom(random); 218 } 219 } 220 }*/ 221 } 211 return allowedInternalBranches.SelectRandom(random); 212 } 213 } 214 }*/ 215 } 222 216 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Evaluator.cs
r9781 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using System; 24 using System.Threading; 25 using System.Xml; 26 using HeuristicLab.Common; 2 27 using HeuristicLab.Core; 3 28 using HeuristicLab.Data; … … 7 32 using HeuristicLab.Parameters; 8 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.PluginInfrastructure;10 using System;11 using System.IO;12 using System.Threading;13 using System.Xml;14 34 15 namespace HeuristicLab.Problems.Robocode 16 { 17 [StorableClass] 18 [Item("Robocode Evaluator", "Evaluator for the Robocode GP problem.")] 19 public class Evaluator : SingleSuccessorOperator, 20 ISingleObjectiveEvaluator 21 { 22 #region parameter names 23 private const string QualityParameterName = "Quality"; 24 private const string TankProgramParameterName = "TankProgram"; 25 private const string RobocodePathParamaterName = "Path"; 26 private const string CoevolutionParameterName = "Coevolution"; 35 namespace HeuristicLab.Problems.Robocode { 36 [StorableClass] 37 [Item("Robocode Evaluator", "Evaluator for the Robocode GP problem.")] 38 public class Evaluator : SingleSuccessorOperator, 39 ISingleObjectiveEvaluator { 40 #region parameter names 41 private const string QualityParameterName = "Quality"; 42 private const string TankProgramParameterName = "TankProgram"; 43 private const string RobocodePathParamaterName = "Path"; 44 private const string CoevolutionParameterName = "Coevolution"; 27 45 28 46 29 private static string solutionTemplatePath = ""; 30 public static string SolutionTemplate 31 { 32 get { return solutionTemplatePath; } 33 set 34 { 35 solutionTemplatePath = value; 36 } 47 private static string solutionTemplatePath = ""; 48 public static string SolutionTemplate { 49 get { return solutionTemplatePath; } 50 set { 51 solutionTemplatePath = value; 52 } 53 } 54 55 public static SemaphoreSlim semaphore = new SemaphoreSlim(10); 56 #endregion 57 58 59 #region parameters 60 public ILookupParameter<DoubleValue> QualityParameter { 61 get { 62 return (ILookupParameter<DoubleValue>) 63 Parameters[QualityParameterName]; 64 } 65 } 66 public ILookupParameter<ISymbolicExpressionTree> TankProgramParameter { 67 get { 68 return (ILookupParameter<ISymbolicExpressionTree>) 69 Parameters[TankProgramParameterName]; 70 } 71 } 72 public ILookupParameter<StringValue> RobocodePathParameter { 73 get { 74 return (ILookupParameter<StringValue>) 75 Parameters[RobocodePathParamaterName]; 76 } 77 } 78 public ILookupParameter<BoolValue> CoevolutionParameter { 79 get { 80 return (ILookupParameter<BoolValue>) 81 Parameters[CoevolutionParameterName]; 82 } 83 } 84 #endregion 85 86 87 [StorableConstructor] 88 protected Evaluator(bool deserializing) : base(deserializing) { } 89 protected Evaluator(Evaluator original, Cloner cloner) 90 : base(original, cloner) { 91 } 92 93 // default constructor for the evaluator 94 public Evaluator() { 95 Parameters.Add( 96 new LookupParameter<DoubleValue>( 97 QualityParameterName, 98 "The solution quality of the Robocode tank program.")); 99 Parameters.Add( 100 new LookupParameter<ISymbolicExpressionTree>( 101 TankProgramParameterName, 102 "The Robocode tank program to evaluate represented as a " + 103 "symbolic expression tree.")); 104 Parameters.Add( 105 new LookupParameter<StringValue>( 106 RobocodePathParamaterName, 107 "Path of the Robocode installation.")); 108 Parameters.Add( 109 new LookupParameter<BoolValue>( 110 CoevolutionParameterName, 111 "Use Coevolution")); 112 113 SolutionTemplate = "../tank.xml"; 114 } 115 116 // override the apply method to change the behaviour of the operator 117 // here we take trees as inputs and calculate qualities 118 // (fitness evaluation) 119 public override IOperation Apply() { 120 semaphore.Wait(); 121 122 ISymbolicExpressionTree tree = TankProgramParameter.ActualValue; 123 //XmlDocument doc = new XmlDocument(); 124 //doc.Load("../tank.xml"); 125 XmlNode node = null; 126 string path = RobocodePathParameter.ActualValue.Value; 127 128 if (CoevolutionParameter.ActualValue.Value) { 129 var trees = ExecutionContext.Parent.Scope.SubScopes;//SymbolicExpressionTreeParameter.ActualValue; 130 if (trees.Count == 2) { 131 trees = trees[0].SubScopes; 132 //treeCount = trees[0].SubScopes.Count; 133 //int selTreeCount = trees[1].SubScopes.Count; 37 134 } 38 135 39 public static SemaphoreSlim semaphore = new SemaphoreSlim(10); 40 #endregion 41 42 43 #region parameters 44 public ILookupParameter<DoubleValue> QualityParameter 45 { 46 get 47 { 48 return (ILookupParameter<DoubleValue>) 49 Parameters[QualityParameterName]; 50 } 51 } 52 public ILookupParameter<ISymbolicExpressionTree> TankProgramParameter 53 { 54 get 55 { 56 return (ILookupParameter<ISymbolicExpressionTree>) 57 Parameters[TankProgramParameterName]; 58 } 59 } 60 public ILookupParameter<StringValue> RobocodePathParameter 61 { 62 get 63 { 64 return (ILookupParameter<StringValue>) 65 Parameters[RobocodePathParamaterName]; 66 } 67 } 68 public ILookupParameter<BoolValue> CoevolutionParameter 69 { 70 get 71 { 72 return (ILookupParameter<BoolValue>) 73 Parameters[CoevolutionParameterName]; 74 } 75 } 76 #endregion 77 78 79 [StorableConstructor] 80 protected Evaluator(bool deserializing) : base(deserializing) { } 81 protected Evaluator(Evaluator original, Cloner cloner) 82 : base(original, cloner) 83 { 136 Random random = new Random(); 137 ScopeList chosenScopes = new ScopeList(5); 138 for (int i = 0; i < 5; i++) { 139 var newScope = trees.ToArray()[random.Next(0, trees.Count - 1)]; 140 chosenScopes.Add(newScope); 84 141 } 85 142 86 // default constructor for the evaluator 87 public Evaluator() 88 { 89 Parameters.Add( 90 new LookupParameter<DoubleValue>( 91 QualityParameterName, 92 "The solution quality of the Robocode tank program.")); 93 Parameters.Add( 94 new LookupParameter<ISymbolicExpressionTree>( 95 TankProgramParameterName, 96 "The Robocode tank program to evaluate represented as a " + 97 "symbolic expression tree.")); 98 Parameters.Add( 99 new LookupParameter<StringValue>( 100 RobocodePathParamaterName, 101 "Path of the Robocode installation.")); 102 Parameters.Add( 103 new LookupParameter<BoolValue>( 104 CoevolutionParameterName, 105 "Use Coevolution")); 143 //if (evaluations % 99 == 0) 144 // evaluations = evaluations; 106 145 107 SolutionTemplate = "../tank.xml"; 108 } 146 QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, chosenScopes, node, path)); 147 } else 148 QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, node, path)); 109 149 110 // override the apply method to change the behaviour of the operator 111 // here we take trees as inputs and calculate qualities 112 // (fitness evaluation) 113 public override IOperation Apply() 114 { 115 semaphore.Wait(); 116 117 ISymbolicExpressionTree tree = TankProgramParameter.ActualValue; 118 //XmlDocument doc = new XmlDocument(); 119 //doc.Load("../tank.xml"); 120 XmlNode node = null; 121 string path = RobocodePathParameter.ActualValue.Value; 150 semaphore.Release(); 122 151 123 if (CoevolutionParameter.ActualValue.Value) 124 { 125 var trees = ExecutionContext.Parent.Scope.SubScopes;//SymbolicExpressionTreeParameter.ActualValue; 126 if (trees.Count == 2) 127 { 128 trees = trees[0].SubScopes; 129 //treeCount = trees[0].SubScopes.Count; 130 //int selTreeCount = trees[1].SubScopes.Count; 131 } 152 // important: return base.Apply() to make sure that the 153 // next operator is queued for execution 154 return base.Apply(); 155 } 132 156 133 Random random = new Random(); 134 ScopeList chosenScopes = new ScopeList(5); 135 for (int i = 0; i < 5; i++) 136 { 137 var newScope = trees.ToArray()[random.Next(0, trees.Count - 1)]; 138 chosenScopes.Add(newScope); 139 } 157 public override IDeepCloneable Clone(Cloner cloner) { 158 return new Evaluator(this, cloner); 159 } 140 160 141 //if (evaluations % 99 == 0) 142 // evaluations = evaluations; 143 144 QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, chosenScopes, node, path)); 145 } 146 else 147 QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, node, path)); 148 149 semaphore.Release(); 150 151 // important: return base.Apply() to make sure that the 152 // next operator is queued for execution 153 return base.Apply(); 154 } 155 156 public override IDeepCloneable Clone(Cloner cloner) 157 { 158 return new Evaluator(this, cloner); 159 } 160 161 public bool EnabledByDefault 162 { 163 get { return true; } 164 } 161 public bool EnabledByDefault { 162 get { return true; } 165 163 } 164 } 166 165 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/External Evaluator/BattleRunner.java
r9567 r9790 1 /* HeuristicLab 2 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 3 * 4 * This file is part of HeuristicLab. 5 * 6 * HeuristicLab is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * HeuristicLab is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 1 20 import robocode.control.*; 2 21 import robocode.control.events.*; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs
r9781 r9790 1 using System.Collections.Generic; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System.Collections.Generic; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs
r9781 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Diagnostics; 3 24 using System.IO; … … 115 136 q.Append("Error: " + evaluateCode.StandardError.ReadToEnd() + "\r\n"); 116 137 cmdOutput += q.ToString(); 117 }catch { 138 } 139 catch { 118 140 return -1000.0; 119 141 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Plugin.cs.frame
r9787 r9790 29 29 namespace HeuristicLab.Problems.Robocode 30 30 { 31 [Plugin("HeuristicLab.Problems.Robocode", "The Robocode problem for genetic programming.", "3.3. 7.$WCREV$")]31 [Plugin("HeuristicLab.Problems.Robocode", "The Robocode problem for genetic programming.", "3.3.8.$WCREV$")] 32 32 [PluginFile("HeuristicLab.Problems.Robocode-3.3.dll", PluginFileType.Assembly)] 33 33 [PluginDependency("HeuristicLab.Data", "3.3")] -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Problem.cs
r9781 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Linq; 3 23 using HeuristicLab.Common; … … 10 30 using HeuristicLab.PluginInfrastructure; 11 31 12 namespace HeuristicLab.Problems.Robocode 13 { 14 [StorableClass] 15 [Creatable("Problems")] 16 [Item("Robocode Problem", 17 "The Robocode problem for genetic programming.")] 18 public class Problem : SingleObjectiveHeuristicOptimizationProblem<Evaluator, 19 ISymbolicExpressionTreeCreator> 20 { 21 #region parameter names 22 private const string TankProgramParameterName = "TankProgram"; 23 private const string MaxTankProgramLengthParameterName = 24 "MaxProgramLength"; 25 private const string MaxTankProgramDepthParameterName = 26 "MaxProgramDepth"; 27 private const string TankGrammarParameterName = "Grammar"; 28 private const string RobocodePathParamaterName = "Path"; 29 private const string CoevolutionParameterName = "Coevolution"; 30 #endregion 31 32 #region parameters 33 public IFixedValueParameter<IntValue> MaxTankProgramLengthParameter 34 { 35 get 36 { 37 return (IFixedValueParameter<IntValue>) 38 Parameters[MaxTankProgramLengthParameterName]; 39 } 40 } 41 public IFixedValueParameter<IntValue> MaxTankProgramDepthParameter 42 { 43 get 44 { 45 return (IFixedValueParameter<IntValue>) 46 Parameters[MaxTankProgramDepthParameterName]; 47 } 48 } 49 public IValueParameter<Grammar> GrammarParameter 50 { 51 get 52 { 53 return (IValueParameter<Grammar>) 54 Parameters[TankGrammarParameterName]; 55 } 56 } 57 public IFixedValueParameter<StringValue> RobocodePathParameter 58 { 59 get 60 { 61 return (IFixedValueParameter<StringValue>) 62 Parameters[RobocodePathParamaterName]; 63 } 64 } 65 public IFixedValueParameter<BoolValue> CoevolutionParameter 66 { 67 get 68 { 69 return (IFixedValueParameter<BoolValue>) 70 Parameters[CoevolutionParameterName]; 71 } 72 } 73 #endregion 74 75 [StorableConstructor] 76 protected Problem(bool deserializing) 77 : base(deserializing) 78 { 79 } 80 protected Problem(Problem original, Cloner cloner) 81 : base(original, cloner) 82 { 83 } 84 85 // default constructor for the problem 86 // also creates the fitness evaluation operator (Evaluator), 87 // and the tree creation operator (RampedHalfAndHalfTreeCreator) 88 public Problem() 89 : base(new Evaluator(), new RampedHalfAndHalfTreeCreator()) 90 { 91 Parameters.Add( 92 new FixedValueParameter<IntValue>( 93 MaxTankProgramDepthParameterName, 94 "Maximal depth of the Robocode tank program.", 95 new IntValue(6))); 96 Parameters.Add( 97 new FixedValueParameter<IntValue>( 98 MaxTankProgramLengthParameterName, 99 "Maximal length of the tank program.", 100 new IntValue(1000))); 101 Parameters.Add( 102 new ValueParameter<Grammar>( 103 TankGrammarParameterName, 104 "Grammar for the tank program.", 105 new Grammar())); 106 Parameters.Add(new FixedValueParameter<StringValue>( 107 RobocodePathParamaterName, 108 "Path of the Robocode installation.", 109 new StringValue("F:/robocode2"))); 110 Parameters.Add(new FixedValueParameter<BoolValue>( 111 CoevolutionParameterName, 112 "Use Coevolution", new BoolValue(false))); 113 114 Maximization.Value = true; 115 InitializeOperators(); 116 } 117 118 public override IDeepCloneable Clone(Cloner cloner) 119 { 120 return new Problem(this, cloner); 121 } 122 123 private void InitializeOperators() 124 { 125 Operators.AddRange( 126 ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>()); 127 Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer()); 128 Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer()); 129 Operators.Add(new BestSolutionAnalyzer()); 130 ParameterizeOperators(); 131 ParameterizeAnalyzers(); 132 } 133 134 protected override void OnEvaluatorChanged() 135 { 136 base.OnEvaluatorChanged(); 137 Evaluator.TankProgramParameter.ActualName = 138 TankProgramParameterName; 139 ParameterizeAnalyzers(); 140 ParameterizeOperators(); 141 } 142 143 protected override void OnSolutionCreatorChanged() 144 { 145 base.OnSolutionCreatorChanged(); 146 SolutionCreator.SymbolicExpressionTreeParameter.ActualName = 147 TankProgramParameterName; 148 ParameterizeAnalyzers(); 149 ParameterizeOperators(); 150 } 151 152 private void ParameterizeAnalyzers() 153 { 154 var analyzers = Operators.OfType<IAnalyzer>(); 155 foreach (var o in analyzers.OfType<ISymbolicExpressionTreeAnalyzer>()) 156 { 157 o.SymbolicExpressionTreeParameter.ActualName = 158 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 159 } 160 foreach (var o in analyzers.OfType<BestSolutionAnalyzer>()) 161 { 162 o.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 163 } 164 } 165 166 private void ParameterizeOperators() 167 { 168 var operators = Parameters 169 .OfType<IValueParameter>() 170 .Select(p => p.Value) 171 .OfType<IOperator>() 172 .Union(Operators); 173 foreach (var o in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) 174 { 175 o.SymbolicExpressionTreeGrammarParameter.ActualName = 176 TankGrammarParameterName; 177 } 178 foreach (var o in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) 179 { 180 o.MaximumSymbolicExpressionTreeDepthParameter.ActualName = 181 MaxTankProgramDepthParameterName; 182 o.MaximumSymbolicExpressionTreeLengthParameter.ActualName = 183 MaxTankProgramLengthParameterName; 184 } 185 foreach (var op in operators.OfType<Evaluator>()) 186 { 187 op.TankProgramParameter.ActualName = 188 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 189 } 190 foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) 191 { 192 op.ParentsParameter.ActualName = 193 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 194 op.ChildParameter.ActualName = 195 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 196 } 197 foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) 198 { 199 op.SymbolicExpressionTreeParameter.ActualName = 200 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 201 } 202 foreach (var op in operators.OfType<ISymbolicExpressionTreeCreator>()) 203 { 204 op.SymbolicExpressionTreeParameter.ActualName = 205 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 206 } 207 } 208 } 32 namespace HeuristicLab.Problems.Robocode { 33 [StorableClass] 34 [Creatable("Problems")] 35 [Item("Robocode Problem", 36 "The Robocode problem for genetic programming.")] 37 public class Problem : SingleObjectiveHeuristicOptimizationProblem<Evaluator, 38 ISymbolicExpressionTreeCreator> { 39 #region parameter names 40 private const string TankProgramParameterName = "TankProgram"; 41 private const string MaxTankProgramLengthParameterName = 42 "MaxProgramLength"; 43 private const string MaxTankProgramDepthParameterName = 44 "MaxProgramDepth"; 45 private const string TankGrammarParameterName = "Grammar"; 46 private const string RobocodePathParamaterName = "Path"; 47 private const string CoevolutionParameterName = "Coevolution"; 48 #endregion 49 50 #region parameters 51 public IFixedValueParameter<IntValue> MaxTankProgramLengthParameter { 52 get { 53 return (IFixedValueParameter<IntValue>) 54 Parameters[MaxTankProgramLengthParameterName]; 55 } 56 } 57 public IFixedValueParameter<IntValue> MaxTankProgramDepthParameter { 58 get { 59 return (IFixedValueParameter<IntValue>) 60 Parameters[MaxTankProgramDepthParameterName]; 61 } 62 } 63 public IValueParameter<Grammar> GrammarParameter { 64 get { 65 return (IValueParameter<Grammar>) 66 Parameters[TankGrammarParameterName]; 67 } 68 } 69 public IFixedValueParameter<StringValue> RobocodePathParameter { 70 get { 71 return (IFixedValueParameter<StringValue>) 72 Parameters[RobocodePathParamaterName]; 73 } 74 } 75 public IFixedValueParameter<BoolValue> CoevolutionParameter { 76 get { 77 return (IFixedValueParameter<BoolValue>) 78 Parameters[CoevolutionParameterName]; 79 } 80 } 81 #endregion 82 83 [StorableConstructor] 84 protected Problem(bool deserializing) 85 : base(deserializing) { 86 } 87 protected Problem(Problem original, Cloner cloner) 88 : base(original, cloner) { 89 } 90 91 // default constructor for the problem 92 // also creates the fitness evaluation operator (Evaluator), 93 // and the tree creation operator (RampedHalfAndHalfTreeCreator) 94 public Problem() 95 : base(new Evaluator(), new RampedHalfAndHalfTreeCreator()) { 96 Parameters.Add( 97 new FixedValueParameter<IntValue>( 98 MaxTankProgramDepthParameterName, 99 "Maximal depth of the Robocode tank program.", 100 new IntValue(6))); 101 Parameters.Add( 102 new FixedValueParameter<IntValue>( 103 MaxTankProgramLengthParameterName, 104 "Maximal length of the tank program.", 105 new IntValue(1000))); 106 Parameters.Add( 107 new ValueParameter<Grammar>( 108 TankGrammarParameterName, 109 "Grammar for the tank program.", 110 new Grammar())); 111 Parameters.Add(new FixedValueParameter<StringValue>( 112 RobocodePathParamaterName, 113 "Path of the Robocode installation.", 114 new StringValue("F:/robocode2"))); 115 Parameters.Add(new FixedValueParameter<BoolValue>( 116 CoevolutionParameterName, 117 "Use Coevolution", new BoolValue(false))); 118 119 Maximization.Value = true; 120 InitializeOperators(); 121 } 122 123 public override IDeepCloneable Clone(Cloner cloner) { 124 return new Problem(this, cloner); 125 } 126 127 private void InitializeOperators() { 128 Operators.AddRange( 129 ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>()); 130 Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer()); 131 Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer()); 132 Operators.Add(new BestSolutionAnalyzer()); 133 ParameterizeOperators(); 134 ParameterizeAnalyzers(); 135 } 136 137 protected override void OnEvaluatorChanged() { 138 base.OnEvaluatorChanged(); 139 Evaluator.TankProgramParameter.ActualName = 140 TankProgramParameterName; 141 ParameterizeAnalyzers(); 142 ParameterizeOperators(); 143 } 144 145 protected override void OnSolutionCreatorChanged() { 146 base.OnSolutionCreatorChanged(); 147 SolutionCreator.SymbolicExpressionTreeParameter.ActualName = 148 TankProgramParameterName; 149 ParameterizeAnalyzers(); 150 ParameterizeOperators(); 151 } 152 153 private void ParameterizeAnalyzers() { 154 var analyzers = Operators.OfType<IAnalyzer>(); 155 foreach (var o in analyzers.OfType<ISymbolicExpressionTreeAnalyzer>()) { 156 o.SymbolicExpressionTreeParameter.ActualName = 157 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 158 } 159 foreach (var o in analyzers.OfType<BestSolutionAnalyzer>()) { 160 o.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 161 } 162 } 163 164 private void ParameterizeOperators() { 165 var operators = Parameters 166 .OfType<IValueParameter>() 167 .Select(p => p.Value) 168 .OfType<IOperator>() 169 .Union(Operators); 170 foreach (var o in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) { 171 o.SymbolicExpressionTreeGrammarParameter.ActualName = 172 TankGrammarParameterName; 173 } 174 foreach (var o in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) { 175 o.MaximumSymbolicExpressionTreeDepthParameter.ActualName = 176 MaxTankProgramDepthParameterName; 177 o.MaximumSymbolicExpressionTreeLengthParameter.ActualName = 178 MaxTankProgramLengthParameterName; 179 } 180 foreach (var op in operators.OfType<Evaluator>()) { 181 op.TankProgramParameter.ActualName = 182 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 183 } 184 foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) { 185 op.ParentsParameter.ActualName = 186 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 187 op.ChildParameter.ActualName = 188 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 189 } 190 foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) { 191 op.SymbolicExpressionTreeParameter.ActualName = 192 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 193 } 194 foreach (var op in operators.OfType<ISymbolicExpressionTreeCreator>()) { 195 op.SymbolicExpressionTreeParameter.ActualName = 196 SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 197 } 198 } 199 } 209 200 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Solution.cs
r9781 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Core; 3 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/Constant.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 25 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class Constant : Symbol 9 { 10 public override int MinimumArity { get { return 0; } } 11 public override int MaximumArity { get { return 0; } } 26 namespace HeuristicLab.Problems.Robocode { 27 [StorableClass] 28 public class Constant : Symbol { 29 public override int MinimumArity { get { return 0; } } 30 public override int MaximumArity { get { return 0; } } 12 31 13 [StorableConstructor] 14 private Constant(bool deserializing) : base(deserializing) { } 15 private Constant(Constant original, Cloner cloner) 16 : base(original, cloner) 17 { 18 } 32 [StorableConstructor] 33 private Constant(bool deserializing) : base(deserializing) { } 34 private Constant(Constant original, Cloner cloner) 35 : base(original, cloner) { 36 } 19 37 20 public Constant() 21 : base("Constant", "A random fixed integer.") 22 { 23 } 38 public Constant() 39 : base("Constant", "A random fixed integer.") { 40 } 24 41 25 public override ISymbolicExpressionTreeNode CreateTreeNode() 26 { 27 return new ConstantTreeNode(); 28 } 29 public override IDeepCloneable Clone(Cloner cloner) 30 { 31 return new Constant(this, cloner); 32 } 42 public override ISymbolicExpressionTreeNode CreateTreeNode() { 43 return new ConstantTreeNode(); 33 44 } 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new Constant(this, cloner); 47 } 48 } 34 49 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/ConstantTreeNode.cs
r9565 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Core; … … 5 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 26 7 namespace HeuristicLab.Problems.Robocode 8 { 9 [StorableClass] 10 public class ConstantTreeNode : SymbolicExpressionTreeTerminalNode 11 { 12 private int value; 13 [Storable] 14 public int Value 15 { 16 get { return value; } 17 private set { this.value = value; } 18 } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class ConstantTreeNode : SymbolicExpressionTreeTerminalNode { 30 private int value; 31 [Storable] 32 public int Value { 33 get { return value; } 34 private set { this.value = value; } 35 } 19 36 20 [StorableConstructor] 21 private ConstantTreeNode(bool deserializing) : base(deserializing) { } 22 private ConstantTreeNode(ConstantTreeNode original, Cloner cloner) 23 : base(original, cloner) 24 { 25 this.value = original.value; 26 } 37 [StorableConstructor] 38 private ConstantTreeNode(bool deserializing) : base(deserializing) { } 39 private ConstantTreeNode(ConstantTreeNode original, Cloner cloner) 40 : base(original, cloner) { 41 this.value = original.value; 42 } 27 43 28 public ConstantTreeNode() 29 : base(new Constant()) 30 { 31 } 44 public ConstantTreeNode() 45 : base(new Constant()) { 46 } 32 47 33 public override IDeepCloneable Clone(Cloner cloner) 34 { 35 return new ConstantTreeNode(this, cloner); 36 } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new ConstantTreeNode(this, cloner); 50 } 37 51 38 public override bool HasLocalParameters 39 { 40 get { return true; } 41 } 52 public override bool HasLocalParameters { 53 get { return true; } 54 } 42 55 43 public override void ResetLocalParameters(IRandom random) 44 { 45 value = random.Next(-360, 360); 46 } 56 public override void ResetLocalParameters(IRandom random) { 57 value = random.Next(-360, 360); 47 58 } 59 } 48 60 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/Independent.cs
r9565 r9790 1 using HeuristicLab.Common; 2 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 4 21 5 namespace HeuristicLab.Problems.Robocode6 {7 /*[StorableClass]8 public class Independent : Symbol9 {10 public override int MinimumArity { get { return 0; } }11 public override int MaximumArity { get { return 0; } }12 22 13 [StorableConstructor] 14 private Independent(bool deserializing) : base(deserializing) { }15 private Independent(Independent original, Cloner cloner)16 : base(original, cloner)17 {18 23 namespace HeuristicLab.Problems.Robocode { 24 /*[StorableClass] 25 public class Independent : Symbol 26 { 27 public override int MinimumArity { get { return 0; } } 28 public override int MaximumArity { get { return 0; } } 19 29 20 public Independent() 21 : base("Independent", "A random fixed integer.") 22 { 23 } 30 [StorableConstructor] 31 private Independent(bool deserializing) : base(deserializing) { } 32 private Independent(Independent original, Cloner cloner) 33 : base(original, cloner) 34 { 35 } 24 36 25 public override ISymbolicExpressionTreeNode CreateTreeNode() 26 { 27 return new BooleanTreeNode(); 28 } 29 public override IDeepCloneable Clone(Cloner cloner) 30 { 31 return new Independent(this, cloner); 32 } 33 }*/ 37 public Independent() 38 : base("Independent", "A random fixed integer.") 39 { 40 } 41 42 public override ISymbolicExpressionTreeNode CreateTreeNode() 43 { 44 return new BooleanTreeNode(); 45 } 46 public override IDeepCloneable Clone(Cloner cloner) 47 { 48 return new Independent(this, cloner); 49 } 50 }*/ 34 51 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/SetAdjustGunForRobotTurn.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 25 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class SetAdjustGunForRobotTurn : Symbol 9 { 10 public override int MinimumArity { get { return 1; } } 11 public override int MaximumArity { get { return 1; } } 26 namespace HeuristicLab.Problems.Robocode { 27 [StorableClass] 28 public class SetAdjustGunForRobotTurn : Symbol { 29 public override int MinimumArity { get { return 1; } } 30 public override int MaximumArity { get { return 1; } } 12 31 13 [StorableConstructor] 14 private SetAdjustGunForRobotTurn(bool deserializing) : base(deserializing) { } 15 private SetAdjustGunForRobotTurn(SetAdjustGunForRobotTurn original, Cloner cloner) 16 : base(original, cloner) 17 { 18 } 32 [StorableConstructor] 33 private SetAdjustGunForRobotTurn(bool deserializing) : base(deserializing) { } 34 private SetAdjustGunForRobotTurn(SetAdjustGunForRobotTurn original, Cloner cloner) 35 : base(original, cloner) { 36 } 19 37 20 public SetAdjustGunForRobotTurn() 21 : base("SetAdjustGunForRobotTurn", "Sets the gun to turn independent from the robot's turn.") 22 { 23 } 38 public SetAdjustGunForRobotTurn() 39 : base("SetAdjustGunForRobotTurn", "Sets the gun to turn independent from the robot's turn.") { 40 } 24 41 25 public override IDeepCloneable Clone(Cloner cloner) 26 { 27 return new SetAdjustGunForRobotTurn(this, cloner); 28 } 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new SetAdjustGunForRobotTurn(this, cloner); 29 44 } 45 } 30 46 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/SetAdjustRadarForGunTurn.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 25 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class SetAdjustRadarForGunTurn : Symbol 9 { 10 public override int MinimumArity { get { return 1; } } 11 public override int MaximumArity { get { return 1; } } 26 namespace HeuristicLab.Problems.Robocode { 27 [StorableClass] 28 public class SetAdjustRadarForGunTurn : Symbol { 29 public override int MinimumArity { get { return 1; } } 30 public override int MaximumArity { get { return 1; } } 12 31 13 [StorableConstructor] 14 private SetAdjustRadarForGunTurn(bool deserializing) : base(deserializing) { } 15 private SetAdjustRadarForGunTurn(SetAdjustRadarForGunTurn original, Cloner cloner) 16 : base(original, cloner) 17 { 18 } 32 [StorableConstructor] 33 private SetAdjustRadarForGunTurn(bool deserializing) : base(deserializing) { } 34 private SetAdjustRadarForGunTurn(SetAdjustRadarForGunTurn original, Cloner cloner) 35 : base(original, cloner) { 36 } 19 37 20 public SetAdjustRadarForGunTurn() 21 : base("SetAdjustRadarForGunTurn", "Sets the radar to turn independent from the gun's turn.") 22 { 23 } 38 public SetAdjustRadarForGunTurn() 39 : base("SetAdjustRadarForGunTurn", "Sets the radar to turn independent from the gun's turn.") { 40 } 24 41 25 public override IDeepCloneable Clone(Cloner cloner) 26 { 27 return new SetAdjustRadarForGunTurn(this, cloner); 28 } 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new SetAdjustRadarForGunTurn(this, cloner); 29 44 } 45 } 30 46 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Abandoned/SetAdjustRadarForRobotTurn.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 25 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class SetAdjustRadarForRobotTurn : Symbol 9 { 10 public override int MinimumArity { get { return 1; } } 11 public override int MaximumArity { get { return 1; } } 26 namespace HeuristicLab.Problems.Robocode { 27 [StorableClass] 28 public class SetAdjustRadarForRobotTurn : Symbol { 29 public override int MinimumArity { get { return 1; } } 30 public override int MaximumArity { get { return 1; } } 12 31 13 [StorableConstructor] 14 private SetAdjustRadarForRobotTurn(bool deserializing) : base(deserializing) { } 15 private SetAdjustRadarForRobotTurn(SetAdjustRadarForRobotTurn original, Cloner cloner) 16 : base(original, cloner) 17 { 18 } 32 [StorableConstructor] 33 private SetAdjustRadarForRobotTurn(bool deserializing) : base(deserializing) { } 34 private SetAdjustRadarForRobotTurn(SetAdjustRadarForRobotTurn original, Cloner cloner) 35 : base(original, cloner) { 36 } 19 37 20 public SetAdjustRadarForRobotTurn() 21 : base("SetAdjustRadarForRobotTurn", "Sets the radar to turn independent from the robot's turn.") 22 { 23 } 38 public SetAdjustRadarForRobotTurn() 39 : base("SetAdjustRadarForRobotTurn", "Sets the radar to turn independent from the robot's turn.") { 40 } 24 41 25 public override IDeepCloneable Clone(Cloner cloner) 26 { 27 return new SetAdjustRadarForRobotTurn(this, cloner); 28 } 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new SetAdjustRadarForRobotTurn(this, cloner); 29 44 } 45 } 30 46 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Block.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Branches/ElseStatement.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Branches/IfStatement.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Branches/WhileLoop.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/CodeNode.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/EmptyEvent.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletHit.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletMissed.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitByBullet.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitRobot.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitWall.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnScannedRobot.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Run.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/BooleanTreeNode.cs
r9565 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Core; … … 5 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 26 7 namespace HeuristicLab.Problems.Robocode 8 { 9 [StorableClass] 10 public class BooleanTreeNode : SymbolicExpressionTreeTerminalNode 11 { 12 private bool value; 13 [Storable] 14 public bool Value 15 { 16 get { return value; } 17 private set { this.value = value; } 18 } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class BooleanTreeNode : SymbolicExpressionTreeTerminalNode { 30 private bool value; 31 [Storable] 32 public bool Value { 33 get { return value; } 34 private set { this.value = value; } 35 } 19 36 20 [StorableConstructor] 21 private BooleanTreeNode(bool deserializing) : base(deserializing) { } 22 private BooleanTreeNode(BooleanTreeNode original, Cloner cloner) 23 : base(original, cloner) 24 { 25 this.value = original.value; 26 } 37 [StorableConstructor] 38 private BooleanTreeNode(bool deserializing) : base(deserializing) { } 39 private BooleanTreeNode(BooleanTreeNode original, Cloner cloner) 40 : base(original, cloner) { 41 this.value = original.value; 42 } 27 43 28 public BooleanTreeNode() 29 : base(new LogicalValue()) 30 { 31 } 44 public BooleanTreeNode() 45 : base(new LogicalValue()) { 46 } 32 47 33 public override IDeepCloneable Clone(Cloner cloner) 34 { 35 return new BooleanTreeNode(this, cloner); 36 } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new BooleanTreeNode(this, cloner); 50 } 37 51 38 public override bool HasLocalParameters 39 { 40 get { return true; } 41 } 52 public override bool HasLocalParameters { 53 get { return true; } 54 } 42 55 43 public override void ResetLocalParameters(IRandom random) 44 { 45 value = (bool)(random.Next(0, 1) == 1); 46 } 56 public override void ResetLocalParameters(IRandom random) { 57 value = (bool)(random.Next(0, 1) == 1); 47 58 } 59 } 48 60 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Equal.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThan.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalComparison.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalExpression.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalValue.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Negation.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/NumericalComparison.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Number.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumberTreeNode.cs
r9565 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Core; … … 5 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 26 7 namespace HeuristicLab.Problems.Robocode 8 { 9 [StorableClass] 10 public class NumberTreeNode : SymbolicExpressionTreeTerminalNode 11 { 12 private int value; 13 [Storable] 14 public int Value 15 { 16 get { return value; } 17 private set { this.value = value; } 18 } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class NumberTreeNode : SymbolicExpressionTreeTerminalNode { 30 private int value; 31 [Storable] 32 public int Value { 33 get { return value; } 34 private set { this.value = value; } 35 } 19 36 20 [StorableConstructor] 21 private NumberTreeNode(bool deserializing) : base(deserializing) { } 22 private NumberTreeNode(NumberTreeNode original, Cloner cloner) 23 : base(original, cloner) 24 { 25 this.value = original.value; 26 } 37 [StorableConstructor] 38 private NumberTreeNode(bool deserializing) : base(deserializing) { } 39 private NumberTreeNode(NumberTreeNode original, Cloner cloner) 40 : base(original, cloner) { 41 this.value = original.value; 42 } 27 43 28 public NumberTreeNode() 29 : base(new Number()) 30 { 31 } 44 public NumberTreeNode() 45 : base(new Number()) { 46 } 32 47 33 public override IDeepCloneable Clone(Cloner cloner) 34 { 35 return new NumberTreeNode(this, cloner); 36 } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new NumberTreeNode(this, cloner); 50 } 37 51 38 public override bool HasLocalParameters 39 { 40 get { return true; } 41 } 52 public override bool HasLocalParameters { 53 get { return true; } 54 } 42 55 43 public override void ResetLocalParameters(IRandom random) 44 { 45 value = random.Next(-360, 360); 46 } 56 public override void ResetLocalParameters(IRandom random) { 57 value = random.Next(-360, 360); 47 58 } 59 } 48 60 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Addition.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Division.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalExpression.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalOperation.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPower.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 25 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class ShotPower : CodeNode 9 { 10 public override int MinimumArity { get { return 0; } } 11 public override int MaximumArity { get { return 0; } } 26 namespace HeuristicLab.Problems.Robocode { 27 [StorableClass] 28 public class ShotPower : CodeNode { 29 public override int MinimumArity { get { return 0; } } 30 public override int MaximumArity { get { return 0; } } 12 31 13 14 32 [Storable] 33 public override string Prefix { get; set; } 15 34 16 17 35 [Storable] 36 public override string Suffix { get; set; } 18 37 19 [StorableConstructor] 20 private ShotPower(bool deserializing) : base(deserializing) { } 21 private ShotPower(ShotPower original, Cloner cloner) 22 : base(original, cloner) 23 { 24 } 38 [StorableConstructor] 39 private ShotPower(bool deserializing) : base(deserializing) { } 40 private ShotPower(ShotPower original, Cloner cloner) 41 : base(original, cloner) { 42 } 25 43 26 public ShotPower() 27 : base("ShotPower", "The power of a shot between 0.1 and 3.") 28 { 29 } 44 public ShotPower() 45 : base("ShotPower", "The power of a shot between 0.1 and 3.") { 46 } 30 47 31 public override ISymbolicExpressionTreeNode CreateTreeNode() 32 { 33 return new ShotPowerTreeNode(); 34 } 48 public override ISymbolicExpressionTreeNode CreateTreeNode() { 49 return new ShotPowerTreeNode(); 50 } 35 51 36 public override IDeepCloneable Clone(Cloner cloner) 37 { 38 return new ShotPower(this, cloner); 39 } 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new ShotPower(this, cloner); 54 } 40 55 41 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) 42 { 43 return " " + ((ShotPowerTreeNode)node).Value + " "; 44 } 56 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) { 57 return " " + ((ShotPowerTreeNode)node).Value + " "; 45 58 } 59 } 46 60 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPowerTreeNode.cs
r9565 r9790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Core; … … 5 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 26 7 namespace HeuristicLab.Problems.Robocode 8 { 9 [StorableClass] 10 public class ShotPowerTreeNode : SymbolicExpressionTreeTerminalNode 11 { 12 private double value; 13 [Storable] 14 public double Value 15 { 16 get { return value; } 17 private set { this.value = value; } 18 } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class ShotPowerTreeNode : SymbolicExpressionTreeTerminalNode { 30 private double value; 31 [Storable] 32 public double Value { 33 get { return value; } 34 private set { this.value = value; } 35 } 19 36 20 [StorableConstructor] 21 private ShotPowerTreeNode(bool deserializing) : base(deserializing) { } 22 private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner) 23 : base(original, cloner) 24 { 25 this.value = original.value; 26 } 37 [StorableConstructor] 38 private ShotPowerTreeNode(bool deserializing) : base(deserializing) { } 39 private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner) 40 : base(original, cloner) { 41 this.value = original.value; 42 } 27 43 28 public ShotPowerTreeNode() 29 : base(new ShotPower()) 30 { 31 } 44 public ShotPowerTreeNode() 45 : base(new ShotPower()) { 46 } 32 47 33 public override IDeepCloneable Clone(Cloner cloner) 34 { 35 return new ShotPowerTreeNode(this, cloner); 36 } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new ShotPowerTreeNode(this, cloner); 50 } 37 51 38 public override bool HasLocalParameters 39 { 40 get { return true; } 41 } 52 public override bool HasLocalParameters { 53 get { return true; } 54 } 42 55 43 public override void ResetLocalParameters(IRandom random) 44 { 45 value = (double)random.Next(1, 3); 46 } 56 public override void ResetLocalParameters(IRandom random) { 57 value = (double)random.Next(1, 3); 47 58 } 59 } 48 60 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetEnergy.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetGunHeading.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetHeading.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetRadarHeading.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetX.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetY.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/INumericalMethod.cs
r9565 r9790 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 5 21 6 namespace HeuristicLab.Problems.Robocode 7 { 8 public interface INumericalMethod 9 10 22 23 24 namespace HeuristicLab.Problems.Robocode { 25 public interface INumericalMethod { 26 } 11 27 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Program.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 26 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class Program : Symbol 9 { 10 public override int MinimumArity { get { return 2; } } 11 public override int MaximumArity { get { return byte.MaxValue; } } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class Program : Symbol { 30 public override int MinimumArity { get { return 2; } } 31 public override int MaximumArity { get { return byte.MaxValue; } } 12 32 13 [StorableConstructor] 14 private Program(bool deserializing) : base(deserializing) { } 15 private Program(Program original, Cloner cloner) 16 : base(original, cloner) 17 { 18 } 33 [StorableConstructor] 34 private Program(bool deserializing) : base(deserializing) { } 35 private Program(Program original, Cloner cloner) 36 : base(original, cloner) { 37 } 19 38 20 public Program() 21 : base("Program", "A Robocode tank program.") 22 { 23 } 39 public Program() 40 : base("Program", "A Robocode tank program.") { 41 } 24 42 25 public override IDeepCloneable Clone(Cloner cloner) 26 { 27 return new Program(this, cloner); 28 } 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new Program(this, cloner); 29 45 } 46 } 30 47 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Tank.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Ahead.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Back.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/DoNothing.cs
r9565 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 26 5 namespace HeuristicLab.Problems.Robocode 6 { 7 [StorableClass] 8 public class DoNothing : CodeNode 9 { 10 public override int MinimumArity { get { return 0; } } 11 public override int MaximumArity { get { return 0; } } 27 namespace HeuristicLab.Problems.Robocode { 28 [StorableClass] 29 public class DoNothing : CodeNode { 30 public override int MinimumArity { get { return 0; } } 31 public override int MaximumArity { get { return 0; } } 12 32 13 14 33 [Storable] 34 public override string Prefix { get; set; } 15 35 16 17 36 [Storable] 37 public override string Suffix { get; set; } 18 38 19 [StorableConstructor] 20 private DoNothing(bool deserializing) : base(deserializing) { } 21 private DoNothing(DoNothing original, Cloner cloner) 22 : base(original, cloner) 23 { 24 } 39 [StorableConstructor] 40 private DoNothing(bool deserializing) : base(deserializing) { } 41 private DoNothing(DoNothing original, Cloner cloner) 42 : base(original, cloner) { 43 } 25 44 26 public DoNothing() 27 : base("DoNothing", "Do nothing this turn, meaning that the robot will skip it's turn.") 28 { 29 } 45 public DoNothing() 46 : base("DoNothing", "Do nothing this turn, meaning that the robot will skip it's turn.") { 47 } 30 48 31 public override IDeepCloneable Clone(Cloner cloner) 32 { 33 return new DoNothing(this, cloner); 34 } 49 public override IDeepCloneable Clone(Cloner cloner) { 50 return new DoNothing(this, cloner); 51 } 35 52 36 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) 37 { 38 return ""; 39 } 53 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) { 54 return ""; 40 55 } 56 } 41 57 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Fire.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunLeft.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunRight.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnLeft.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarLeft.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarRight.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRight.cs
r9630 r9790 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 23 using HeuristicLab.Common; 2 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
Note: See TracChangeset
for help on using the changeset viewer.