Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/Plugin.cs.frame
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/Plugin.cs.frame	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/Plugin.cs.frame	(revision 10011)
@@ -34,6 +34,4 @@
     [PluginDependency("HeuristicLab.Core", "3.3")]
     [PluginDependency("HeuristicLab.Core.Views", "3.3")]
-    [PluginDependency("HeuristicLab.Optimization", "3.3")]
-    [PluginDependency("HeuristicLab.Operators", "3.3")]
     [PluginDependency("HeuristicLab.Common", "3.3")]
     [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/EnemyCollection.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/EnemyCollection.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/EnemyCollection.cs	(revision 10011)
@@ -37,6 +37,6 @@
 
     [StorableConstructor]
-    private EnemyCollection(bool deserializing) : base(deserializing) { }
-    private EnemyCollection(EnemyCollection original, Cloner cloner)
+    protected EnemyCollection(bool deserializing) : base(deserializing) { }
+    protected EnemyCollection(EnemyCollection original, Cloner cloner)
       : base(original, cloner) {
       RobocodePath = original.RobocodePath;
@@ -69,6 +69,5 @@
           robotList.SetItemCheckedState(robot, false);
         }
-      }
-      catch { }
+      } catch { }
 
       return robotList;
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs	(revision 10011)
@@ -20,5 +20,4 @@
 #endregion
 
