Changeset 9879
- Timestamp:
- 08/13/13 10:56:05 (11 years ago)
- Location:
- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3
- Files:
-
- 2 added
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs
r9790 r9879 79 79 var ahead = new Ahead(); 80 80 var back = new Back(); 81 var constant = new Constant();82 81 var doNothing = new DoNothing(); 83 82 var fire = new Fire(); … … 156 155 var constantSymbols = new List<ISymbol>() 157 156 { 158 shotPower , /*independent,*/ constant157 shotPower 159 158 }; 160 159 … … 247 246 // Add the appropriate parameters as children of their respective functions 248 247 foreach (var f in functionSymbols) { 249 if (f is SetAdjustGunForRobotTurn || 250 f is SetAdjustRadarForGunTurn || 251 f is SetAdjustRadarForRobotTurn) 252 AddAllowedChildSymbol(f, logicExpr); 253 else if (f is Fire) 248 if (f is Fire) 254 249 AddAllowedChildSymbol(f, shotPower); 255 250 else -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj
r9787 r9879 95 95 <None Include="HeuristicLab.snk" /> 96 96 <None Include="Plugin.cs.frame" /> 97 <Compile Include="Crossover\RobocodeCrossover.cs" />98 97 <Compile Include="Crossover\RobocodeMethodCrossover.cs" /> 99 <Compile Include=" Evaluator.cs" />98 <Compile Include="RobocodeEvaluator.cs" /> 100 99 <Compile Include="Grammar.cs" /> 101 100 <Compile Include="Interpreter.cs" /> 102 <Compile Include=" Problem.cs" />101 <Compile Include="RobocodeProblem.cs" /> 103 102 <None Include="Properties\AssemblyInfo.cs.frame" /> 104 103 <Compile Include="Solution.cs" /> … … 112 111 <Compile Include="Symbols\Branches\WhileLoop.cs" /> 113 112 <Compile Include="Symbols\Logical Expressions\BooleanTreeNode.cs" /> 114 <Compile Include="Symbols\Abandoned\Constant.cs" />115 <Compile Include="Symbols\Abandoned\ConstantTreeNode.cs" />116 113 <Compile Include="Symbols\Logical Expressions\Logical Comparators\Conjunction.cs" /> 117 114 <Compile Include="Symbols\Logical Expressions\Logical Comparators\Disjunction.cs" /> … … 153 150 <Compile Include="Symbols\Numerical Methods\GetX.cs" /> 154 151 <Compile Include="Symbols\Numerical Methods\GetY.cs" /> 155 <Compile Include="Symbols\Abandoned\Independent.cs" />156 152 <Compile Include="Symbols\Program.cs" /> 157 153 <Compile Include="Symbols\Event Methods\Run.cs" /> 158 <Compile Include="Symbols\Abandoned\SetAdjustGunForRobotTurn.cs" />159 <Compile Include="Symbols\Abandoned\SetAdjustRadarForGunTurn.cs" />160 <Compile Include="Symbols\Abandoned\SetAdjustRadarForRobotTurn.cs" />161 154 <Compile Include="Symbols\Numerical Expressions\ShotPower.cs" /> 162 155 <Compile Include="Symbols\Numerical Expressions\ShotPowerTreeNode.cs" /> -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs
r9790 r9879 295 295 tankStats = EvaluateTankProgram(node.GetSubtree(0), ref docNode, null); 296 296 else*/ 297 if (node.Symbol is Constant) 298 docNode[method]["code"].InnerText += " " + ((ConstantTreeNode)node).Value + " "; 299 else if (node.Symbol is ShotPower) 297 if (node.Symbol is ShotPower) 300 298 docNode[method]["code"].InnerText += " " + ((ShotPowerTreeNode)node).Value + " "; 301 299 else if (node.Symbol is LogicalValue) … … 329 327 } else if (node.Symbol is Back) { 330 328 docNode[method]["code"].InnerText += "setBack("; 331 EvaluateTankProgram(node.GetSubtree(0), docNode, method);332 docNode[method]["code"].InnerText += ");\r\n";333 tankStats.moves = 1;334 } else if (node.Symbol is SetAdjustGunForRobotTurn) {335 docNode[method]["code"].InnerText += "setAdjustGunForRobotTurn(";336 EvaluateTankProgram(node.GetSubtree(0), docNode, method);337 docNode[method]["code"].InnerText += ");\r\n";338 tankStats.moves = 1;339 } else if (node.Symbol is SetAdjustRadarForGunTurn) {340 docNode[method]["code"].InnerText += "setAdjustRadarForGunTurn(";341 EvaluateTankProgram(node.GetSubtree(0), docNode, method);342 docNode[method]["code"].InnerText += ");\r\n";343 tankStats.moves = 1;344 } else if (node.Symbol is SetAdjustRadarForRobotTurn) {345 docNode[method]["code"].InnerText += "setAdjustRadarForRobotTurn(";346 329 EvaluateTankProgram(node.GetSubtree(0), docNode, method); 347 330 docNode[method]["code"].InnerText += ");\r\n"; -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Solution.cs
r9790 r9879 28 28 [StorableClass] 29 29 public sealed class Solution : NamedItem { 30 //private int moves;31 //[Storable]32 //public int Moves33 //{34 // get { return moves; }35 // private set { this.moves = value; }36 //}37 //private int shots;38 //[Storable]39 //public int Shots40 //{41 // get { return shots; }42 // private set { this.shots = value; }43 //}44 30 [Storable] 45 31 public ISymbolicExpressionTree Tree { get; set; } … … 52 38 private Solution(Solution original, Cloner cloner) 53 39 : base(original, cloner) { 54 55 40 Tree = cloner.Clone(original.Tree); 56 41 Path = original.Path; 57 42 } 58 43 59 public Solution(ISymbolicExpressionTree tree, string path) // int moves, int shots)60 : base("Solution", "A tankprogram.") {44 public Solution(ISymbolicExpressionTree tree, string path) 45 : base("Solution", "A Robocode program.") { 61 46 this.Tree = tree; 62 47 this.Path = path; 63 //this.moves = moves;64 //this.shots = shots;65 48 } 66 49
Note: See TracChangeset
for help on using the changeset viewer.