Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9879


Ignore:
Timestamp:
08/13/13 10:56:05 (11 years ago)
Author:
ascheibe
Message:

#2069 removed unused symbols and cleaned up code

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  
    7979      var ahead = new Ahead();
    8080      var back = new Back();
    81       var constant = new Constant();
    8281      var doNothing = new DoNothing();
    8382      var fire = new Fire();
     
    156155      var constantSymbols = new List<ISymbol>()
    157156            {
    158                 shotPower, /*independent,*/ constant
     157                shotPower
    159158            };
    160159
     
    247246      // Add the appropriate parameters as children of their respective functions
    248247      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)
    254249          AddAllowedChildSymbol(f, shotPower);
    255250        else
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj

    r9787 r9879  
    9595    <None Include="HeuristicLab.snk" />
    9696    <None Include="Plugin.cs.frame" />
    97     <Compile Include="Crossover\RobocodeCrossover.cs" />
    9897    <Compile Include="Crossover\RobocodeMethodCrossover.cs" />
    99     <Compile Include="Evaluator.cs" />
     98    <Compile Include="RobocodeEvaluator.cs" />
    10099    <Compile Include="Grammar.cs" />
    101100    <Compile Include="Interpreter.cs" />
    102     <Compile Include="Problem.cs" />
     101    <Compile Include="RobocodeProblem.cs" />
    103102    <None Include="Properties\AssemblyInfo.cs.frame" />
    104103    <Compile Include="Solution.cs" />
     
    112111    <Compile Include="Symbols\Branches\WhileLoop.cs" />
    113112    <Compile Include="Symbols\Logical Expressions\BooleanTreeNode.cs" />
    114     <Compile Include="Symbols\Abandoned\Constant.cs" />
    115     <Compile Include="Symbols\Abandoned\ConstantTreeNode.cs" />
    116113    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Conjunction.cs" />
    117114    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Disjunction.cs" />
     
    153150    <Compile Include="Symbols\Numerical Methods\GetX.cs" />
    154151    <Compile Include="Symbols\Numerical Methods\GetY.cs" />
    155     <Compile Include="Symbols\Abandoned\Independent.cs" />
    156152    <Compile Include="Symbols\Program.cs" />
    157153    <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" />
    161154    <Compile Include="Symbols\Numerical Expressions\ShotPower.cs" />
    162155    <Compile Include="Symbols\Numerical Expressions\ShotPowerTreeNode.cs" />
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Interpreter.cs

    r9790 r9879  
    295295          tankStats = EvaluateTankProgram(node.GetSubtree(0), ref docNode, null);
    296296      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)
    300298        docNode[method]["code"].InnerText += " " + ((ShotPowerTreeNode)node).Value + " ";
    301299      else if (node.Symbol is LogicalValue)
     
    329327      } else if (node.Symbol is Back) {
    330328        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(";
    346329        EvaluateTankProgram(node.GetSubtree(0), docNode, method);
    347330        docNode[method]["code"].InnerText += ");\r\n";
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Solution.cs

    r9790 r9879  
    2828  [StorableClass]
    2929  public sealed class Solution : NamedItem {
    30     //private int moves;
    31     //[Storable]
    32     //public int Moves
    33     //{
    34     //    get { return moves; }
    35     //    private set { this.moves = value; }
    36     //}
    37     //private int shots;
    38     //[Storable]
    39     //public int Shots
    40     //{
    41     //    get { return shots; }
    42     //    private set { this.shots = value; }
    43     //}
    4430    [Storable]
    4531    public ISymbolicExpressionTree Tree { get; set; }
     
    5238    private Solution(Solution original, Cloner cloner)
    5339      : base(original, cloner) {
    54 
    5540      Tree = cloner.Clone(original.Tree);
    5641      Path = original.Path;
    5742    }
    5843
    59     public Solution(ISymbolicExpressionTree tree, string path)// int moves, int shots)
    60       : base("Solution", "A tank program.") {
     44    public Solution(ISymbolicExpressionTree tree, string path)
     45      : base("Solution", "A Robocode program.") {
    6146      this.Tree = tree;
    6247      this.Path = path;
    63       //this.moves = moves;
    64       //this.shots = shots;
    6548    }
    6649
Note: See TracChangeset for help on using the changeset viewer.