-using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -31,8 +30,6 @@
   public class Grammar : SymbolicExpressionGrammar {
     [StorableConstructor]
-    private Grammar(bool deserializing) : base(deserializing) { }
-    private Grammar(Grammar original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Grammar(bool deserializing) : base(deserializing) { }
+    protected Grammar(Grammar original, Cloner cloner) : base(original, cloner) { }
 
     public Grammar()
@@ -50,34 +47,33 @@
       #region Symbols
       var block = new Block();
-
-      var ifStmt = new IfStatement();
-      var elseStmt = new ElseStatement();
-      var whileLoop = new WhileLoop();
-
-      var numExpr = new NumericalExpression();
+      var stat = new Stat();
+      var ifStat = new IfStat();
+      var elseStat = new ElseStat();
+      var whileStat = new WhileStat();
+
+      var logicalExpr = new LogicalExpression();
+      var numericalExpr = new NumericalExpression();
+
+      var equal = new Equal();
+      var lessThan = new LessThan();
+      var lessThanOrEqual = new LessThanOrEqual();
+      var greaterThan = new GreaterThan();
+      var greaterThanOrEqual = new GreaterThanOrEqual();
+
+      var conjunction = new Conjunction();
+      var disjunction = new Disjunction();
+      var negation = new Negation();
+
+      var addition = new Addition();
+      var subtraction = new Subtraction();
+      var multiplication = new Multiplication();
+      var division = new Division();
+      var modulus = new Modulus();
+
       var number = new Number();
-      var numOp = new NumericalOperation();
-      var add = new Addition();
-      var sub = new Subtraction();
-      var mult = new Multiplication();
-      var div = new Division();
-      var mod = new Modulus();
-
-      var logicExpr = new LogicalExpression();
-      var logicComp = new LogicalComparison();
-      var numComp = new NumericalComparison();
-      var logicVal = new LogicalValue();
-      var not = new Negation();
-      var and = new Conjunction();
-      var or = new Disjunction();
-      var eq = new Equal();
-      var lt = new LessThan();
-      var gt = new GreaterThan();
-      var lteq = new LessThanOrEqual();
-      var gteq = new GreaterThanOrEqual();
+      var logicalVal = new LogicalValue();
 
       var ahead = new Ahead();
       var back = new Back();
-      var doNothing = new DoNothing();
       var fire = new Fire();
       var shotPower = new ShotPower();
@@ -108,69 +104,36 @@
       var onHitWall = new OnHitWall();
       var onScannedRobot = new OnScannedRobot();
-      var emptyEvent = new EmptyEvent();
 
       var run = new Run();
       var tank = new Tank();
-      var program = new Program();
+
+      var doNothing = new DoNothing();
+      var emptyEvent = new EmptyEvent();
       #endregion
 
       #region Symbol Collections
-      var numericalExpressions = new List<ISymbol>()
-            {
-                number, numOp, getEnergy, getGunHeading, getHeading, getRadarHeading, getX, getY
-            };
-
-      var numericalOperators = new List<ISymbol>()
-            {
-                add, sub, mult, div, mod
-            };
-
-      var logicalExpressions = new List<ISymbol>()
-            {
-                logicVal, logicComp, numComp, not
-            };
-
-      var logicalComparators = new List<ISymbol>()
-            {
-                and, or
-            };
-
-      var numericalComparators = new List<ISymbol>()
-            {
-                lt, gt, lteq, gteq, eq
-            };
-
-      var terminalSymbols = new List<ISymbol>()
-            {
-                doNothing, //getEnergy, getGunHeading, getHeading, getRadarHeading, getX, getY
-            };
-
-      var functionSymbols = new List<ISymbol>()
-            {
-                ahead, back, fire,
-                //setAdjustGunForRobotTurn, setAdjustRadarForGunTurn, setAdjustRadarForRobotTurn, 
-                turnGunLeft, turnGunRight, turnLeft, turnRadarLeft, turnRadarRight, turnRight
-            };
-
-      var constantSymbols = new List<ISymbol>()
-            {
-                shotPower
-            };
-
-      var eventSymbols = new List<ISymbol>()
-            {
-                run, onBulletHit, onBulletMissed, onHitByBullet, 
-                onHitRobot, onHitWall, onScannedRobot, block, emptyEvent
-            };
+      var eventSymbols = new ISymbol[] { onScannedRobot, onBulletHit, onBulletMissed, onHitByBullet, onHitRobot, onHitWall };
+      var controlSymbols = new ISymbol[] { ifStat, whileStat };
+      var functionSymbols = new ISymbol[] {
+        ahead, back, fire, turnGunLeft, turnGunRight, turnLeft, turnRadarLeft, turnRadarRight, turnRight
+        //setAdjustGunForRobotTurn, setAdjustRadarForGunTurn, setAdjustRadarForRobotTurn, 
+      };
+      var relationalOperators = new ISymbol[] { equal, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual };
+      var logicalOperators = new ISymbol[] { conjunction, disjunction, negation };
+      var numericalExpressions = new ISymbol[] { number, getEnergy, getGunHeading, getHeading, getRadarHeading, getX, getY };
+      var numericalOperators = new ISymbol[] { addition, subtraction, multiplication, division, modulus };
       #endregion
 
       #region Adding Symbols
-      // add all symbols to the grammar
-
-      AddSymbol(ifStmt);
-      AddSymbol(elseStmt);
-      AddSymbol(whileLoop);
-
-      AddSymbol(numExpr);
+      foreach (var s in eventSymbols)
+        AddSymbol(s);
+      foreach (var s in controlSymbols)
+        AddSymbol(s);
+      foreach (var s in functionSymbols)
+        AddSymbol(s);
+      foreach (var s in relationalOperators)
+        AddSymbol(s);
+      foreach (var s in logicalOperators)
+        AddSymbol(s);
       foreach (var s in numericalExpressions)
         AddSymbol(s);
@@ -178,93 +141,102 @@
         AddSymbol(s);
 
-      AddSymbol(logicExpr);
-      foreach (var s in logicalExpressions)
-        AddSymbol(s);
-      foreach (var s in logicalComparators)
-        AddSymbol(s);
-      foreach (var s in numericalComparators)
-        AddSymbol(s);
-
-      foreach (var s in terminalSymbols)
-        AddSymbol(s);
+      AddSymbol(block);
+      AddSymbol(stat);
+      AddSymbol(elseStat);
+      AddSymbol(shotPower);
+      AddSymbol(logicalVal);
+      AddSymbol(logicalExpr);
+      AddSymbol(numericalExpr);
+      AddSymbol(run);
+      AddSymbol(tank);
+      AddSymbol(emptyEvent);
+      AddSymbol(doNothing);
+      #endregion
+
+      #region Grammar Definition
+      // StartSymbol
+      AddAllowedChildSymbol(StartSymbol, tank);
+
+      // Tank
+      AddAllowedChildSymbol(tank, run, 0);
+      AddAllowedChildSymbol(tank, onScannedRobot, 1);
+      AddAllowedChildSymbol(tank, onBulletHit, 2);
+      AddAllowedChildSymbol(tank, onBulletMissed, 3);
+      AddAllowedChildSymbol(tank, onHitByBullet, 4);
+      AddAllowedChildSymbol(tank, onHitRobot, 5);
+      AddAllowedChildSymbol(tank, onHitWall, 6);
+
+      // Run
+      AddAllowedChildSymbol(run, stat);
+
+      // Event
+      foreach (var s in eventSymbols)
+        AddAllowedChildSymbol(s, stat);
+
+      // Block
+      AddAllowedChildSymbol(block, stat);
+
+      // Stat
+      AddAllowedChildSymbol(stat, stat);
+      AddAllowedChildSymbol(stat, block);
+      foreach (var s in controlSymbols)
+        AddAllowedChildSymbol(stat, s);
       foreach (var s in functionSymbols)
-        AddSymbol(s);
-      foreach (var s in constantSymbols)
-        AddSymbol(s);
-      foreach (var s in eventSymbols)
-        AddSymbol(s);
-      AddSymbol(tank);
-      #endregion
-
-      #region Defining Grammar
-      // define grammar rules
-
-      // Branches
-      AddAllowedChildSymbol(ifStmt, logicExpr, 0);
-      AddAllowedChildSymbol(ifStmt, block, 1);
-      AddAllowedChildSymbol(ifStmt, elseStmt, 2);
-      AddAllowedChildSymbol(ifStmt, doNothing, 2);
-      AddAllowedChildSymbol(elseStmt, block);
-      AddAllowedChildSymbol(whileLoop, logicExpr, 0);
-      AddAllowedChildSymbol(whileLoop, block, 1);
+        AddAllowedChildSymbol(stat, s);
+      AddAllowedChildSymbol(stat, emptyEvent);
+      AddAllowedChildSymbol(stat, doNothing);
+
+      // IfStat
+      AddAllowedChildSymbol(ifStat, logicalExpr, 0);
+      AddAllowedChildSymbol(ifStat, stat, 1);
+      AddAllowedChildSymbol(ifStat, emptyEvent, 1);
+      AddAllowedChildSymbol(ifStat, doNothing, 1);
+      AddAllowedChildSymbol(ifStat, elseStat, 2);
+      AddAllowedChildSymbol(ifStat, emptyEvent, 2);
+      AddAllowedChildSymbol(ifStat, doNothing, 2);
+
+      // ElseStat
+      AddAllowedChildSymbol(elseStat, stat);
+      AddAllowedChildSymbol(elseStat, emptyEvent);
+      AddAllowedChildSymbol(elseStat, doNothing);
+
+      // WhileStat
+      AddAllowedChildSymbol(whileStat, logicalExpr, 0);
+      AddAllowedChildSymbol(whileStat, stat, 1);
+      AddAllowedChildSymbol(whileStat, emptyEvent, 1);
+      AddAllowedChildSymbol(whileStat, doNothing, 1);
 
       // Numerical Expressions
-      foreach (var s in numericalExpressions) {
-        AddAllowedChildSymbol(numExpr, s);
-        AddAllowedChildSymbol(numOp, s, 1);
-        AddAllowedChildSymbol(numOp, s, 2);
+      foreach (var s in numericalExpressions)
+        AddAllowedChildSymbol(numericalExpr, s);
+      foreach (var s in numericalOperators) {
+        AddAllowedChildSymbol(numericalExpr, s);
+        foreach (var ne in numericalExpressions)
+          AddAllowedChildSymbol(s, ne);
+        foreach (var no in numericalOperators) {
+          AddAllowedChildSymbol(s, no);
+        }
       }
-      foreach (var s in numericalOperators)
-        AddAllowedChildSymbol(numOp, s, 0);
 
       // Logical Expressions
-      foreach (var s in logicalExpressions) {
-        AddAllowedChildSymbol(logicExpr, s);
-        AddAllowedChildSymbol(not, s);
-        AddAllowedChildSymbol(logicComp, s, 1);
-        AddAllowedChildSymbol(logicComp, s, 2);
+      AddAllowedChildSymbol(logicalExpr, logicalVal);
+      foreach (var s in logicalOperators) {
+        AddAllowedChildSymbol(logicalExpr, s);
+        AddAllowedChildSymbol(s, logicalVal);
+        foreach (var lo in logicalOperators)
+          AddAllowedChildSymbol(s, lo);
+        foreach (var ro in relationalOperators)
+          AddAllowedChildSymbol(s, ro);
       }
-      foreach (var s in logicalComparators)
-        AddAllowedChildSymbol(logicComp, s, 0);
-      foreach (var s in numericalExpressions) {
-        AddAllowedChildSymbol(numComp, s, 1);
-        AddAllowedChildSymbol(numComp, s, 2);
-      }
-      foreach (var s in numericalComparators)
-        AddAllowedChildSymbol(numComp, s, 0);
-
-
-      // All Void Statements can appear in run or in an event handler or inside a block
-      foreach (var e in eventSymbols) {
-        AddAllowedChildSymbol(e, ifStmt);
-        AddAllowedChildSymbol(e, whileLoop);
-        AddAllowedChildSymbol(e, doNothing);
-        foreach (var f in functionSymbols)
-          AddAllowedChildSymbol(e, f);
-      }
-
-      // Add the appropriate parameters as children of their respective functions
+      foreach (var s in relationalOperators)
+        AddAllowedChildSymbol(s, numericalExpr);
+
+      // Functions
       foreach (var f in functionSymbols) {
         if (f is Fire)
           AddAllowedChildSymbol(f, shotPower);
         else
-          AddAllowedChildSymbol(f, numExpr);
-
+          AddAllowedChildSymbol(f, numericalExpr);
       }
-
-      // Add all Event Methods to Tank. Run and OnScannedEvent are not optional,
-      // so EmptyEvent cannot take their places
-
-      AddAllowedChildSymbol(tank, run, 0);
-      AddAllowedChildSymbol(tank, onScannedRobot, 1);
-      AddAllowedChildSymbol(tank, onBulletMissed, 2);
-      AddAllowedChildSymbol(tank, onHitByBullet, 3);
-      AddAllowedChildSymbol(tank, onHitRobot, 4);
-      AddAllowedChildSymbol(tank, onHitWall, 5);
-      AddAllowedChildSymbol(tank, onBulletHit, 6);
-      for (int i = 2; i < tank.MaximumArity; i++)
-        AddAllowedChildSymbol(tank, emptyEvent, i);
-
-      AddAllowedChildSymbol(StartSymbol, tank, 0);
       #endregion
     }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 10011)
@@ -109,14 +109,17 @@
     <Compile Include="Solution.cs" />
     <Compile Include="Symbols\Event Methods\Events\EmptyEvent.cs" />
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\ILogicalComparator.cs" />
+    <Compile Include="Symbols\Numerical Expressions\Numerical Operators\INumericalOperator.cs" />
     <Compile Include="Symbols\Numerical Methods\INumericalMethod.cs" />
+    <Compile Include="Symbols\Stat.cs" />
     <Compile Include="Symbols\Void Methods\Ahead.cs" />
     <Compile Include="Symbols\Void Methods\Back.cs" />
     <Compile Include="Symbols\Block.cs" />
-    <Compile Include="Symbols\Branches\ElseStatement.cs" />
-    <Compile Include="Symbols\Branches\IfStatement.cs" />
-    <Compile Include="Symbols\Branches\WhileLoop.cs" />
+    <Compile Include="Symbols\Statements\ElseStat.cs" />
+    <Compile Include="Symbols\Statements\IfStat.cs" />
+    <Compile Include="Symbols\Statements\WhileStat.cs" />
     <Compile Include="Symbols\Logical Expressions\BooleanTreeNode.cs" />
-    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Conjunction.cs" />
-    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Disjunction.cs" />
+    <Compile Include="Symbols\Logical Expressions\Conjunction.cs" />
+    <Compile Include="Symbols\Logical Expressions\Disjunction.cs" />
     <Compile Include="Symbols\Logical Expressions\Logical Comparators\Equal.cs" />
     <Compile Include="Symbols\Logical Expressions\Logical Comparators\GreaterThan.cs" />
@@ -124,9 +127,7 @@
     <Compile Include="Symbols\Logical Expressions\Logical Comparators\LessThan.cs" />
     <Compile Include="Symbols\Logical Expressions\Logical Comparators\LessThanOrEqual.cs" />
-    <Compile Include="Symbols\Logical Expressions\LogicalComparison.cs" />
     <Compile Include="Symbols\Logical Expressions\LogicalExpression.cs" />
     <Compile Include="Symbols\Logical Expressions\LogicalValue.cs" />
     <Compile Include="Symbols\Logical Expressions\Negation.cs" />
-    <Compile Include="Symbols\Logical Expressions\NumericalComparison.cs" />
     <Compile Include="Symbols\Numerical Expressions\NumberTreeNode.cs" />
     <Compile Include="Symbols\Numerical Expressions\Number.cs" />
@@ -137,5 +138,4 @@
     <Compile Include="Symbols\Numerical Expressions\Numerical Operators\Subtraction.cs" />
     <Compile Include="Symbols\Numerical Expressions\NumericalExpression.cs" />
-    <Compile Include="Symbols\Numerical Expressions\NumericalOperation.cs" />
     <Compile Include="Symbols\CodeNode.cs" />
     <Compile Include="Symbols\Tank.cs" />
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs	(revision 10011)
@@ -83,5 +83,5 @@
       robotList.RobocodePath = robocodeDir.Value;
 
-      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramDepthParameterName, "Maximal depth of the Robocode tank program.", new IntValue(6)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramDepthParameterName, "Maximal depth of the Robocode tank program.", new IntValue(10)));
       Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramLengthParameterName, "Maximal length of the tank program.", new IntValue(1000)));
       Parameters.Add(new ValueParameter<Grammar>(TankGrammarParameterName, "Grammar for the tank program.", new Grammar()));
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Block.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Block.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Block.cs	(revision 10011)
@@ -20,5 +20,6 @@
 #endregion
 
-
+using System;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -29,5 +30,5 @@
   public class Block : CodeNode {
     public override int MinimumArity { get { return 1; } }
-    public override int MaximumArity { get { return 10; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -38,13 +39,11 @@
 
     [StorableConstructor]
-    private Block(bool deserializing) : base(deserializing) { }
-    private Block(Block original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Block(bool deserializing) : base(deserializing) { }
+    protected Block(Block original, Cloner cloner) : base(original, cloner) { }
 
     public Block()
       : base("Block", "A group of statements.") {
-      this.Prefix = "{\r\n\t";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "{";
+      Suffix = "}";
     }
 
@@ -54,8 +53,6 @@
 
     public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/CodeNode.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/CodeNode.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/CodeNode.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -35,24 +35,14 @@
     protected CodeNode(CodeNode original, Cloner cloner)
       : base(original, cloner) {
-      this.Prefix = original.Prefix;
-      this.Suffix = original.Suffix;
+      Prefix = original.Prefix;
+      Suffix = original.Suffix;
     }
     protected CodeNode(string name, string description)
       : base(name, description) {
+      Prefix = string.Empty;
+      Suffix = string.Empty;
     }
 
-    public override IDeepCloneable Clone(Cloner cloner) {
-      throw new System.NotImplementedException();
-    }
-
-    public override int MaximumArity {
-      get { throw new System.NotImplementedException(); }
-    }
-
-    public override int MinimumArity {
-      get { throw new System.NotImplementedException(); }
-    }
-
-    public abstract string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children);
+    public abstract string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children);
   }
 }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/EmptyEvent.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/EmptyEvent.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/EmptyEvent.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private EmptyEvent(bool deserializing) : base(deserializing) { }
-    private EmptyEvent(EmptyEvent original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected EmptyEvent(bool deserializing) : base(deserializing) { }
+    protected EmptyEvent(EmptyEvent original, Cloner cloner) : base(original, cloner) { }
 
-    public EmptyEvent()
-      : base("EmptyEvent", "This is a placeholder for an empty event.") {
-      this.Prefix = "";
-      this.Suffix = "";
-    }
+    public EmptyEvent() : base("EmptyEvent", "This is a placeholder for an empty event.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,6 +47,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return "";
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return ";";
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletHit.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletHit.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletHit.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +40,13 @@
 
     [StorableConstructor]
-    private OnBulletHit(bool deserializing) : base(deserializing) { }
-    private OnBulletHit(OnBulletHit original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected OnBulletHit(bool deserializing) : base(deserializing) { }
+    protected OnBulletHit(OnBulletHit original, Cloner cloner) : base(original, cloner) { }
 
     public OnBulletHit()
       : base("OnBulletHit", "This method is called when one of your bullets hits another robot.") {
-      this.Prefix = "\r\npublic void onBulletHit(BulletHitEvent e) {\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "public void onBulletHit(BulletHitEvent e) {";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -53,9 +55,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletMissed.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletMissed.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnBulletMissed.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +40,13 @@
 
     [StorableConstructor]
-    private OnBulletMissed(bool deserializing) : base(deserializing) { }
-    private OnBulletMissed(OnBulletMissed original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected OnBulletMissed(bool deserializing) : base(deserializing) { }
+    protected OnBulletMissed(OnBulletMissed original, Cloner cloner) : base(original, cloner) { }
 
     public OnBulletMissed()
       : base("OnBulletMissed", "This method is called when one of your bullets misses, i.e. hits a wall.") {
-      this.Prefix = "\r\npublic void onBulletMissed(BulletMissedEvent e) {\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "public void onBulletMissed(BulletMissedEvent e) {";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -53,9 +55,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitByBullet.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitByBullet.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitByBullet.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +40,13 @@
 
     [StorableConstructor]
-    private OnHitByBullet(bool deserializing) : base(deserializing) { }
-    private OnHitByBullet(OnHitByBullet original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected OnHitByBullet(bool deserializing) : base(deserializing) { }
+    protected OnHitByBullet(OnHitByBullet original, Cloner cloner) : base(original, cloner) { }
 
     public OnHitByBullet()
       : base("OnHitByBullet", "This method is called when your robot is hit by a bullet.") {
-      this.Prefix = "\r\npublic void onHitByBullet(HitByBulletEvent e) {\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "public void onHitByBullet(HitByBulletEvent e) {";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -53,9 +55,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitRobot.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitRobot.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitRobot.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,13 +40,13 @@
 
     [StorableConstructor]
-    private OnHitRobot(bool deserializing) : base(deserializing) { }
-    private OnHitRobot(OnHitRobot original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected OnHitRobot(bool deserializing) : base(deserializing) { }
+    protected OnHitRobot(OnHitRobot original, Cloner cloner) : base(original, cloner) { }
 
     public OnHitRobot()
       : base("OnHitRobot", "This method is called when your robot collides with another robot.") {
-      this.Prefix = "\r\npublic void onHitRobot(HitRobotEvent e) {\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "public void onHitRobot(HitRobotEvent e) {";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -52,9 +55,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitWall.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitWall.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnHitWall.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +40,13 @@
 
     [StorableConstructor]
-    private OnHitWall(bool deserializing) : base(deserializing) { }
-    private OnHitWall(OnHitWall original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected OnHitWall(bool deserializing) : base(deserializing) { }
+    protected OnHitWall(OnHitWall original, Cloner cloner) : base(original, cloner) { }
 
     public OnHitWall()
       : base("OnHitWall", "This method is called when your robot collides with a wall.") {
-      this.Prefix = "\r\npublic void onHitWall(HitWallEvent e) {\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix = "public void onHitWall(HitWallEvent e) {";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -53,9 +55,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnScannedRobot.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnScannedRobot.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/OnScannedRobot.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,17 +40,17 @@
 
     [StorableConstructor]
-    private OnScannedRobot(bool deserializing) : base(deserializing) { }
-    private OnScannedRobot(OnScannedRobot original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected OnScannedRobot(bool deserializing) : base(deserializing) { }
+    protected OnScannedRobot(OnScannedRobot original, Cloner cloner) : base(original, cloner) { }
 
     public OnScannedRobot()
       : base("OnScannedRobot", "This method is called when your robot sees another robot, i.e. when the robot's radar scan \"hits\" another robot.") {
-      this.Prefix = "\r\npublic void onScannedRobot(ScannedRobotEvent e) {" +
-                    "\r\ndouble absoluteBearing = getHeading() + e.getBearing();" +
-                    "\r\ndouble bearingFromGun = normalRelativeAngleDegrees(absoluteBearing - getGunHeading());" +
-                    "\r\nsetTurnGunRight(bearingFromGun);\r\n";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix =
+@"public void onScannedRobot(ScannedRobotEvent e) {
+double absoluteBearing = getHeading() + e.getBearing();
+double bearingFromGun = normalRelativeAngleDegrees(absoluteBearing - getGunHeading());
+setTurnGunRight(bearingFromGun);";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -56,9 +59,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Run.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Run.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Run.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -27,5 +30,5 @@
   [StorableClass]
   public class Run : CodeNode {
-    public override int MinimumArity { get { return 2; } }
+    public override int MinimumArity { get { return 1; } }
     public override int MaximumArity { get { return 10; } }
 
@@ -37,13 +40,16 @@
 
     [StorableConstructor]
-    private Run(bool deserializing) : base(deserializing) { }
-    private Run(Run original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Run(bool deserializing) : base(deserializing) { }
+    protected Run(Run original, Cloner cloner) : base(original, cloner) { }
 
     public Run()
       : base("Run", "The main method in every robot.") {
-      this.Prefix = "\r\npublic void run() {\r\n\tsetAdjustGunForRobotTurn(true);\r\n\tturnRadarRightRadians(Double.POSITIVE_INFINITY);";
-      this.Suffix = "\r\nexecute();\r\n}\r\n";
+      Prefix =
+@"public void run() {
+setAdjustGunForRobotTurn(true);
+turnRadarRightRadians(Double.POSITIVE_INFINITY);";
+      Suffix =
+@"execute();
+}";
     }
 
@@ -52,9 +58,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/BooleanTreeNode.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/BooleanTreeNode.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/BooleanTreeNode.cs	(revision 10011)
@@ -36,13 +36,11 @@
 
     [StorableConstructor]
-    private BooleanTreeNode(bool deserializing) : base(deserializing) { }
-    private BooleanTreeNode(BooleanTreeNode original, Cloner cloner)
+    protected BooleanTreeNode(bool deserializing) : base(deserializing) { }
+    protected BooleanTreeNode(BooleanTreeNode original, Cloner cloner)
       : base(original, cloner) {
-      this.value = original.value;
+      value = original.value;
     }
 
-    public BooleanTreeNode()
-      : base(new LogicalValue()) {
-    }
+    public BooleanTreeNode() : base(new LogicalValue()) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -55,5 +53,5 @@
 
     public override void ResetLocalParameters(IRandom random) {
-      value = (bool)(random.Next(0, 1) == 1);
+      value = random.Next(0, 2) == 1;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Conjunction.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Conjunction.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Conjunction.cs	(revision 10011)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class Conjunction : CodeNode {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected Conjunction(bool deserializing) : base(deserializing) { }
+    protected Conjunction(Conjunction original, Cloner cloner) : base(original, cloner) { }
+
+    public Conjunction()
+      : base("Conjunction", "Conjunction comparator.") {
+      Prefix = "(";
+      Suffix = ")";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Conjunction(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" && ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Disjunction.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Disjunction.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Disjunction.cs	(revision 10011)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class Disjunction : CodeNode {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected Disjunction(bool deserializing) : base(deserializing) { }
+    protected Disjunction(Disjunction original, Cloner cloner) : base(original, cloner) { }
+
+    public Disjunction()
+      : base("Disjunction", "Disjunction comparator.") {
+      Prefix = "(";
+      Suffix = ")";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Disjunction(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = string.Join(" || ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs	(revision 10008)
+++ 	(revision )
@@ -1,58 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class Conjunction : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    private Conjunction(bool deserializing) : base(deserializing) { }
-    private Conjunction(Conjunction original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public Conjunction()
-      : base("Conjunction", "Conjunction comparator.") {
-      this.Prefix = "&&";
-      this.Suffix = "";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Conjunction(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs	(revision 10008)
+++ 	(revision )
@@ -1,58 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class Disjunction : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    private Disjunction(bool deserializing) : base(deserializing) { }
-    private Disjunction(Disjunction original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public Disjunction()
-      : base("Disjunction", "Disjunction comparator.") {
-      this.Prefix = "||";
-      this.Suffix = "";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Disjunction(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Equal.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Equal.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/Equal.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +27,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Equal : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Equal : CodeNode, ILogicalComparator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
 
     [Storable]
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private Equal(bool deserializing) : base(deserializing) { }
-    private Equal(Equal original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Equal(bool deserializing) : base(deserializing) { }
+    protected Equal(Equal original, Cloner cloner) : base(original, cloner) { }
 
-    public Equal()
-      : base("Equal", "Equal comparator.") {
-      this.Prefix = "==";
-      this.Suffix = "";
-    }
+    public Equal() : base("Equal", "Equal comparator.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,6 +47,24 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode lhs = null, rhs = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: lhs = enumerator.Current; break;
+          case 2: rhs = enumerator.Current; break;
+          default: throw new System.Exception("Unexpected number of children. Expected 2 children.");
+        }
+      }
+      if (childCount < 2) throw new System.Exception("Unexpected number of children. Expected 2 children.");
+
+      var result = new[] {
+        ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
+        ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
+      };
+
+      return result[0] + " == " + result[1];
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +27,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class GreaterThan : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class GreaterThan : CodeNode, ILogicalComparator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
 
     [Storable]
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private GreaterThan(bool deserializing) : base(deserializing) { }
-    private GreaterThan(GreaterThan original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected GreaterThan(bool deserializing) : base(deserializing) { }
+    protected GreaterThan(GreaterThan original, Cloner cloner) : base(original, cloner) { }
 
-    public GreaterThan()
-      : base("GreaterThan", "GreaterThan comparator.") {
-      this.Prefix = ">";
-      this.Suffix = "";
-    }
+    public GreaterThan() : base("GreaterThan", "GreaterThan comparator.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,6 +47,24 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode lhs = null, rhs = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: lhs = enumerator.Current; break;
+          case 2: rhs = enumerator.Current; break;
+          default: throw new System.Exception("Unexpected number of children. Expected 2 children.");
+        }
+      }
+      if (childCount < 2) throw new System.Exception("Unexpected number of children. Expected 2 children.");
+
+      var result = new[] {
+        ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
+        ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
+      };
+
+      return result[0] + " > " + result[1];
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +27,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class GreaterThanOrEqual : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class GreaterThanOrEqual : CodeNode, ILogicalComparator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
 
     [Storable]
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private GreaterThanOrEqual(bool deserializing) : base(deserializing) { }
-    private GreaterThanOrEqual(GreaterThanOrEqual original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected GreaterThanOrEqual(bool deserializing) : base(deserializing) { }
+    protected GreaterThanOrEqual(GreaterThanOrEqual original, Cloner cloner) : base(original, cloner) { }
 
-    public GreaterThanOrEqual()
-      : base("GreaterThanOrEqual", "GreaterThanOrEqual comparator.") {
-      this.Prefix = ">=";
-      this.Suffix = "";
-    }
+    public GreaterThanOrEqual() : base("GreaterThanOrEqual", "GreaterThanOrEqual comparator.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,6 +47,24 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode lhs = null, rhs = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: lhs = enumerator.Current; break;
+          case 2: rhs = enumerator.Current; break;
+          default: throw new System.Exception("Unexpected number of children. Expected 2 children.");
+        }
+      }
+      if (childCount < 2) throw new System.Exception("Unexpected number of children. Expected 2 children.");
+
+      var result = new[] {
+        ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
+        ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
+      };
+
+      return result[0] + " >= " + result[1];
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/ILogicalComparator.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/ILogicalComparator.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/ILogicalComparator.cs	(revision 10011)
@@ -0,0 +1,24 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Robocode {
+  public interface ILogicalComparator { }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThan.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThan.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThan.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +27,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class LessThan : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class LessThan : CodeNode, ILogicalComparator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
 
     [Storable]
@@ -37,15 +38,8 @@
 
     [StorableConstructor]
-    private LessThan(bool deserializing) : base(deserializing) { }
-    private LessThan(LessThan original, Cloner cloner)
-      : base(original, cloner) {
+    protected LessThan(bool deserializing) : base(deserializing) { }
+    protected LessThan(LessThan original, Cloner cloner) : base(original, cloner) { }
 
-    }
-
-    public LessThan()
-      : base("LessThan", "LessThan comparator.") {
-      this.Prefix = "<";
-      this.Suffix = "";
-    }
+    public LessThan() : base("LessThan", "LessThan comparator.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -53,6 +47,24 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode lhs = null, rhs = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: lhs = enumerator.Current; break;
+          case 2: rhs = enumerator.Current; break;
+          default: throw new System.Exception("Unexpected number of children. Expected 2 children.");
+        }
+      }
+      if (childCount < 2) throw new System.Exception("Unexpected number of children. Expected 2 children.");
+
+      var result = new[] {
+        ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
+        ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
+      };
+
+      return result[0] + " < " + result[1];
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +27,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class LessThanOrEqual : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class LessThanOrEqual : CodeNode, ILogicalComparator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
 
     [Storable]
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private LessThanOrEqual(bool deserializing) : base(deserializing) { }
-    private LessThanOrEqual(LessThanOrEqual original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected LessThanOrEqual(bool deserializing) : base(deserializing) { }
+    protected LessThanOrEqual(LessThanOrEqual original, Cloner cloner) : base(original, cloner) { }
 
-    public LessThanOrEqual()
-      : base("LessThanOrEqual", "LessThanOrEqual comparator.") {
-      this.Prefix = "<=";
-      this.Suffix = "";
-    }
+    public LessThanOrEqual() : base("LessThanOrEqual", "LessThanOrEqual comparator.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,6 +47,24 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + " " + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode lhs = null, rhs = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: lhs = enumerator.Current; break;
+          case 2: rhs = enumerator.Current; break;
+          default: throw new System.Exception("Unexpected number of children. Expected 2 children.");
+        }
+      }
+      if (childCount < 2) throw new System.Exception("Unexpected number of children. Expected 2 children.");
+
+      var result = new[] {
+        ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
+        ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
+      };
+
+      return result[0] + " <= " + result[1];
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalComparison.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalComparison.cs	(revision 10008)
+++ 	(revision )
@@ -1,86 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class LogicalComparison : CodeNode {
-    public override int MinimumArity { get { return 3; } }
-    public override int MaximumArity { get { return 3; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    private LogicalComparison(bool deserializing) : base(deserializing) { }
-    private LogicalComparison(LogicalComparison original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public LogicalComparison()
-      : base("LogicalComparison", "A LogicalComparison.") {
-      this.Prefix = "(";
-      this.Suffix = ")";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new LogicalComparison(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      ISymbolicExpressionTreeNode condition = null, lhs = null, rhs = null;
-      var enumerator = children.GetEnumerator();
-      int childCount = 0;
-      while (enumerator.MoveNext()) {
-        childCount++;
-        switch (childCount) {
-          case 1: condition = enumerator.Current; break;
-          case 2: lhs = enumerator.Current; break;
-          case 3: rhs = enumerator.Current; break;
-          default: throw new System.Exception("Unexpected number of children. Expected 3 children.");
-        }
-      }
-      if (childCount < 3) throw new System.Exception("Unexpected number of children. Expected 3 children.");
-
-      if (!(condition.Symbol is Conjunction || condition.Symbol is Disjunction))
-        throw new System.Exception("Unexpected first child for LogicalComparison of type: " +
-            condition.GetType().ToString() + ". Expected " + typeof(Conjunction).ToString() +
-            " or " + typeof(Disjunction).ToString() + ".");
-
-      // TODO Check children 2 & 3 for correct types
-
-      string[] result = new string[]
-            {
-                ((CodeNode)condition.Symbol).Interpret(condition, condition.Subtrees),
-                ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
-                ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
-            };
-
-      return this.Prefix + " " + result[1] + " " + result[0] + " " + result[2] + " " + this.Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalExpression.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalExpression.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalExpression.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private LogicalExpression(bool deserializing) : base(deserializing) { }
-    private LogicalExpression(LogicalExpression original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected LogicalExpression(bool deserializing) : base(deserializing) { }
+    protected LogicalExpression(LogicalExpression original, Cloner cloner) : base(original, cloner) { }
 
-    public LogicalExpression()
-      : base("LogicalExpression", "A LogicalExpression.") {
-      this.Prefix = "";
-      this.Suffix = "";
-    }
+    public LogicalExpression() : base("LogicalExpression", "A logical expression.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,21 +47,20 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("LogicalExpression was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("LogicalExpression was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is LogicalValue || symbol is LogicalComparison ||
-          symbol is NumericalComparison || symbol is Negation))
-        throw new System.Exception("LogicalExpression was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(LogicalValue).ToString() + " or " +
-            typeof(LogicalComparison).ToString() + " or " + typeof(NumericalComparison).ToString() + " or " +
-            typeof(Negation).ToString() + ".");
+      if (!(symbol is LogicalValue || symbol is Conjunction || symbol is Disjunction || symbol is Negation))
+        throw new System.Exception("LogicalExpression was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(LogicalValue)
+                                           + " or " + typeof(Conjunction)
+                                           + " or " + typeof(Disjunction)
+                                           + " or " + typeof(Negation) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("LogicalExpression was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return result;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalValue.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalValue.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/LogicalValue.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,17 +38,10 @@
 
     [StorableConstructor]
-    private LogicalValue(bool deserializing) : base(deserializing) { }
-    private LogicalValue(LogicalValue original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected LogicalValue(bool deserializing) : base(deserializing) { }
+    protected LogicalValue(LogicalValue original, Cloner cloner) : base(original, cloner) { }
 
-    public LogicalValue()
-      : base("LogicalValue", "A LogicalValue.") {
-      this.Prefix = "";
-      this.Suffix = "";
-    }
+    public LogicalValue() : base("LogicalValue", "A logical value.") { }
 
     public override ISymbolicExpressionTreeNode CreateTreeNode() {
-
       return new BooleanTreeNode();
     }
@@ -57,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return " " + ((BooleanTreeNode)node).Value.ToString().ToLower() + " ";
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return ((BooleanTreeNode)node).Value.ToString().ToLower();
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Negation.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Negation.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/Negation.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,13 +38,11 @@
 
     [StorableConstructor]
-    private Negation(bool deserializing) : base(deserializing) { }
-    private Negation(Negation original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Negation(bool deserializing) : base(deserializing) { }
+    protected Negation(Negation original, Cloner cloner) : base(original, cloner) { }
 
     public Negation()
-      : base("Negation", "A Negation.") {
-      this.Prefix = "!(";
-      this.Suffix = ")";
+      : base("Negation", "A negation.") {
+      Prefix = "!(";
+      Suffix = ")";
     }
 
@@ -52,20 +51,21 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
       if (!enumerator.MoveNext()) throw new System.Exception("Negation was not given a child.");
 
       var symbol = enumerator.Current.Symbol;
-      if (!(symbol is LogicalValue || symbol is LogicalComparison ||
-          symbol is NumericalComparison || symbol is Negation))
-        throw new System.Exception("Negation was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(LogicalValue).ToString() + " or " +
-            typeof(LogicalComparison).ToString() + " or " + typeof(NumericalComparison).ToString() + " or " +
-            typeof(Negation).ToString() + ".");
+      if (!(symbol is LogicalValue || symbol is Conjunction || symbol is Disjunction || symbol is Negation || symbol is ILogicalComparator))
+        throw new System.Exception("Negation was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(LogicalValue)
+                                           + " or " + typeof(Conjunction)
+                                           + " or " + typeof(Disjunction)
+                                           + " or " + typeof(Negation)
+                                           + " or " + typeof(ILogicalComparator) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("LogicalExpression was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/NumericalComparison.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Logical Expressions/NumericalComparison.cs	(revision 10008)
+++ 	(revision )
@@ -1,90 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class NumericalComparison : CodeNode {
-    public override int MinimumArity { get { return 3; } }
-    public override int MaximumArity { get { return 3; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    private NumericalComparison(bool deserializing) : base(deserializing) { }
-    private NumericalComparison(NumericalComparison original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public NumericalComparison()
-      : base("NumericalComparison", "A NumericalComparison.") {
-      this.Prefix = "(";
-      this.Suffix = ")";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new NumericalComparison(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      ISymbolicExpressionTreeNode condition = null, lhs = null, rhs = null;
-      var enumerator = children.GetEnumerator();
-      int childCount = 0;
-      while (enumerator.MoveNext()) {
-        childCount++;
-        switch (childCount) {
-          case 1: condition = enumerator.Current; break;
-          case 2: lhs = enumerator.Current; break;
-          case 3: rhs = enumerator.Current; break;
-          default: throw new System.Exception("Unexpected number of children. Expected 3 children.");
-        }
-      }
-      if (childCount < 3) throw new System.Exception("Unexpected number of children. Expected 3 children.");
-
-      if (!(condition.Symbol is Equal || condition.Symbol is GreaterThan ||
-          condition.Symbol is GreaterThanOrEqual || condition.Symbol is LessThan || condition.Symbol is LessThanOrEqual))
-        throw new System.Exception("Unexpected first child for NumericalComparison of type: " +
-            condition.GetType().ToString() + ". Expected " + typeof(Equal).ToString() +
-            " or " + typeof(GreaterThan).ToString() +
-            " or " + typeof(GreaterThanOrEqual).ToString() +
-            " or " + typeof(LessThan).ToString() +
-            " or " + typeof(LessThanOrEqual).ToString() + ".");
-
-      // TODO Check children 2 & 3 for correct types
-
-      string[] result = new string[]
-            {
-                ((CodeNode)condition.Symbol).Interpret(condition, condition.Subtrees),
-                ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
-                ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
-            };
-
-      return this.Prefix + " " + result[1] + " " + result[0] + " " + result[2] + " " + this.Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Number.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Number.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Number.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,17 +38,10 @@
 
     [StorableConstructor]
-    private Number(bool deserializing) : base(deserializing) { }
-    private Number(Number original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Number(bool deserializing) : base(deserializing) { }
+    protected Number(Number original, Cloner cloner) : base(original, cloner) { }
 
-    public Number()
-      : base("Number", "A Number.") {
-      this.Prefix = "";
-      this.Suffix = "";
-    }
+    public Number() : base("Number", "A number.") { }
 
     public override ISymbolicExpressionTreeNode CreateTreeNode() {
-
       return new NumberTreeNode();
     }
@@ -57,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return " " + ((NumberTreeNode)node).Value + " ";
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return ((NumberTreeNode)node).Value.ToString();
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumberTreeNode.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumberTreeNode.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumberTreeNode.cs	(revision 10011)
@@ -36,13 +36,11 @@
 
     [StorableConstructor]
-    private NumberTreeNode(bool deserializing) : base(deserializing) { }
-    private NumberTreeNode(NumberTreeNode original, Cloner cloner)
+    protected NumberTreeNode(bool deserializing) : base(deserializing) { }
+    protected NumberTreeNode(NumberTreeNode original, Cloner cloner)
       : base(original, cloner) {
       this.value = original.value;
     }
 
-    public NumberTreeNode()
-      : base(new Number()) {
-    }
+    public NumberTreeNode() : base(new Number()) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Addition.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Addition.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Addition.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +29,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Addition : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Addition : CodeNode, INumericalOperator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -37,14 +40,11 @@
 
     [StorableConstructor]
-    private Addition(bool deserializing) : base(deserializing) { }
-    private Addition(Addition original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected Addition(bool deserializing) : base(deserializing) { }
+    protected Addition(Addition original, Cloner cloner) : base(original, cloner) { }
 
     public Addition()
       : base("Addition", "Addition operator.") {
-      this.Prefix = "+";
-      this.Suffix = "";
+      Prefix = "(";
+      Suffix = ")";
     }
 
@@ -53,6 +53,10 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" + ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Division.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Division.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Division.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +29,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Division : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Division : CodeNode, INumericalOperator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -37,14 +40,11 @@
 
     [StorableConstructor]
-    private Division(bool deserializing) : base(deserializing) { }
-    private Division(Division original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected Division(bool deserializing) : base(deserializing) { }
+    protected Division(Division original, Cloner cloner) : base(original, cloner) { }
 
     public Division()
       : base("Division", "Division operator.") {
-      this.Prefix = "/";
-      this.Suffix = "";
+      Prefix = "(";
+      Suffix = ")";
     }
 
@@ -53,6 +53,10 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" / ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/INumericalOperator.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/INumericalOperator.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/INumericalOperator.cs	(revision 10011)
@@ -0,0 +1,24 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Robocode {
+  public interface INumericalOperator { }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +29,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Modulus : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Modulus : CodeNode, INumericalOperator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -37,14 +40,11 @@
 
     [StorableConstructor]
-    private Modulus(bool deserializing) : base(deserializing) { }
-    private Modulus(Modulus original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected Modulus(bool deserializing) : base(deserializing) { }
+    protected Modulus(Modulus original, Cloner cloner) : base(original, cloner) { }
 
     public Modulus()
       : base("Modulus", "Modulus operator.") {
-      this.Prefix = "%";
-      this.Suffix = "";
+      Prefix = "(";
+      Suffix = ")";
     }
 
@@ -53,6 +53,10 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" % ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +29,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Multiplication : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Multiplication : CodeNode, INumericalOperator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -37,14 +40,11 @@
 
     [StorableConstructor]
-    private Multiplication(bool deserializing) : base(deserializing) { }
-    private Multiplication(Multiplication original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected Multiplication(bool deserializing) : base(deserializing) { }
+    protected Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { }
 
     public Multiplication()
       : base("Multiplication", "Multiplication operator.") {
-      this.Prefix = "*";
-      this.Suffix = "";
+      Prefix = "(";
+      Suffix = ")";
     }
 
@@ -53,6 +53,10 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" * ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs	(revision 10011)
@@ -20,4 +20,7 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -26,7 +29,7 @@
 namespace HeuristicLab.Problems.Robocode {
   [StorableClass]
-  public class Subtraction : CodeNode {
-    public override int MinimumArity { get { return 0; } }
-    public override int MaximumArity { get { return 0; } }
+  public class Subtraction : CodeNode, INumericalOperator {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return byte.MaxValue; } }
 
     [Storable]
@@ -37,14 +40,11 @@
 
     [StorableConstructor]
-    private Subtraction(bool deserializing) : base(deserializing) { }
-    private Subtraction(Subtraction original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected Subtraction(bool deserializing) : base(deserializing) { }
+    protected Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { }
 
     public Subtraction()
       : base("Subtraction", "Subtraction operator.") {
-      this.Prefix = "-";
-      this.Suffix = "";
+      Prefix = "(";
+      Suffix = ")";
     }
 
@@ -53,6 +53,10 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      if (children.Count() < 2)
+        throw new ArgumentException("Expected at leaset 2 children.", "children");
+
+      string result = string.Join(" - ", children.Select(c => ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalExpression.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalExpression.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalExpression.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,14 +38,8 @@
 
     [StorableConstructor]
-    private NumericalExpression(bool deserializing) : base(deserializing) { }
-    private NumericalExpression(NumericalExpression original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected NumericalExpression(bool deserializing) : base(deserializing) { }
+    protected NumericalExpression(NumericalExpression original, Cloner cloner) : base(original, cloner) { }
 
-    public NumericalExpression()
-      : base("NumericalExpression", "A NumericalExpression.") {
-      this.Prefix = "";
-      this.Suffix = "";
-    }
+    public NumericalExpression() : base("NumericalExpression", "A numerical expression.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -52,20 +47,19 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("NumericalExpression was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("NumericalExpression was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol.GetType().GetInterface(typeof(INumericalMethod).FullName) != null))
-        throw new System.Exception("NumericalExpression was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(INumericalMethod).ToString() + ".");
+      if (!(symbol is Number || symbol is INumericalMethod || symbol is INumericalOperator))
+        throw new System.Exception("NumericalExpression was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(Number)
+                                           + " or " + typeof(INumericalMethod)
+                                           + " or " + typeof(INumericalOperator) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("NumericalExpression was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return result;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalOperation.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/NumericalOperation.cs	(revision 10008)
+++ 	(revision )
@@ -1,90 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class NumericalOperation : CodeNode {
-    public override int MinimumArity { get { return 3; } }
-    public override int MaximumArity { get { return 3; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    private NumericalOperation(bool deserializing) : base(deserializing) { }
-    private NumericalOperation(NumericalOperation original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public NumericalOperation()
-      : base("NumericalOperation", "An expression consisting of two numbers and an operator.") {
-      this.Prefix = "(";
-      this.Suffix = ")";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new NumericalOperation(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      ISymbolicExpressionTreeNode condition = null, lhs = null, rhs = null;
-      var enumerator = children.GetEnumerator();
-      int childCount = 0;
-      while (enumerator.MoveNext()) {
-        childCount++;
-        switch (childCount) {
-          case 1: condition = enumerator.Current; break;
-          case 2: lhs = enumerator.Current; break;
-          case 3: rhs = enumerator.Current; break;
-          default: throw new System.Exception("Unexpected number of children. Expected 3 children.");
-        }
-      }
-      if (childCount < 3) throw new System.Exception("Unexpected number of children. Expected 3 children.");
-
-      if (!(condition.Symbol is Addition || condition.Symbol is Division ||
-          condition.Symbol is Modulus || condition.Symbol is Multiplication || condition.Symbol is Subtraction))
-        throw new System.Exception("Unexpected first child for NumericalOperation of type: " +
-            condition.GetType().ToString() + ". Expected " + typeof(Addition).ToString() +
-            " or " + typeof(Division).ToString() +
-            " or " + typeof(Modulus).ToString() +
-            " or " + typeof(Multiplication).ToString() +
-            " or " + typeof(Subtraction).ToString() + ".");
-
-      // TODO Check children 2 & 3 for correct types
-
-      string[] result = new string[]
-            {
-                ((CodeNode)condition.Symbol).Interpret(condition, condition.Subtrees),
-                ((CodeNode)lhs.Symbol).Interpret(lhs, lhs.Subtrees),
-                ((CodeNode)rhs.Symbol).Interpret(rhs, rhs.Subtrees)
-            };
-
-      return this.Prefix + " " + result[1] + " " + result[0] + " " + result[2] + " " + this.Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPower.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPower.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPower.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -37,12 +38,8 @@
 
     [StorableConstructor]
-    private ShotPower(bool deserializing) : base(deserializing) { }
-    private ShotPower(ShotPower original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected ShotPower(bool deserializing) : base(deserializing) { }
+    protected ShotPower(ShotPower original, Cloner cloner) : base(original, cloner) { }
 
-    public ShotPower()
-      : base("ShotPower", "The power of a shot between 0.1 and 3.") {
-    }
+    public ShotPower() : base("ShotPower", "The power of a shot between 0.1 and 3.") { }
 
     public override ISymbolicExpressionTreeNode CreateTreeNode() {
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return " " + ((ShotPowerTreeNode)node).Value + " ";
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return ((ShotPowerTreeNode)node).Value.ToString();
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPowerTreeNode.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPowerTreeNode.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Expressions/ShotPowerTreeNode.cs	(revision 10011)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -36,13 +37,11 @@
 
     [StorableConstructor]
-    private ShotPowerTreeNode(bool deserializing) : base(deserializing) { }
-    private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner)
+    protected ShotPowerTreeNode(bool deserializing) : base(deserializing) { }
+    protected ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner)
       : base(original, cloner) {
       this.value = original.value;
     }
 
-    public ShotPowerTreeNode()
-      : base(new ShotPower()) {
-    }
+    public ShotPowerTreeNode() : base(new ShotPower()) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -55,5 +54,5 @@
 
     public override void ResetLocalParameters(IRandom random) {
-      value = (double)random.Next(1, 3);
+      value = Math.Max(0.1, random.NextDouble() * 3);
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetEnergy.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetEnergy.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetEnergy.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private GetEnergy(bool deserializing) : base(deserializing) { }
-    private GetEnergy(GetEnergy original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected GetEnergy(bool deserializing) : base(deserializing) { }
+    protected GetEnergy(GetEnergy original, Cloner cloner) : base(original, cloner) { }
 
     public GetEnergy()
       : base("GetEnergy", "Returns the robot's current energy.") {
-      this.Prefix = "getEnergy(";
-      this.Suffix = ")";
+      Prefix = "getEnergy(";
+      Suffix = ")";
     }
 
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetGunHeading.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetGunHeading.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetGunHeading.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private GetGunHeading(bool deserializing) : base(deserializing) { }
-    private GetGunHeading(GetGunHeading original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected GetGunHeading(bool deserializing) : base(deserializing) { }
+    protected GetGunHeading(GetGunHeading original, Cloner cloner) : base(original, cloner) { }
 
     public GetGunHeading()
       : base("GetGunHeading", "Returns the direction that the robot's gun is facing, in degrees.") {
-      this.Prefix = "getGunHeading(";
-      this.Suffix = ")";
+      Prefix = "getGunHeading(";
+      Suffix = ")";
     }
 
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetHeading.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetHeading.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetHeading.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private GetHeading(bool deserializing) : base(deserializing) { }
-    private GetHeading(GetHeading original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected GetHeading(bool deserializing) : base(deserializing) { }
+    protected GetHeading(GetHeading original, Cloner cloner) : base(original, cloner) { }
 
     public GetHeading()
       : base("GetHeading", "Returns the direction that the robot's body is facing, in degrees.") {
-      this.Prefix = "getHeading(";
-      this.Suffix = ")";
+      Prefix = "getHeading(";
+      Suffix = ")";
     }
 
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetRadarHeading.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetRadarHeading.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetRadarHeading.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,13 +38,11 @@
 
     [StorableConstructor]
-    private GetRadarHeading(bool deserializing) : base(deserializing) { }
-    private GetRadarHeading(GetRadarHeading original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected GetRadarHeading(bool deserializing) : base(deserializing) { }
+    protected GetRadarHeading(GetRadarHeading original, Cloner cloner) : base(original, cloner) { }
 
     public GetRadarHeading()
       : base("GetRadarHeading", "Returns the direction that the robot's radar is facing, in degrees.") {
-      this.Prefix = "getRadarHeading(";
-      this.Suffix = ")";
+      Prefix = "getRadarHeading(";
+      Suffix = ")";
     }
 
@@ -53,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetX.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetX.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetX.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private GetX(bool deserializing) : base(deserializing) { }
-    private GetX(GetX original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected GetX(bool deserializing) : base(deserializing) { }
+    protected GetX(GetX original, Cloner cloner) : base(original, cloner) { }
 
     public GetX()
       : base("GetX", "Returns the X position of the robot. (0,0) is at the bottom left of the battlefield.") {
-      this.Prefix = "getX(";
-      this.Suffix = ")";
+      Prefix = "getX(";
+      Suffix = ")";
     }
 
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetY.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetY.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/GetY.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private GetY(bool deserializing) : base(deserializing) { }
-    private GetY(GetY original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected GetY(bool deserializing) : base(deserializing) { }
+    protected GetY(GetY original, Cloner cloner) : base(original, cloner) { }
 
     public GetY()
       : base("GetY", "Returns the Y position of the robot. (0,0) is at the bottom left of the battlefield.") {
-      this.Prefix = "getY(";
-      this.Suffix = ")";
+      Prefix = "getY(";
+      Suffix = ")";
     }
 
@@ -54,6 +51,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return this.Prefix + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return Prefix + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/INumericalMethod.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/INumericalMethod.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Numerical Methods/INumericalMethod.cs	(revision 10011)
@@ -20,8 +20,5 @@
 #endregion
 
-
-
 namespace HeuristicLab.Problems.Robocode {
-  public interface INumericalMethod {
-  }
+  public interface INumericalMethod { }
 }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Program.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Program.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Program.cs	(revision 10011)
@@ -32,8 +32,6 @@
 
     [StorableConstructor]
-    private Program(bool deserializing) : base(deserializing) { }
-    private Program(Program original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Program(bool deserializing) : base(deserializing) { }
+    protected Program(Program original, Cloner cloner) : base(original, cloner) { }
 
     public Program()
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Stat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Stat.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Stat.cs	(revision 10011)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class Stat : CodeNode {
+    public override int MinimumArity { get { return 1; } }
+    public override int MaximumArity { get { return 1; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected Stat(bool deserializing) : base(deserializing) { }
+    protected Stat(Stat original, Cloner cloner) : base(original, cloner) { }
+
+    public Stat() : base("Statement", "A statement.") { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Stat(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs	(revision 10011)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class ElseStat : CodeNode {
+    public override int MinimumArity { get { return 1; } }
+    public override int MaximumArity { get { return 1; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected ElseStat(bool deserializing) : base(deserializing) { }
+    protected ElseStat(ElseStat original, Cloner cloner) : base(original, cloner) { }
+
+    public ElseStat()
+      : base("ElseStatement", "An ElseStatement.") {
+      Prefix = "else";
+      Suffix = "";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ElseStat(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return string.IsNullOrEmpty(result)
+        ? string.Empty
+        : Prefix + Environment.NewLine + result + Environment.NewLine + Suffix;
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs	(revision 10011)
@@ -0,0 +1,68 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class IfStat : CodeNode {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 3; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected IfStat(bool deserializing) : base(deserializing) { }
+    protected IfStat(IfStat original, Cloner cloner) : base(original, cloner) { }
+
+    public IfStat()
+      : base("IfStatement", "An if statement.") {
+      Prefix = "if (";
+      Suffix = ")";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IfStat(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string condition = string.Empty, ifTrue = string.Empty, ifElse = string.Empty;
+      foreach (var c in children) {
+        if (c.Symbol is LogicalExpression)
+          condition = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+        else if (c.Symbol is Stat)
+          ifTrue = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+        else if (c.Symbol is ElseStat || c.Symbol is EmptyEvent || c.Symbol is DoNothing)
+          ifElse = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+        else throw new ArgumentException("Unexpected children.", "children");
+      }
+      return Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine + ifElse + Environment.NewLine;
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/WhileStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/WhileStat.cs	(revision 10011)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/WhileStat.cs	(revision 10011)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class WhileStat : CodeNode {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 2; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected WhileStat(bool deserializing) : base(deserializing) { }
+    protected WhileStat(WhileStat original, Cloner cloner) : base(original, cloner) { }
+
+    public WhileStat()
+      : base("WhileStat", "A while statement.") {
+      Prefix = "while (";
+      Suffix = ")";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new WhileStat(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string condition = string.Empty, ifTrue = string.Empty;
+      foreach (var c in children) {
+        if (c.Symbol is LogicalExpression)
+          condition = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+        else if (c.Symbol is Stat || c.Symbol is EmptyEvent || c.Symbol is DoNothing)
+          ifTrue = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+        else throw new ArgumentException("Unexpected children.", "children");
+      }
+      return Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine;
+    }
+  }
+}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Tank.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Tank.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Tank.cs	(revision 10011)
@@ -20,5 +20,7 @@
 #endregion
 
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -28,5 +30,5 @@
   [StorableClass]
   public class Tank : CodeNode {
-    public override int MinimumArity { get { return 7; } }
+    public override int MinimumArity { get { return 2; } }
     public override int MaximumArity { get { return 7; } }
 
@@ -38,20 +40,19 @@
 
     [StorableConstructor]
-    private Tank(bool deserializing) : base(deserializing) { }
-    private Tank(Tank original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Tank(bool deserializing) : base(deserializing) { }
+    protected Tank(Tank original, Cloner cloner) : base(original, cloner) { }
 
     public Tank()
       : base("Tank", "The root of a Robocode Tank program.") {
-      this.Prefix = "package Evaluation;" +
-                    "\r\nimport robocode.*;" +
-                    "\r\nimport robocode.Robot;" +
-                    "\r\nimport robocode.util.*;" +
-                    "\r\nimport static robocode.util.Utils.normalRelativeAngleDegrees;" +
-                    "\r\nimport java.awt.*;" +
-                    "\r\n\r\n" +
-                    "\r\npublic class output extends AdvancedRobot {\r\n";
-      this.Suffix = "\r\n}";
+      Prefix =
+@"package Evaluation;
+import robocode.*;
+import robocode.Robot;
+import robocode.util.*;
+import static robocode.util.Utils.normalRelativeAngleDegrees;
+import java.awt.*;
+
+public class output extends AdvancedRobot {";
+      Suffix = "}";
     }
 
@@ -60,9 +61,7 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = "";
-      foreach (ISymbolicExpressionTreeNode c in children)
-        result += "\r\n" + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-      return this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
+      return Prefix + result + Environment.NewLine + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Ahead.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Ahead.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Ahead.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,13 +38,11 @@
 
     [StorableConstructor]
-    private Ahead(bool deserializing) : base(deserializing) { }
-    private Ahead(Ahead original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected Ahead(bool deserializing) : base(deserializing) { }
+    protected Ahead(Ahead original, Cloner cloner) : base(original, cloner) { }
 
     public Ahead()
       : base("Ahead", "Immediately moves your robot ahead (forward) by distance measured in pixels.") {
-      this.Prefix = "setAhead(";
-      this.Suffix = ");";
+      Prefix = "setAhead(";
+      Suffix = ");";
     }
 
@@ -53,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("Ahead was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("Ahead was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("Ahead was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("Ahead was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("Ahead was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Back.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Back.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Back.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,12 +38,11 @@
 
     [StorableConstructor]
-    private Back(bool deserializing) : base(deserializing) { }
-    private Back(Back original, Cloner cloner)
-      : base(original, cloner) { }
+    protected Back(bool deserializing) : base(deserializing) { }
+    protected Back(Back original, Cloner cloner) : base(original, cloner) { }
 
     public Back()
       : base("Back", "Immediately moves your robot backward by distance measured in pixels.") {
-      this.Prefix = "setBack(";
-      this.Suffix = ");";
+      Prefix = "setBack(";
+      Suffix = ");";
     }
 
@@ -52,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("Back was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("Back was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("Back was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("Back was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("Back was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/DoNothing.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/DoNothing.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/DoNothing.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,12 +38,8 @@
 
     [StorableConstructor]
-    private DoNothing(bool deserializing) : base(deserializing) { }
-    private DoNothing(DoNothing original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected DoNothing(bool deserializing) : base(deserializing) { }
+    protected DoNothing(DoNothing original, Cloner cloner) : base(original, cloner) { }
 
-    public DoNothing()
-      : base("DoNothing", "Do nothing this turn, meaning that the robot will skip it's turn.") {
-    }
+    public DoNothing() : base("DoNothing", "Do nothing this turn, meaning that the robot will skip it's turn.") { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -51,6 +47,6 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
-      return "";
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      return ";";
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Fire.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Fire.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Fire.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,12 +38,11 @@
 
     [StorableConstructor]
-    private Fire(bool deserializing) : base(deserializing) { }
-    private Fire(Fire original, Cloner cloner)
-      : base(original, cloner) { }
+    protected Fire(bool deserializing) : base(deserializing) { }
+    protected Fire(Fire original, Cloner cloner) : base(original, cloner) { }
 
     public Fire()
       : base("Fire", "Immediately fires a bullet.") {
-      this.Prefix = "setFire(";
-      this.Suffix = ");";
+      Prefix = "setFire(";
+      Suffix = ");";
     }
 
@@ -52,18 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("Fire was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("Fire was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
       if (!(symbol is ShotPower))
-        throw new System.Exception("Fire was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(ShotPower).ToString() + ".");
+        throw new System.Exception("Fire was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(ShotPower) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("Fire was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunLeft.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunLeft.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunLeft.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,13 +38,11 @@
 
     [StorableConstructor]
-    private TurnGunLeft(bool deserializing) : base(deserializing) { }
-    private TurnGunLeft(TurnGunLeft original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected TurnGunLeft(bool deserializing) : base(deserializing) { }
+    protected TurnGunLeft(TurnGunLeft original, Cloner cloner) : base(original, cloner) { }
 
     public TurnGunLeft()
       : base("TurnGunLeft", "Immediately turns the robot's gun to the left by degrees.") {
-      this.Prefix = "setTurnGunLeft(";
-      this.Suffix = ");";
+      Prefix = "setTurnGunLeft(";
+      Suffix = ");";
     }
 
@@ -53,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnGunLeft was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnGunLeft was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnGunLeft was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnGunLeft was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnGunLeft was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunRight.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunRight.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunRight.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private TurnGunRight(bool deserializing) : base(deserializing) { }
-    private TurnGunRight(TurnGunRight original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected TurnGunRight(bool deserializing) : base(deserializing) { }
+    protected TurnGunRight(TurnGunRight original, Cloner cloner) : base(original, cloner) { }
 
     public TurnGunRight()
       : base("TurnGunRight", "Immediately turns the robot's gun to the right by degrees.") {
-      this.Prefix = "setTurnGunRight(";
-      this.Suffix = ");";
+      Prefix = "setTurnGunRight(";
+      Suffix = ");";
     }
 
@@ -54,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnGunRight was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnGunRight was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnGunRight was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnGunRight was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnGunRight was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnLeft.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnLeft.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnLeft.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,13 +38,11 @@
 
     [StorableConstructor]
-    private TurnLeft(bool deserializing) : base(deserializing) { }
-    private TurnLeft(TurnLeft original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected TurnLeft(bool deserializing) : base(deserializing) { }
+    protected TurnLeft(TurnLeft original, Cloner cloner) : base(original, cloner) { }
 
     public TurnLeft()
       : base("TurnLeft", "Immediately turns the robot's body to the left by degrees.") {
-      this.Prefix = "setTurnLeft(";
-      this.Suffix = ");";
+      Prefix = "setTurnLeft(";
+      Suffix = ");";
     }
 
@@ -53,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnLeft was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnLeft was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnLeft was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnLeft was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnLeft was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarLeft.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarLeft.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarLeft.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,13 +38,11 @@
 
     [StorableConstructor]
-    private TurnRadarLeft(bool deserializing) : base(deserializing) { }
-    private TurnRadarLeft(TurnRadarLeft original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    protected TurnRadarLeft(bool deserializing) : base(deserializing) { }
+    protected TurnRadarLeft(TurnRadarLeft original, Cloner cloner) : base(original, cloner) { }
 
     public TurnRadarLeft()
       : base("TurnRadarLeft", "Immediately turns the robot's radar to the left by degrees.") {
-      this.Prefix = "setTurnRadarLeft(";
-      this.Suffix = ");";
+      Prefix = "setTurnRadarLeft(";
+      Suffix = ");";
     }
 
@@ -53,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnRadarLeft was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnRadarLeft was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnRadarLeft was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnRadarLeft was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnRadarLeft was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarRight.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarRight.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarRight.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private TurnRadarRight(bool deserializing) : base(deserializing) { }
-    private TurnRadarRight(TurnRadarRight original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected TurnRadarRight(bool deserializing) : base(deserializing) { }
+    protected TurnRadarRight(TurnRadarRight original, Cloner cloner) : base(original, cloner) { }
 
     public TurnRadarRight()
       : base("TurnRadarRight", "Immediately turns the robot's radar to the right by degrees.") {
-      this.Prefix = "setTurnRadarRight(";
-      this.Suffix = ");";
+      Prefix = "setTurnRadarRight(";
+      Suffix = ");";
     }
 
@@ -54,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnRadarRight was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnRadarRight was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnRadarRight was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnRadarRight was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnRadarRight was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRight.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRight.cs	(revision 10008)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRight.cs	(revision 10011)
@@ -20,5 +20,5 @@
 #endregion
 
-
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
@@ -38,14 +38,11 @@
 
     [StorableConstructor]
-    private TurnRight(bool deserializing) : base(deserializing) { }
-    private TurnRight(TurnRight original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
+    protected TurnRight(bool deserializing) : base(deserializing) { }
+    protected TurnRight(TurnRight original, Cloner cloner) : base(original, cloner) { }
 
     public TurnRight()
       : base("TurnRight", "Immediately turns the robot's body to the right by degrees.") {
-      this.Prefix = "setTurnRight(";
-      this.Suffix = ");";
+      Prefix = "setTurnRight(";
+      Suffix = ");";
     }
 
@@ -54,20 +51,17 @@
     }
 
-    public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) {
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
       var enumerator = children.GetEnumerator();
+      if (!enumerator.MoveNext()) throw new System.Exception("TurnRight was not given a child.");
 
-      if (!enumerator.MoveNext()) throw new System.Exception("TurnRight was not given a child.");
       var symbol = enumerator.Current.Symbol;
-
-      if (!(symbol is Number || symbol is NumericalOperation || symbol is NumericalExpression))
-        throw new System.Exception("TurnRight was given a child of type " + symbol.GetType().ToString() +
-            ". The expected child must be of type " + typeof(Number).ToString() + " or " +
-            typeof(NumericalOperation).ToString() + " or " +
-            typeof(NumericalExpression).ToString() + ".");
+      if (!(symbol is NumericalExpression))
+        throw new System.Exception("TurnRight was given a child of type " + symbol.GetType() +
+            ". The expected child must be of type " + typeof(NumericalExpression) + ".");
 
       string result = ((CodeNode)symbol).Interpret(enumerator.Current, enumerator.Current.Subtrees);
       if (enumerator.MoveNext()) throw new System.Exception("TurnRight was given more than one child.");
 
-      return this.Prefix + result + this.Suffix;
+      return Prefix + result + Suffix;
     }
   }
