Index: /branches/Robocode/HeuristicLab.Problems.Robocode.sln
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode.sln	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode.sln	(revision 9565)
@@ -0,0 +1,31 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Robocode", "HeuristicLab.Problems.Robocode\HeuristicLab.Problems.Robocode.csproj", "{50776649-F3CF-459A-AE8C-146D1BFA64E4}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Release|x64.ActiveCfg = Release|Any CPU
+		{50776649-F3CF-459A-AE8C-146D1BFA64E4}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		VisualSVNWorkingCopyRoot = .
+	EndGlobalSection
+EndGlobal
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/BestSolutionAnalyzer.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/BestSolutionAnalyzer.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/BestSolutionAnalyzer.cs	(revision 9565)
@@ -0,0 +1,220 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    [Item("Best Tank program Analyzer",
+          "Analyzer that stores the best tank program.")]
+    public class BestSolutionAnalyzer : SingleSuccessorOperator,
+      ISymbolicExpressionTreeAnalyzer
+    {
+        #region parameter names
+        private const string QualityParameterName = "Quality";
+        private const string SymbolicExpressionTreeParameterName =
+          "TankProgram";
+        private const string MovesParameterName = "Moves";
+        private const string ShotsParameterName = "Shots";
+        private const string BestSolutionParameterName = "Best solution";
+        private const string ResultsParameterName = "Results";
+        private const string RobocodePathParamaterName = "Path";
+        private const string CoevolutionParameterName = "Coevolution";
+        #endregion
+
+
+        #region parameters
+        public IScopeTreeLookupParameter<DoubleValue> QualityParameter
+        {
+            get
+            {
+                return (IScopeTreeLookupParameter<DoubleValue>)
+                          Parameters[QualityParameterName];
+            }
+        }
+        public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter
+        {
+            get
+            {
+                return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)
+                          Parameters[SymbolicExpressionTreeParameterName];
+            }
+        }
+        //public ILookupParameter<IntValue> MovesParameter
+        //{
+        //    get
+        //    {
+        //        return (ILookupParameter<IntValue>)
+        //                  Parameters[MovesParameterName];
+        //    }
+        //}
+        //public ILookupParameter<IntValue> ShotsParameter
+        //{
+        //    get
+        //    {
+        //        return (ILookupParameter<IntValue>)
+        //                  Parameters[ShotsParameterName];
+        //    }
+        //}
+        public ILookupParameter<Solution> BestSolutionParameter
+        {
+            get
+            {
+                return (ILookupParameter<Solution>)
+                          Parameters[BestSolutionParameterName];
+            }
+        }
+        public ILookupParameter<ResultCollection> ResultParameter
+        {
+            get
+            {
+                return (ILookupParameter<ResultCollection>)
+                          Parameters[ResultsParameterName];
+            }
+        }
+        public ILookupParameter<StringValue> RobocodePathParameter
+        {
+            get
+            {
+                return (ILookupParameter<StringValue>)
+                    Parameters[RobocodePathParamaterName];
+            }
+        }
+        public ILookupParameter<BoolValue> CoevolutionParameter
+        {
+            get
+            {
+                return (ILookupParameter<BoolValue>)
+                    Parameters[CoevolutionParameterName];
+            }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected BestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+        protected BestSolutionAnalyzer(BestSolutionAnalyzer original,
+                                       Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public BestSolutionAnalyzer()
+        {
+            Parameters.Add(
+              new ScopeTreeLookupParameter<DoubleValue>(
+                QualityParameterName,
+                "The solution quality of the tank program."));
+            Parameters.Add(
+              new ScopeTreeLookupParameter<ISymbolicExpressionTree>(
+                SymbolicExpressionTreeParameterName,
+                "The tank program to evaluate represented " +
+                "as symbolic expression tree."));
+            Parameters.Add(
+              new LookupParameter<Solution>(
+                BestSolutionParameterName, "The best tank program."));
+            //Parameters.Add(
+            //  new LookupParameter<IntValue>(
+            //    MovesParameterName, "The number of moves made."));
+            //Parameters.Add(
+            //  new LookupParameter<IntValue>(
+            //    ShotsParameterName, "The shots made."));
+            Parameters.Add(
+              new LookupParameter<ResultCollection>(
+                ResultsParameterName, "The result collection of the algorithm."));
+            Parameters.Add(
+              new LookupParameter<StringValue>(
+                RobocodePathParamaterName,
+                "Path of the Robocode installation."));
+            Parameters.Add(
+                new LookupParameter<BoolValue>(
+                    CoevolutionParameterName,
+                    "Use Coevolution"));
+        }
+
+        public override IOperation Apply()
+        {
+            // get an array of all trees
+            // and an array of all qualities
+            var trees = SymbolicExpressionTreeParameter.ActualValue;
+            var qualities = QualityParameter.ActualValue;
+
+            // find the tree with the best quality
+            double maxQuality = double.NegativeInfinity;
+            ISymbolicExpressionTree bestTree = null;
+            for (int i = 0; i < qualities.Length; i++)
+            {
+                if (qualities[i].Value > maxQuality)
+                {
+                    maxQuality = qualities[i].Value;
+                    bestTree = trees[i];
+                }
+            }
+
+            var coevolution = CoevolutionParameter.ActualValue.Value;
+            double actualQuality = 0;
+
+            if (coevolution)
+                actualQuality = Interpreter.EvaluateTankProgram(bestTree, null, RobocodePathParameter.ActualValue.Value);
+
+            // create a solution instance
+            //int shots = ShotsParameter.ActualValue.Value;
+            //int moves = MovesParameter.ActualValue.Value;
+            var bestSolution = new Solution(bestTree, actualQuality);//, moves, shots);
+            // store the new solution in the best solution parameter
+            BestSolutionParameter.ActualValue = bestSolution;
+
+            // also add the best solution as a result to the result collection
+            // or alternatively update the existing result
+            var resultCollection = ResultParameter.ActualValue;
+            if (!resultCollection.ContainsKey(BestSolutionParameterName))
+            {
+              resultCollection.Add(
+                new Result(BestSolutionParameterName,
+                           "The best tank program", bestSolution));
+              //if(coevolution)
+              //    resultCollection.Add(
+              //        new Result("Actual Quality",
+              //            "The actual quality of the best program", new DoubleValue(actualQuality)));
+            }
+            else
+            {
+                resultCollection[BestSolutionParameterName].Value = bestSolution;
+            }
+
+            if (coevolution)
+            {
+                if (!resultCollection.ContainsKey("Actual Quality"))
+                {
+                    resultCollection.Add(
+                        new Result("Actual Quality",
+                            "The actual quality of the best program", new DoubleValue(actualQuality)));
+                }
+                else
+                {
+                    resultCollection["Actual Quality"].Value = new DoubleValue(actualQuality);
+                }
+            }
+
+            // important return base.Apply() to make sure the 
+            // next operator is queued for execution
+            return base.Apply();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new BestSolutionAnalyzer(this, cloner);
+        }
+
+        // override this property to indicate that this analyzer
+        // should be enabled by default in the algorithm
+        public bool EnabledByDefault
+        {
+            get { return true; }
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeCrossover.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeCrossover.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeCrossover.cs	(revision 9565)
@@ -0,0 +1,208 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.Robocode {
+  /// <summary>
+  /// Takes two parent individuals P0 and P1 each. Selects a random node N0 of P0 and a random node N1 of P1.
+  /// And replaces the branch with root0 N0 in P0 with N1 from P1 if the tree-size limits are not violated.
+  /// When recombination with N0 and N1 would create a tree that is too large or invalid the operator randomly selects new N0 and N1 
+  /// until a valid configuration is found.
+  /// </summary>  
+  [Item("RobocodeCrossover", "An operator which performs subtree swapping crossover.")]
+  [StorableClass]
+  public class RobocodeCrossover : SymbolicExpressionTreeCrossover, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const string InternalCrossoverPointProbabilityParameterName = "InternalCrossoverPointProbability";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+
+    #region Parameter Properties
+    public IValueLookupParameter<PercentValue> InternalCrossoverPointProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[InternalCrossoverPointProbabilityParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public PercentValue InternalCrossoverPointProbability {
+      get { return InternalCrossoverPointProbabilityParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected RobocodeCrossover(bool deserializing) : base(deserializing) { }
+    protected RobocodeCrossover(RobocodeCrossover original, Cloner cloner) : base(original, cloner) { }
+    public RobocodeCrossover()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(InternalCrossoverPointProbabilityParameterName, "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RobocodeCrossover(this, cloner);
+    }
+
+    public override ISymbolicExpressionTree Crossover(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      return Cross(random, parent0, parent1, InternalCrossoverPointProbability.Value,
+        MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+    }
+
+    public static ISymbolicExpressionTree Cross(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1,
+      double internalCrossoverPointProbability, int maxTreeLength, int maxTreeDepth) {
+      // select a random crossover point in the first parent 
+      CutPoint crossoverPoint0;
+      SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeLength, maxTreeDepth, out crossoverPoint0);
+
+      int childLength = crossoverPoint0.Child != null ? crossoverPoint0.Child.GetLength() : 0;
+      // calculate the max length and depth that the inserted branch can have 
+      int maxInsertedBranchLength = maxTreeLength - (parent0.Length - childLength);
+      int maxInsertedBranchDepth = maxTreeDepth - parent0.Root.GetBranchLevel(crossoverPoint0.Parent);
+
+      List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.GetLength() <= maxInsertedBranchLength &&
+            n.GetDepth() <= maxInsertedBranchDepth && crossoverPoint0.IsMatchingPointType(n))
+          allowedBranches.Add(n);
+      });
+      // empty branch
+      if (crossoverPoint0.IsMatchingPointType(null)) allowedBranches.Add(null);
+
+      if (allowedBranches.Count == 0) {
+        return parent0;
+      } else {
+        var selectedBranch = SelectRandomBranch(random, allowedBranches, internalCrossoverPointProbability);
+
+        if (crossoverPoint0.Child != null) {
+          // manipulate the tree of parent0 in place
+          // replace the branch in tree0 with the selected branch from tree1
+          crossoverPoint0.Parent.RemoveSubtree(crossoverPoint0.ChildIndex);
+          if (selectedBranch != null) {
+            crossoverPoint0.Parent.InsertSubtree(crossoverPoint0.ChildIndex, selectedBranch);
+          }
+        } else {
+          // child is null (additional child should be added under the parent)
+          if (selectedBranch != null) {
+            crossoverPoint0.Parent.AddSubtree(selectedBranch);
+          }
+        }
+        return parent0;
+      }
+    }
+
+    private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0, double internalNodeProbability, int maxBranchLength, int maxBranchDepth, out CutPoint crossoverPoint) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<CutPoint> internalCrossoverPoints = new List<CutPoint>();
+      List<CutPoint> leafCrossoverPoints = new List<CutPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.SubtreeCount > 0 && n != parent0.Root) {
+          foreach (var child in n.Subtrees) {
+            if (child.GetLength() <= maxBranchLength &&
+                child.GetDepth() <= maxBranchDepth) {
+              if (child.SubtreeCount > 0)
+                internalCrossoverPoints.Add(new CutPoint(n, child));
+              else
+                leafCrossoverPoints.Add(new CutPoint(n, child));
+            }
+          }
+
+          // add one additional extension point if the number of sub trees for the symbol is not full
+          if (n.SubtreeCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
+            // empty extension point
+            internalCrossoverPoints.Add(new CutPoint(n, n.SubtreeCount));
+          }
+        }
+      }
+    );
+
+      if (random.NextDouble() < internalNodeProbability) {
+        // select from internal node if possible
+        if (internalCrossoverPoints.Count > 0) {
+          // select internal crossover point or leaf
+          crossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+        } else {
+          // otherwise select external node
+          crossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+        }
+      } else if (leafCrossoverPoints.Count > 0) {
+        // select from leaf crossover point if possible
+        crossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+      } else {
+        // otherwise select internal crossover point
+        crossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<ISymbolicExpressionTreeNode> allowedInternalBranches;
+      List<ISymbolicExpressionTreeNode> allowedLeafBranches;
+      if (random.NextDouble() < internalNodeProbability) {
+        // select internal node if possible
+        allowedInternalBranches = (from branch in branches
+                                   where branch != null && branch.SubtreeCount > 0
+                                   select branch).ToList();
+        if (allowedInternalBranches.Count > 0) {
+          return allowedInternalBranches.SelectRandom(random);
+        } else {
+          // no internal nodes allowed => select leaf nodes
+          allowedLeafBranches = (from branch in branches
+                                 where branch == null || branch.SubtreeCount == 0
+                                 select branch).ToList();
+          return allowedLeafBranches.SelectRandom(random);
+        }
+      } else {
+        // select leaf node if possible
+        allowedLeafBranches = (from branch in branches
+                               where branch == null || branch.SubtreeCount == 0
+                               select branch).ToList();
+        if (allowedLeafBranches.Count > 0) {
+          return allowedLeafBranches.SelectRandom(random);
+        } else {
+          allowedInternalBranches = (from branch in branches
+                                     where branch != null && branch.SubtreeCount > 0
+                                     select branch).ToList();
+          return allowedInternalBranches.SelectRandom(random);
+        }
+      }
+    }
+  }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeMethodCrossover.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeMethodCrossover.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Crossover/RobocodeMethodCrossover.cs	(revision 9565)
@@ -0,0 +1,222 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    /// <summary>
+    /// Takes two parent individuals P0 and P1 each. Selects a random node N0 of P0 and a random node N1 of P1.
+    /// And replaces the branch with root0 N0 in P0 with N1 from P1 if the tree-size limits are not violated.
+    /// When recombination with N0 and N1 would create a tree that is too large or invalid the operator randomly selects new N0 and N1 
+    /// until a valid configuration is found.
+    /// </summary>  
+    [Item("RobocodeMethodCrossover", "An operator which performs crossover of randomly chosen statements with a method.")]
+    [StorableClass]
+    public class RobocodeMethodCrossover : SymbolicExpressionTreeCrossover//, ISymbolicExpressionTreeSizeConstraintOperator
+    {
+
+        #region Parameter Names
+
+        private const string HomologousCrossoverPrameterName = "HomologousCrossover";
+        private const string MaximumCrossoverMethodsParameterName = "MaximumCrossoverMethods";
+
+        #endregion
+
+        #region Parameter Properties
+
+        public IValueLookupParameter<BoolValue> HomologousCrossoverParameter
+        {
+            get { return (IValueLookupParameter<BoolValue>)Parameters[HomologousCrossoverPrameterName]; }
+        }
+
+        public IValueLookupParameter<IntValue> MaximumCrossoverMethodsParameter
+        {
+            get { return (IValueLookupParameter<IntValue>)Parameters[MaximumCrossoverMethodsParameterName]; }
+        }
+        #endregion
+
+        #region Properties
+
+        public BoolValue HomologousCrossover
+        {
+            get { return HomologousCrossoverParameter.ActualValue; }
+        }
+
+        public IntValue MaximumCrossoverMethods
+        {
+            get { return MaximumCrossoverMethodsParameter.ActualValue; }
+        }
+
+        #endregion
+
+        [StorableConstructor]
+        protected RobocodeMethodCrossover(bool deserializing) : base(deserializing) { }
+        protected RobocodeMethodCrossover(RobocodeMethodCrossover original, Cloner cloner) :
+            base(original, cloner) { }
+        public RobocodeMethodCrossover()
+            : base()
+        {
+            Parameters.Add(new ValueLookupParameter<BoolValue>(HomologousCrossoverPrameterName,
+                "Specifies if the number of statements exchanged between the two parents is the same.", new BoolValue(false)));
+            Parameters.Add(new ValueLookupParameter<IntValue>(MaximumCrossoverMethodsParameterName,
+                "The maximal methods to apply crossover on (0 or a number higher than the count of " +
+                "methods means applying crossover to them all).", new IntValue(0)));
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new RobocodeMethodCrossover(this, cloner);
+        }
+
+        public override ISymbolicExpressionTree Crossover(IRandom random,
+          ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1)
+        {
+            return Cross(random, parent0, parent1, HomologousCrossover.Value,
+              MaximumCrossoverMethods.Value);
+        }
+
+        public static ISymbolicExpressionTree Cross(IRandom random,
+          ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1,
+          bool homologous, int maximumCrossoverMethods)
+        {
+            // select a random crossover point in the first parent 
+            List<CutPoint> crossoverPoints0;
+            SelectCrossoverPoint(random, parent0, maximumCrossoverMethods, out crossoverPoints0);
+
+            foreach (CutPoint c in crossoverPoints0)
+            {
+                List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
+                parent1.Root.ForEachNodePostfix((n) =>
+                {
+                    if (n.Symbol.GetType() == c.Child.Symbol.GetType())
+                        allowedBranches.Add(n);
+                });
+
+                if (allowedBranches.Count == 0)
+                {
+                    break;
+                }
+                else
+                {
+                    ISymbolicExpressionTreeNode branch = allowedBranches.FirstOrDefault();
+                    int startBranchParent0 = (c.Child.SubtreeCount <= 2)? 0 : random.Next(0, c.Child.SubtreeCount - 2);
+                    int endBranchParent0 = (c.Child.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent0 + 1, c.Child.SubtreeCount - 1);
+                    int Parent0Branches = endBranchParent0 - startBranchParent0;
+
+                    for (int i = 0; i < Parent0Branches; i++)
+                    {
+                        c.Child.RemoveSubtree(startBranchParent0);
+                    }
+
+                    if (homologous)
+                    {
+                        for (int j = startBranchParent0; j <= endBranchParent0; j++)
+                        {
+                            c.Child.AddSubtree(branch.GetSubtree(j));
+                        }
+                    }
+                    else
+                    {
+                        int startBranchParent1 = (branch.SubtreeCount <= 2) ? 0 : random.Next(0, branch.SubtreeCount - 2);
+                        int endBranchParent1 = (branch.SubtreeCount <= 2) ? 1 : random.Next(startBranchParent1 + 1, branch.SubtreeCount - 1);
+                        int Parent1Branches = endBranchParent1 - startBranchParent1;
+
+                        for (int j = startBranchParent1; j <= endBranchParent1 && c.Child.SubtreeCount < c.Child.Symbol.MaximumArity; j++)
+                        {
+                            c.Child.AddSubtree(branch.GetSubtree(j));
+                        }
+                    }
+                }
+            }
+
+            return parent0;
+        }
+
+        private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0,
+            int maximumCrossoverMethods, out List<CutPoint> crossoverPoints)
+        {
+            List<CutPoint> MethodPoints = new List<CutPoint>();
+            parent0.Root.ForEachNodePostfix((n) =>
+            {
+                if (n.SubtreeCount > 0 && n != parent0.Root)
+                {
+                    foreach (var child in n.Subtrees)
+                    {
+                        if (child.Symbol is Run ||
+                            child.Symbol is OnBulletHit ||
+                            child.Symbol is OnBulletMissed ||
+                            child.Symbol is OnHitByBullet ||
+                            child.Symbol is OnHitRobot ||
+                            child.Symbol is OnHitWall ||
+                            child.Symbol is OnScannedRobot)
+                            MethodPoints.Add(new CutPoint(n, child));
+                    }
+                }
+            });
+
+            if (maximumCrossoverMethods == 0)
+                crossoverPoints = MethodPoints;
+            else
+            {
+                crossoverPoints = new List<CutPoint>();
+                for (int i = 0; i < maximumCrossoverMethods; i++)
+                {
+                    CutPoint c = MethodPoints.SelectRandom(random);
+                    crossoverPoints.Add(c);
+                    MethodPoints.Remove(c);
+                    if (MethodPoints.Count == 0) break;
+                }
+            }
+        }
+
+        /*private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability)
+        {
+            if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+            List<ISymbolicExpressionTreeNode> allowedInternalBranches;
+            List<ISymbolicExpressionTreeNode> allowedLeafBranches;
+            if (random.NextDouble() < internalNodeProbability)
+            {
+                // select internal node if possible
+                allowedInternalBranches = (from branch in branches
+                                           where branch != null && branch.SubtreeCount > 0
+                                           select branch).ToList();
+                if (allowedInternalBranches.Count > 0)
+                {
+                    return allowedInternalBranches.SelectRandom(random);
+                }
+                else
+                {
+                    // no internal nodes allowed => select leaf nodes
+                    allowedLeafBranches = (from branch in branches
+                                           where branch == null || branch.SubtreeCount == 0
+                                           select branch).ToList();
+                    return allowedLeafBranches.SelectRandom(random);
+                }
+            }
+            else
+            {
+                // select leaf node if possible
+                allowedLeafBranches = (from branch in branches
+                                       where branch == null || branch.SubtreeCount == 0
+                                       select branch).ToList();
+                if (allowedLeafBranches.Count > 0)
+                {
+                    return allowedLeafBranches.SelectRandom(random);
+                }
+                else
+                {
+                    allowedInternalBranches = (from branch in branches
+                                               where branch != null && branch.SubtreeCount > 0
+                                               select branch).ToList();
+                    return allowedInternalBranches.SelectRandom(random);
+                }
+            }
+        }*/
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Evaluator.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Evaluator.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Evaluator.cs	(revision 9565)
@@ -0,0 +1,166 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using System;
+using System.IO;
+using System.Threading;
+using System.Xml;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    [Item("Robocode Evaluator", "Evaluator for the Robocode GP problem.")]
+    public class Evaluator : SingleSuccessorOperator,
+      ISingleObjectiveEvaluator
+    {
+        #region parameter names
+        private const string QualityParameterName = "Quality";
+        private const string TankProgramParameterName = "TankProgram";
+        private const string RobocodePathParamaterName = "Path";
+        private const string CoevolutionParameterName = "Coevolution";
+
+
+        private static string solutionTemplatePath = "";
+        public static string SolutionTemplate
+        {
+            get { return solutionTemplatePath; }
+            set
+            {
+                solutionTemplatePath = value;
+            }
+        }
+
+        public static SemaphoreSlim semaphore = new SemaphoreSlim(10);
+        #endregion
+
+
+        #region parameters
+        public ILookupParameter<DoubleValue> QualityParameter
+        {
+            get
+            {
+                return (ILookupParameter<DoubleValue>)
+                         Parameters[QualityParameterName];
+            }
+        }
+        public ILookupParameter<ISymbolicExpressionTree> TankProgramParameter
+        {
+            get
+            {
+                return (ILookupParameter<ISymbolicExpressionTree>)
+                         Parameters[TankProgramParameterName];
+            }
+        }
+        public ILookupParameter<StringValue> RobocodePathParameter
+        {
+            get
+            {
+                return (ILookupParameter<StringValue>)
+                    Parameters[RobocodePathParamaterName];
+            }
+        }
+        public ILookupParameter<BoolValue> CoevolutionParameter
+        {
+            get
+            {
+                return (ILookupParameter<BoolValue>)
+                    Parameters[CoevolutionParameterName];
+            }
+        }
+        #endregion
+
+        
+        [StorableConstructor]
+        protected Evaluator(bool deserializing) : base(deserializing) { }
+        protected Evaluator(Evaluator original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        // default constructor for the evaluator
+        public Evaluator()
+        {
+            Parameters.Add(
+              new LookupParameter<DoubleValue>(
+                QualityParameterName,
+                "The solution quality of the Robocode tank program."));
+            Parameters.Add(
+              new LookupParameter<ISymbolicExpressionTree>(
+                TankProgramParameterName,
+                "The Robocode tank program to evaluate represented as a " +
+                "symbolic expression tree."));
+            Parameters.Add(
+              new LookupParameter<StringValue>(
+                RobocodePathParamaterName,
+                "Path of the Robocode installation."));
+            Parameters.Add(
+                new LookupParameter<BoolValue>(
+                    CoevolutionParameterName,
+                    "Use Coevolution"));
+
+            SolutionTemplate = "../tank.xml";
+        }
+
+        // override the apply method to change the behaviour of the operator
+        // here we take trees as inputs and calculate qualities 
+        // (fitness evaluation)
+        public override IOperation Apply()
+        {
+            semaphore.Wait();
+            
+            ISymbolicExpressionTree tree = TankProgramParameter.ActualValue;
+            XmlDocument doc = new XmlDocument();
+            doc.Load("../tank.xml");
+            XmlNode node = doc.FirstChild.Clone();
+            string path = RobocodePathParameter.ActualValue.Value;
+
+            if (CoevolutionParameter.ActualValue.Value)
+            {
+                var trees = ExecutionContext.Parent.Scope.SubScopes;//SymbolicExpressionTreeParameter.ActualValue;
+                if (trees.Count == 2)
+                {
+                    trees = trees[0].SubScopes;
+                    //treeCount = trees[0].SubScopes.Count;
+                    //int selTreeCount = trees[1].SubScopes.Count;
+                }
+
+                Random random = new Random();
+                ScopeList chosenScopes = new ScopeList(5);
+                for (int i = 0; i < 5; i++)
+                {
+                    var newScope = trees.ToArray()[random.Next(0, trees.Count - 1)];
+                    chosenScopes.Add(newScope);
+                }
+
+                //if (evaluations % 99 == 0)
+                //    evaluations = evaluations;
+
+                QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, chosenScopes, node, path));
+            }
+            else
+                QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, node, path));
+
+            semaphore.Release();
+
+            // important: return base.Apply() to make sure that the
+            // next operator is queued for execution
+            return base.Apply();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Evaluator(this, cloner);
+        }
+
+        public bool EnabledByDefault
+        {
+            get { return true; }
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Grammar.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Grammar.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Grammar.cs	(revision 9565)
@@ -0,0 +1,260 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    [Item("Robocode Grammar", "The grammar for the Robocode GP problem.")]
+    public class Grammar : SymbolicExpressionGrammar
+    {
+        [StorableConstructor]
+        private Grammar(bool deserializing) : base(deserializing) { }
+        private Grammar(Grammar original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public Grammar()
+            : base("Robocode Grammar", "The grammar for the Robocode GP problem.")
+        {
+            Initialize();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Grammar(this, cloner);
+        }
+
+        // initialize set of allowed symbols and define 
+        // the allowed combinations of symbols
+        private void Initialize()
+        {
+            #region Symbols
+            var block = new Block();
+
+            var ifStmt = new IfStatement();
+            var elseStmt = new ElseStatement();
+            var whileLoop = new WhileLoop();
+
+            var numExpr = new NumericalExpression();
+            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 ahead = new Ahead();
+            var back = new Back();
+            var constant = new Constant();
+            var doNothing = new DoNothing();
+            var fire = new Fire();
+            var shotPower = new ShotPower();
+
+            var getEnergy = new GetEnergy();
+            var getGunHeading = new GetGunHeading();
+            var getHeading = new GetHeading();
+            var getRadarHeading = new GetRadarHeading();
+            var getX = new GetX();
+            var getY = new GetY();
+            
+            //var setAdjustGunForRobotTurn = new SetAdjustGunForRobotTurn();
+            //var setAdjustRadarForGunTurn = new SetAdjustRadarForGunTurn();
+            //var setAdjustRadarForRobotTurn = new SetAdjustRadarForRobotTurn();
+            //var independent = new Independent();
+            
+            var turnLeft = new TurnLeft();
+            var turnRight = new TurnRight();
+            var turnGunLeft = new TurnGunLeft();
+            var turnGunRight = new TurnGunRight();
+            var turnRadarLeft = new TurnRadarLeft();
+            var turnRadarRight = new TurnRadarRight();
+            
+            var onBulletHit = new OnBulletHit();
+            var onBulletMissed = new OnBulletMissed();
+            var onHitByBullet = new OnHitByBullet();
+            var onHitRobot = new OnHitRobot();
+            var onHitWall = new OnHitWall();
+            var onScannedRobot = new OnScannedRobot();
+            
+            var run = new Run();
+            var tank = new Tank();
+            var program = new Program();
+            #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, /*independent,*/ constant
+            };
+
+            var eventSymbols = new List<ISymbol>()
+            {
+                run, onBulletHit, onBulletMissed, onHitByBullet, onHitRobot, onHitWall, onScannedRobot, block
+            };
+            #endregion
+
+            #region Adding Symbols
+            // add all symbols to the grammar
+
+            AddSymbol(ifStmt);
+            AddSymbol(elseStmt);
+            AddSymbol(whileLoop);
+
+            AddSymbol(numExpr);
+            foreach (var s in numericalExpressions)
+                AddSymbol(s);
+            foreach (var s in numericalOperators)
+                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);
+            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);
+
+            // Numerical Expressions
+            foreach (var s in numericalExpressions)
+            {
+                AddAllowedChildSymbol(numExpr, s);
+                AddAllowedChildSymbol(numOp, s, 1);
+                AddAllowedChildSymbol(numOp, s, 2);
+            }
+            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);
+            }
+            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 f in functionSymbols)
+            {
+                if (f is SetAdjustGunForRobotTurn ||
+                    f is SetAdjustRadarForGunTurn ||
+                    f is SetAdjustRadarForRobotTurn)
+                    AddAllowedChildSymbol(f, logicExpr);
+                else if (f is Fire)
+                    AddAllowedChildSymbol(f, shotPower);
+                else
+                    AddAllowedChildSymbol(f, numExpr);
+
+            }
+
+            AddAllowedChildSymbol(tank, run, 0);
+            AddAllowedChildSymbol(tank, onBulletHit, 1);
+            AddAllowedChildSymbol(tank, onBulletMissed, 2);
+            AddAllowedChildSymbol(tank, onHitByBullet, 3);
+            AddAllowedChildSymbol(tank, onHitRobot, 4);
+            AddAllowedChildSymbol(tank, onHitWall, 5);
+            AddAllowedChildSymbol(tank, onScannedRobot, 6);
+
+            AddAllowedChildSymbol(StartSymbol, tank, 0);
+            #endregion
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/HeuristicLab.Problems.Robocode.csproj
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/HeuristicLab.Problems.Robocode.csproj	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/HeuristicLab.Problems.Robocode.csproj	(revision 9565)
@@ -0,0 +1,198 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{50776649-F3CF-459A-AE8C-146D1BFA64E4}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.Robocode</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.Robocode-1.1</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\HeuristicLabTrunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\HeuristicLabTrunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BestSolutionAnalyzer.cs" />
+    <Compile Include="Crossover\RobocodeCrossover.cs" />
+    <Compile Include="Crossover\RobocodeMethodCrossover.cs" />
+    <Compile Include="Evaluator.cs" />
+    <Compile Include="Grammar.cs" />
+    <Compile Include="Interpreter.cs" />
+    <Compile Include="Problem.cs" />
+    <Compile Include="Solution.cs" />
+    <Compile Include="SolutionCodeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SolutionCodeView.Designer.cs">
+      <DependentUpon>SolutionCodeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SolutionProgramView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SolutionProgramView.Designer.cs" />
+    <Compile Include="Symbols\Numerical Methods\INumericalMethod.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\Logical Expressions\BooleanTreeNode.cs" />
+    <Compile Include="Symbols\Abandoned\Constant.cs" />
+    <Compile Include="Symbols\Abandoned\ConstantTreeNode.cs" />
+    <Compile Include="Symbols\CodeNodeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\CodeNodeView.Designer.cs">
+      <DependentUpon>CodeNodeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Conjunction.cs" />
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Disjunction.cs" />
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\Equal.cs" />
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\GreaterThan.cs" />
+    <Compile Include="Symbols\Logical Expressions\Logical Comparators\GreaterThanOrEqual.cs" />
+    <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" />
+    <Compile Include="Symbols\Numerical Expressions\Numerical Operators\Addition.cs" />
+    <Compile Include="Symbols\Numerical Expressions\Numerical Operators\Division.cs" />
+    <Compile Include="Symbols\Numerical Expressions\Numerical Operators\Modulus.cs" />
+    <Compile Include="Symbols\Numerical Expressions\Numerical Operators\Multiplication.cs" />
+    <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" />
+    <Compile Include="Symbols\Void Methods\DoNothing.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnBulletHit.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnBulletMissed.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnHitByBullet.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnHitRobot.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnHitWall.cs" />
+    <Compile Include="Symbols\Event Methods\Events\OnScannedRobot.cs" />
+    <Compile Include="Symbols\Void Methods\Fire.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetEnergy.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetGunHeading.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetHeading.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetRadarHeading.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetX.cs" />
+    <Compile Include="Symbols\Numerical Methods\GetY.cs" />
+    <Compile Include="Symbols\Abandoned\Independent.cs" />
+    <Compile Include="Symbols\Program.cs" />
+    <Compile Include="Symbols\Event Methods\Run.cs" />
+    <Compile Include="Symbols\Abandoned\SetAdjustGunForRobotTurn.cs" />
+    <Compile Include="Symbols\Abandoned\SetAdjustRadarForGunTurn.cs" />
+    <Compile Include="Symbols\Abandoned\SetAdjustRadarForRobotTurn.cs" />
+    <Compile Include="Symbols\Numerical Expressions\ShotPower.cs" />
+    <Compile Include="Symbols\Numerical Expressions\ShotPowerTreeNode.cs" />
+    <Compile Include="Symbols\Void Methods\TurnGunLeft.cs" />
+    <Compile Include="Symbols\Void Methods\TurnGunRight.cs" />
+    <Compile Include="Symbols\Void Methods\TurnLeft.cs" />
+    <Compile Include="Symbols\Void Methods\TurnRadarLeft.cs" />
+    <Compile Include="Symbols\Void Methods\TurnRadarRight.cs" />
+    <Compile Include="Symbols\Void Methods\TurnRight.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="SolutionCodeView.resx">
+      <DependentUpon>SolutionCodeView.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Symbols\CodeNodeView.resx">
+      <DependentUpon>CodeNodeView.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Interpreter.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Interpreter.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Interpreter.cs	(revision 9565)
@@ -0,0 +1,474 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using System.Xml;
+using System.Diagnostics;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Core;
+using System.Threading;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    public class Interpreter
+    {
+
+        private struct TankStats
+        {
+            public int moves , shots;
+            public TankStats(int moves, int shots)
+            {
+                this.moves = moves;
+                this.shots = shots;
+            }
+        }
+        static string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+        public static string BuildTankProgram(ISymbolicExpressionTree tree)
+        {
+            XmlDocument solutionCandidateRoot = new XmlDocument();
+            solutionCandidateRoot.Load("../tank.xml");
+
+            TankStats tankStats = EvaluateTankProgram(tree.Root, solutionCandidateRoot.FirstChild, null);
+            return solutionCandidateRoot.InnerText;
+        }
+
+        public static double EvaluateTankProgram(ISymbolicExpressionTree tree, XmlNode solutionCandidateRoot, string path)
+        {
+            //TankStats tankStats = EvaluateTankProgram(tree.Root, solutionCandidateRoot, null);
+            //Evaluator.tankStatLog += "\r\n" + tankStats.shots + " / " + tankStats.moves;
+            string interpretedProgram = InterpretProgramTree(tree.Root);
+            Random random = new Random();
+            string formattedPath = path.Replace("/", "\\");
+            string outputname = "";
+            string output = "";
+            bool noError = true;
+            do
+            {
+                try
+                {
+                    outputname = new string(Enumerable.Repeat(chars, 8).Select(s => s[random.Next(s.Length)]).ToArray());
+                    output = /*solutionCandidateRoot.InnerText*/interpretedProgram.Replace("class output", "class " + outputname);
+                    File.WriteAllText(path + "/robots/Evaluation/" + outputname + ".java", output, System.Text.Encoding.Default);
+                    noError = true;
+                }
+                catch (Exception e) { noError = false; }
+            } while (!noError);
+
+            //string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
+            //path.Replace("\\", "\\\\");
+            //path.Replace(" ", "\\ ");
+            #region Compile code file
+
+            ProcessStartInfo javaCompileInfo = new ProcessStartInfo();
+            javaCompileInfo.FileName = "cmd.exe";
+            javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " + formattedPath + "\\robots\\Evaluation\\" + outputname + ".java";
+            javaCompileInfo.RedirectStandardOutput = true;
+            javaCompileInfo.RedirectStandardError = true;
+            javaCompileInfo.UseShellExecute = false;
+            javaCompileInfo.CreateNoWindow = true;
+
+            Process javaCompile = new Process();
+            javaCompile.StartInfo = javaCompileInfo;
+            javaCompile.Start();
+
+            /*Evaluator.tankStatLog = "=====================================================\r\n";
+            Evaluator.tankStatLog += "Tree Compilation Output: \r\n";
+            Evaluator.tankStatLog += "=====================================================\r\n";*/
+
+            string cmdOutput = javaCompile.StandardOutput.ReadToEnd();
+            cmdOutput += javaCompile.StandardError.ReadToEnd();
+            //Evaluator.tankStatLog += cmdOutput;
+            //Console.WriteLine(cmdOutput);
+            //Console.ReadLine();
+
+            /*Evaluator.tankStatLog = "=====================================================\r\n";
+            Evaluator.tankStatLog += "End of Tree Compilation Output: \r\n";
+            Evaluator.tankStatLog += "=====================================================\r\n";*/
+
+            javaCompile.WaitForExit();
+            #endregion
+
+
+            try
+            { File.Delete(path + "/robots/robot.database"); }
+            catch (Exception e) { }
+
+            #region evaluate code
+
+            ProcessStartInfo evaluateCodeInfo = new ProcessStartInfo();
+            evaluateCodeInfo.FileName = "cmd.exe";
+            //javaCompileInfo.Arguments = "/C javac -cp C:\\robocode\\libs\\robocode.jar \"" + path + "\\Spaced Up\\output.java\"";
+            evaluateCodeInfo.Arguments = "/C java -classpath " + formattedPath + "\\libs;" + formattedPath + "\\libs\\robocode.core-1.8.1.0.jar;" + formattedPath + "\\libs\\robocode.jar;" + formattedPath + "\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation." + outputname + "* false";
+            //Console.WriteLine(javaCompileInfo.Arguments);
+            evaluateCodeInfo.RedirectStandardOutput = true;
+            evaluateCodeInfo.RedirectStandardError = true;
+            evaluateCodeInfo.UseShellExecute = false;
+            evaluateCodeInfo.CreateNoWindow = true;
+
+            Process evaluateCode = new Process();
+            evaluateCode.StartInfo = evaluateCodeInfo;
+            evaluateCode.Start();
+
+            // instead of p.WaitForExit(), do
+            StringBuilder q = new StringBuilder();
+            string scoreString = "";
+            while (!evaluateCode.HasExited)
+            {
+                scoreString = evaluateCode.StandardOutput.ReadToEnd().Split(
+                new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Last();
+                q.Append("Output: " + scoreString + "\r\n");
+                q.Append("Error: " + evaluateCode.StandardError.ReadToEnd() + "\r\n");
+            }
+            cmdOutput += q.ToString();
+
+            #endregion
+
+            double evaluation = -900;
+            try
+            {
+                File.Delete(path + "/robots/Evaluation/" + outputname + ".java");
+                File.Delete(path + "/robots/Evaluation/" + outputname + ".class");
+                evaluation = Double.Parse(scoreString);
+            }
+            catch (Exception e)
+            { evaluation = -900; }
+            Random rand = new Random();
+            evaluation += rand.NextDouble()/100;
+
+            /*Evaluator.tankStatLog = "=====================================================\r\n";
+            Evaluator.tankStatLog += "START OF TREE - Score: " + evaluation + " (" + tankStats.shots + "/" + tankStats.moves + ")" + "\r\n" + " Compilation Output: " + cmdOutput + "\r\n";
+            Evaluator.tankStatLog += "=====================================================\r\n";
+
+            Evaluator.tankStatLog += solutionCandidateRoot.InnerText + "\r\n";
+
+            Evaluator.tankStatLog += "=====================================================\r\n";
+            Evaluator.tankStatLog += "END OF TREE\r\n";
+            Evaluator.tankStatLog += "=====================================================\r\n";
+
+            File.AppendAllText("../TankLog.txt", Evaluator.tankStatLog);*/
+            return evaluation;
+        }
+
+        public static double EvaluateTankProgram(ISymbolicExpressionTree tree, ScopeList coevolutionIndividuals, XmlNode solutionCandidateRoot, string path)
+        {
+            Random random = new Random();
+            string formattedPath = path.Replace("/", "\\");
+
+            // Interpret and compile main tree
+            //XmlNode mainTreeNode = solutionCandidateRoot.Clone();
+            //EvaluateTankProgram(tree.Root, mainTreeNode, null);
+            string interpretedMainTree = InterpretProgramTree(tree.Root);
+            string mainTreeName = writeTreeToFile(interpretedMainTree, path, random);
+            compileCodefile(/*mainTreeName,*/ mainTreeName, formattedPath);
+
+            // Interpret and compile coevolutionIndividuals
+            String[] coevolutionIndividualsNames = new String[coevolutionIndividuals.Count];
+            for (int i = 0; i < coevolutionIndividuals.Count; i++)
+            {
+                //XmlNode individualTreeNode = solutionCandidateRoot.Clone();
+                //EvaluateTankProgram(((ISymbolicExpressionTree)coevolutionIndividuals[i].Variables.ToArray()[0].Value).Root, individualTreeNode, null);
+                string interpretedIndividual = InterpretProgramTree(((ISymbolicExpressionTree)coevolutionIndividuals[i].Variables.ToArray()[0].Value).Root);
+                coevolutionIndividualsNames[i] = writeTreeToFile(/*individualTreeNode,*/ interpretedIndividual, path, random);
+                compileCodefile(coevolutionIndividualsNames[i], formattedPath);
+            }
+            
+            // Force Robocode to update its robot database by deleting the existing one
+            try
+            { File.Delete(path + "/robots/robot.database"); }
+            catch (Exception e) { }
+
+            // Run evaluator
+            double evaluation = runEvaluator(mainTreeName, coevolutionIndividualsNames, formattedPath);
+            try
+            {
+                File.Delete(path + "/robots/Evaluation/" + mainTreeName + ".java");
+                File.Delete(path + "/robots/Evaluation/" + mainTreeName + ".class");
+                foreach (string s in coevolutionIndividualsNames)
+                {
+                    File.Delete(path + "/robots/Evaluation/" + s + ".java");
+                    File.Delete(path + "/robots/Evaluation/" + s + ".class");
+                }
+            }
+            catch (Exception e) { }
+            Random rand = new Random();
+            evaluation += rand.NextDouble() / 100;
+
+            return evaluation;
+        }
+
+        private static string writeTreeToFile(/*XmlNode node,*/ string interpretedTree, string path, Random random)
+        {
+            string outputName = "";
+            string outputString = "";
+            bool noError = true;
+            do
+            {
+                try
+                {
+                    outputName = new string(Enumerable.Repeat(chars, 8).Select(s => s[random.Next(s.Length)]).ToArray());
+                    outputString = /*node.InnerText*/interpretedTree.Replace("class output", "class " + outputName);
+                    File.WriteAllText(path + "/robots/Evaluation/" + outputName + ".java", outputString, System.Text.Encoding.Default);
+                    noError = true;
+                }
+                catch (Exception e) { noError = false; }
+            } while (!noError);
+
+            return outputName;
+        }
+
+        private static bool compileCodefile(string filename, string formattedPath)
+        {
+            ProcessStartInfo javaCompileInfo = new ProcessStartInfo();
+            javaCompileInfo.FileName = "cmd.exe";
+            javaCompileInfo.Arguments = "/C javac -cp " + formattedPath + "\\libs\\robocode.jar " + formattedPath + "\\robots\\Evaluation\\" + filename + ".java";
+            javaCompileInfo.RedirectStandardOutput = true;
+            javaCompileInfo.RedirectStandardError = true;
+            javaCompileInfo.UseShellExecute = false;
+            javaCompileInfo.CreateNoWindow = true;
+
+            Process javaCompile = new Process();
+            javaCompile.StartInfo = javaCompileInfo;
+            javaCompile.Start();
+
+            string cmdOutput = javaCompile.StandardOutput.ReadToEnd();
+            cmdOutput += javaCompile.StandardError.ReadToEnd();
+
+            javaCompile.WaitForExit();
+
+            if (cmdOutput.Equals(""))
+                return true;
+            return false;
+        }
+
+        private static double runEvaluator(string mainTreeFilename, string[] coevolutionIndividualsNames, string formattedPath)
+        {
+            ProcessStartInfo evaluateCodeInfo = new ProcessStartInfo();
+            evaluateCodeInfo.FileName = "cmd.exe";
+            //javaCompileInfo.Arguments = "/C javac -cp C:\\robocode\\libs\\robocode.jar \"" + path + "\\Spaced Up\\output.java\"";
+            evaluateCodeInfo.Arguments = "/C java -classpath " + formattedPath + "\\libs;" + formattedPath + "\\libs\\robocode.core-1.8.1.0.jar;" + formattedPath + "\\libs\\robocode.jar;" + formattedPath + "\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation." + mainTreeFilename + "* ";
+            if (coevolutionIndividualsNames != null)
+            {
+                foreach (string s in coevolutionIndividualsNames)
+                    evaluateCodeInfo.Arguments += "Evaluation." + s + "* ";
+            }
+            else
+                evaluateCodeInfo.Arguments += "false";
+            //Console.WriteLine(javaCompileInfo.Arguments);
+            evaluateCodeInfo.RedirectStandardOutput = true;
+            evaluateCodeInfo.RedirectStandardError = true;
+            evaluateCodeInfo.UseShellExecute = false;
+            evaluateCodeInfo.CreateNoWindow = true;
+
+            Process evaluateCode = new Process();
+            evaluateCode.StartInfo = evaluateCodeInfo;
+            evaluateCode.Start();
+
+            StringBuilder q = new StringBuilder();
+            string scoreString = "";
+            while (!evaluateCode.HasExited)
+            {
+                scoreString = evaluateCode.StandardOutput.ReadToEnd().Split(
+                new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Last();
+                q.Append("Output: " + scoreString + "\r\n");
+                q.Append("Error: " + evaluateCode.StandardError.ReadToEnd() + "\r\n");
+            }
+            string cmdOutput = q.ToString();
+            try
+            {
+                double evaluation = Double.Parse(scoreString);
+                return evaluation;
+            }
+            catch (Exception e) { }
+
+            return -900;
+        }
+        
+        private static TankStats EvaluateTankProgram(ISymbolicExpressionTreeNode node, XmlNode docNode, string method)
+        {
+            TankStats tankStats = new TankStats(0, 0);
+
+            //string log = "Doing node: \r\n";
+            /*if (node.Symbol is ProgramRootSymbol ||
+                node.Symbol is StartSymbol)
+                tankStats = EvaluateTankProgram(node.GetSubtree(0), ref docNode, null);
+            else*/
+            if (node.Symbol is Constant)
+                docNode[method]["code"].InnerText += " " + ((ConstantTreeNode)node).Value + " ";
+            else if (node.Symbol is ShotPower)
+                docNode[method]["code"].InnerText += " " + ((ShotPowerTreeNode)node).Value + " ";
+            else if (node.Symbol is LogicalValue)
+                docNode[method]["code"].InnerText += " " + ((BooleanTreeNode)node).Value.ToString().ToLower() + " ";
+            else if (node.Symbol is Block)
+            {
+                docNode[method]["code"].InnerText += "{\r\n";
+                foreach (ISymbolicExpressionTreeNode n in node.Subtrees)
+                    EvaluateTankProgram(n, docNode, method);
+                docNode[method]["code"].InnerText += "}\r\n";
+            }
+            else if (node.Symbol is IfStatement)
+            {
+                docNode[method]["code"].InnerText += "if(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ")\r\n";
+                EvaluateTankProgram(node.GetSubtree(1), docNode, method);
+                if (node.SubtreeCount == 3)
+                    EvaluateTankProgram(node.GetSubtree(2), docNode, method);
+            }
+            else if (node.Symbol is ElseStatement)
+            {
+                docNode[method]["code"].InnerText += "else\r\n";
+                if (node.SubtreeCount == 1)
+                    EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+            }
+            else if (node.Symbol is WhileLoop)
+            {
+                docNode[method]["code"].InnerText += "While(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ")\r\n";
+                EvaluateTankProgram(node.GetSubtree(1), docNode, method);
+            }
+            else if (node.Symbol is Ahead)
+            {
+                docNode[method]["code"].InnerText += "setAhead(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is Back)
+            {
+                docNode[method]["code"].InnerText += "setBack(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is SetAdjustGunForRobotTurn)
+            {
+                docNode[method]["code"].InnerText += "setAdjustGunForRobotTurn(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is SetAdjustRadarForGunTurn)
+            {
+                docNode[method]["code"].InnerText += "setAdjustRadarForGunTurn(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is SetAdjustRadarForRobotTurn)
+            {
+                docNode[method]["code"].InnerText += "setAdjustRadarForRobotTurn(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnGunLeft)
+            {
+                docNode[method]["code"].InnerText += "setTurnGunLeft(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnGunRight)
+            {
+                docNode[method]["code"].InnerText += "setTurnGunRight(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnLeft)
+            {
+                docNode[method]["code"].InnerText += "setTurnLeft(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnRadarLeft)
+            {
+                docNode[method]["code"].InnerText += "setTurnRadarLeft(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnRadarRight)
+            {
+                docNode[method]["code"].InnerText += "setTurnRadarRight(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is TurnRight)
+            {
+                docNode[method]["code"].InnerText += "setTurnRight(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.moves = 1;
+            }
+            else if (node.Symbol is Fire)
+            {
+                docNode[method]["code"].InnerText += "setFire(";
+                EvaluateTankProgram(node.GetSubtree(0), docNode, method);
+                docNode[method]["code"].InnerText += ");\r\n";
+                tankStats.shots = 1;
+            }
+            else if (node.Symbol is Run ||
+                node.Symbol is OnBulletHit ||
+                node.Symbol is OnBulletMissed ||
+                node.Symbol is OnHitByBullet ||
+                node.Symbol is OnHitRobot ||
+                node.Symbol is OnHitWall ||
+                node.Symbol is OnScannedRobot)
+            {
+                tankStats = new TankStats();
+                foreach (SymbolicExpressionTreeNode n in node.Subtrees)
+                {
+                    string methodName = node.Symbol.GetType().ToString().Split('.').Last();
+                    try
+                    {
+                        var tempStats = EvaluateTankProgram(n, docNode, methodName);
+                        tankStats.moves += tempStats.moves;
+                        tankStats.shots += tempStats.shots;
+                    }
+                    catch (Exception e)
+                    {
+                        //log += "NULL EXCEPTION ON:::::::: -" + methodName + "-\r\n";
+                        //foreach (XmlNode f in docNode[methodName])
+                        //    log += f.Name + "\r\n";
+                    }
+                }
+            }
+            else if (node.Symbol is Tank)
+            {
+                foreach (SymbolicExpressionTreeNode n in node.Subtrees)
+                {
+                    try
+                    {
+                        var tempStats = EvaluateTankProgram(n, docNode, method);
+                        tankStats.moves += tempStats.moves;
+                        tankStats.shots += tempStats.shots;
+                    }
+                    catch (Exception e) { }
+                }
+            }
+            else
+                tankStats = EvaluateTankProgram(node.GetSubtree(0), docNode, null);
+
+            //log += tankStats.shots + " / " + tankStats.moves + "\r\n";
+            //File.AppendAllText("../TankLog.txt", log);
+
+            return tankStats;
+        }
+
+        public static string InterpretProgramTree(ISymbolicExpressionTreeNode node)
+        {
+            var tankNode = node;
+            while (!(tankNode.Symbol is Tank))
+                tankNode = tankNode.GetSubtree(0);
+            return ((CodeNode)tankNode.Symbol).Interpret(tankNode, tankNode.Subtrees);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Plugin.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Plugin.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Plugin.cs	(revision 9565)
@@ -0,0 +1,21 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [Plugin("HeuristicLab.Problems.Robocode", "The Robocode problem for genetic programming.", "1.1")]
+    [PluginFile("HeuristicLab.Problems.Robocode-1.1.dll", PluginFileType.Assembly)]
+    [PluginDependency("HeuristicLab.Data", "3.3")]
+    [PluginDependency("HeuristicLab.Core", "3.3")]
+    [PluginDependency("HeuristicLab.Common", "3.3")]
+    [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+    [PluginDependency("HeuristicLab.Parameters", "3.3")]
+    [PluginDependency("HeuristicLab.Persistence", "3.3")]
+    public class Plugin : PluginBase
+    {
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Problem.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Problem.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Problem.cs	(revision 9565)
@@ -0,0 +1,209 @@
+﻿using System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    [Creatable("Problems")]
+    [Item("Robocode Problem",
+          "The Robocode problem for genetic programming.")]
+    public class Problem : SingleObjectiveHeuristicOptimizationProblem<Evaluator,
+      ISymbolicExpressionTreeCreator>
+    {
+        #region parameter names
+        private const string TankProgramParameterName = "TankProgram";
+        private const string MaxTankProgramLengthParameterName =
+          "MaxProgramLength";
+        private const string MaxTankProgramDepthParameterName =
+          "MaxProgramDepth";
+        private const string TankGrammarParameterName = "Grammar";
+        private const string RobocodePathParamaterName = "Path";
+        private const string CoevolutionParameterName = "Coevolution";
+        #endregion
+
+        #region parameters
+        public IFixedValueParameter<IntValue> MaxTankProgramLengthParameter
+        {
+            get
+            {
+                return (IFixedValueParameter<IntValue>)
+                  Parameters[MaxTankProgramLengthParameterName];
+            }
+        }
+        public IFixedValueParameter<IntValue> MaxTankProgramDepthParameter
+        {
+            get
+            {
+                return (IFixedValueParameter<IntValue>)
+                  Parameters[MaxTankProgramDepthParameterName];
+            }
+        }
+        public IValueParameter<Grammar> GrammarParameter
+        {
+            get
+            {
+                return (IValueParameter<Grammar>)
+                  Parameters[TankGrammarParameterName];
+            }
+        }
+        public IFixedValueParameter<StringValue> RobocodePathParameter
+        {
+            get
+            {
+                return (IFixedValueParameter<StringValue>)
+                    Parameters[RobocodePathParamaterName];
+            }
+        }
+        public IFixedValueParameter<BoolValue> CoevolutionParameter
+        {
+            get
+            {
+                return (IFixedValueParameter<BoolValue>)
+                    Parameters[CoevolutionParameterName];
+            }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected Problem(bool deserializing)
+            : base(deserializing)
+        {
+        }
+        protected Problem(Problem original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        // default constructor for the problem
+        // also creates the fitness evaluation operator (Evaluator), 
+        // and the tree creation operator (RampedHalfAndHalfTreeCreator)
+        public Problem()
+            : base(new Evaluator(), new RampedHalfAndHalfTreeCreator())
+        {
+           Parameters.Add(
+              new FixedValueParameter<IntValue>(
+                MaxTankProgramDepthParameterName,
+                "Maximal depth of the Robocode tank program.",
+                new IntValue(6)));
+            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()));
+            Parameters.Add(new FixedValueParameter<StringValue>(
+                RobocodePathParamaterName,
+                "Path of the Robocode installation.",
+                new StringValue("F:/robocode2")));
+            Parameters.Add(new FixedValueParameter<BoolValue>(
+                CoevolutionParameterName,
+                "Use Coevolution", new BoolValue(false)));
+
+            Maximization.Value = true;
+            InitializeOperators();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Problem(this, cloner);
+        }
+
+        private void InitializeOperators()
+        {
+            Operators.AddRange(
+              ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>());
+            Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
+            Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
+            Operators.Add(new BestSolutionAnalyzer());
+            ParameterizeOperators();
+            ParameterizeAnalyzers();
+        }
+
+        protected override void OnEvaluatorChanged()
+        {
+            base.OnEvaluatorChanged();
+            Evaluator.TankProgramParameter.ActualName =
+              TankProgramParameterName;
+            ParameterizeAnalyzers();
+            ParameterizeOperators();
+        }
+
+        protected override void OnSolutionCreatorChanged()
+        {
+            base.OnSolutionCreatorChanged();
+            SolutionCreator.SymbolicExpressionTreeParameter.ActualName =
+              TankProgramParameterName;
+            ParameterizeAnalyzers();
+            ParameterizeOperators();
+        }
+
+        private void ParameterizeAnalyzers()
+        {
+            var analyzers = Operators.OfType<IAnalyzer>();
+            foreach (var o in analyzers.OfType<ISymbolicExpressionTreeAnalyzer>())
+            {
+                o.SymbolicExpressionTreeParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+            }
+            foreach (var o in analyzers.OfType<BestSolutionAnalyzer>())
+            {
+                o.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+            }
+        }
+
+        private void ParameterizeOperators()
+        {
+            var operators = Parameters
+              .OfType<IValueParameter>()
+              .Select(p => p.Value)
+              .OfType<IOperator>()
+              .Union(Operators);
+            foreach (var o in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>())
+            {
+                o.SymbolicExpressionTreeGrammarParameter.ActualName =
+                  TankGrammarParameterName;
+            }
+            foreach (var o in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>())
+            {
+                o.MaximumSymbolicExpressionTreeDepthParameter.ActualName =
+                  MaxTankProgramDepthParameterName;
+                o.MaximumSymbolicExpressionTreeLengthParameter.ActualName =
+                  MaxTankProgramLengthParameterName;
+            }
+            foreach (var op in operators.OfType<Evaluator>())
+            {
+                op.TankProgramParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+            }
+            foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>())
+            {
+                op.ParentsParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+                op.ChildParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+            }
+            foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>())
+            {
+                op.SymbolicExpressionTreeParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+            }
+            foreach (var op in operators.OfType<ISymbolicExpressionTreeCreator>())
+            {
+                op.SymbolicExpressionTreeParameter.ActualName =
+                  SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+            }
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Properties/AssemblyInfo.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Properties/AssemblyInfo.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Properties/AssemblyInfo.cs	(revision 9565)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.Robocode")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab.Problems.Robocode")]
+[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2c868882-c1a8-4d94-9fdb-9c104891a150")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Solution.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Solution.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Solution.cs	(revision 9565)
@@ -0,0 +1,68 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public sealed class Solution : NamedItem
+    {
+        //private int moves;
+        //[Storable]
+        //public int Moves
+        //{
+        //    get { return moves; }
+        //    private set { this.moves = value; }
+        //}
+        //private int shots;
+        //[Storable]
+        //public int Shots
+        //{
+        //    get { return shots; }
+        //    private set { this.shots = value; }
+        //}
+        private ISymbolicExpressionTree tree;
+        [Storable]
+        public ISymbolicExpressionTree Tree
+        {
+            get { return tree; }
+            private set { this.tree = value; }
+        }
+
+        private double quality;
+        [Storable]
+        public double Quality
+        {
+            get { return quality; }
+            private set { this.quality = value; }
+        }
+
+        [StorableConstructor]
+        private Solution(bool deserializing) : base(deserializing) { }
+        private Solution(Solution original, Cloner cloner)
+            : base(original, cloner)
+        {
+            //this.moves = original.moves;
+            //this.shots = original.shots;
+            this.tree = cloner.Clone(tree);
+        }
+
+        public Solution(ISymbolicExpressionTree tree, double quality)// int moves, int shots)
+            : base("Solution", "A tank program.")
+        {
+            this.tree = tree;
+            this.quality = quality;
+            //this.moves = moves;
+            //this.shots = shots;
+        }
+        [StorableHook(HookType.AfterDeserialization)]
+        private void AfterDeserialization()
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Solution(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.Designer.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.Designer.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.Designer.cs	(revision 9565)
@@ -0,0 +1,88 @@
+﻿namespace HeuristicLab.Problems.Robocode
+{
+    partial class SolutionCodeView
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.programCode = new System.Windows.Forms.TextBox();
+            this.btnRunInRobocode = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // nameTextBox
+            // 
+            this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+            this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+            // 
+            // programCode
+            // 
+            this.programCode.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.programCode.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.programCode.Location = new System.Drawing.Point(0, 0);
+            this.programCode.Multiline = true;
+            this.programCode.Name = "programCode";
+            this.programCode.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.programCode.Size = new System.Drawing.Size(351, 238);
+            this.programCode.TabIndex = 3;
+            // 
+            // btnRunInRobocode
+            // 
+            this.btnRunInRobocode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnRunInRobocode.AutoSize = true;
+            this.btnRunInRobocode.Location = new System.Drawing.Point(228, 3);
+            this.btnRunInRobocode.Name = "btnRunInRobocode";
+            this.btnRunInRobocode.Size = new System.Drawing.Size(98, 23);
+            this.btnRunInRobocode.TabIndex = 4;
+            this.btnRunInRobocode.Text = "Run in Robocode";
+            this.btnRunInRobocode.UseVisualStyleBackColor = true;
+            this.btnRunInRobocode.Click += new System.EventHandler(this.btnRunInRobocode_Click);
+            // 
+            // SolutionCodeView
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.btnRunInRobocode);
+            this.Controls.Add(this.programCode);
+            this.Name = "SolutionCodeView";
+            this.Size = new System.Drawing.Size(351, 238);
+            this.Controls.SetChildIndex(this.nameLabel, 0);
+            this.Controls.SetChildIndex(this.nameTextBox, 0);
+            this.Controls.SetChildIndex(this.infoLabel, 0);
+            this.Controls.SetChildIndex(this.programCode, 0);
+            this.Controls.SetChildIndex(this.btnRunInRobocode, 0);
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox programCode;
+        private System.Windows.Forms.Button btnRunInRobocode;
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.cs	(revision 9565)
@@ -0,0 +1,82 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using System.Diagnostics;
+using System.IO;
+
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [View("Robocode Tank Code View")]
+    [Content(typeof(Solution), IsDefaultView = true)]
+    public partial class SolutionCodeView : NamedItemView
+    {
+        public new Solution Content
+        {
+            get { return (Solution)base.Content; }
+            set { base.Content = value; }
+        }
+
+        public SolutionCodeView() : base()
+        {
+            InitializeComponent();
+            this.programCode.Text = "";
+        }
+
+        protected override void OnContentChanged()
+        {
+            base.OnContentChanged();
+            if (Content == null)
+            {
+                this.programCode.Text = "";
+            }
+            else
+            {
+                string code = Interpreter.InterpretProgramTree(Content.Tree.Root);
+                code = code.Replace("class output extends", "class BestSolution extends");
+                this.programCode.Text = code;
+                File.AppendAllText("F:/robocode/robots/Evaluation/PreviousBestSolution.java", "\r\n/**********************************************/\r\n" + code);
+                File.WriteAllText("F:/robocode/robots/Evaluation/BestSolution.java", code, System.Text.Encoding.Default);
+            }
+        }
+
+        private void btnRunInRobocode_Click(object sender, EventArgs e)
+        {
+            ProcessStartInfo javaCompileInfo = new ProcessStartInfo();
+            javaCompileInfo.FileName = "cmd.exe";
+            javaCompileInfo.Arguments = "/C javac -cp F:\\robocode\\libs\\robocode.jar F:\\robocode\\robots\\Evaluation\\BestSolution.java";
+            javaCompileInfo.RedirectStandardOutput = true;
+            javaCompileInfo.RedirectStandardError = true;
+            javaCompileInfo.UseShellExecute = false;
+            javaCompileInfo.CreateNoWindow = true;
+
+            Process javaCompile = new Process();
+            javaCompile.StartInfo = javaCompileInfo;
+            javaCompile.Start();
+            javaCompile.WaitForExit();
+
+            ProcessStartInfo evaluateCodeInfo = new ProcessStartInfo();
+            evaluateCodeInfo.FileName = "cmd.exe";
+            //javaCompileInfo.Arguments = "/C javac -cp C:\\robocode\\libs\\robocode.jar \"" + path + "\\Spaced Up\\output.java\"";
+            evaluateCodeInfo.Arguments = "/C java -classpath F:\\robocode\\libs;F:\\robocode\\libs\\robocode.core-1.8.1.0.jar;F:\\robocode\\libs\\robocode.jar;F:\\robocode\\libs\\picocontainer-2.14.2.jar BattleRunner Evaluation.BestSolution*";
+            //Console.WriteLine(javaCompileInfo.Arguments);
+            evaluateCodeInfo.RedirectStandardOutput = true;
+            evaluateCodeInfo.RedirectStandardError = true;
+            evaluateCodeInfo.UseShellExecute = false;
+
+            Process evaluateCode = new Process();
+            evaluateCode.StartInfo = evaluateCodeInfo;
+            evaluateCode.Start();
+            evaluateCode.WaitForExit();
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.resx
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.resx	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionCodeView.resx	(revision 9565)
@@ -0,0 +1,129 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>140, 17</value>
+  </metadata>
+</root>
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.Designer.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.Designer.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.Designer.cs	(revision 9565)
@@ -0,0 +1,68 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.Robocode {
+  partial class SolutionProgramView {
+    private Panel panel;
+    private GraphicalSymbolicExpressionTreeView graphTreeView;
+
+    private void InitializeComponent() {
+      this.panel = new System.Windows.Forms.Panel();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      // 
+      // panel
+      // 
+      this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.panel.Location = new System.Drawing.Point(3, 26);
+      this.panel.Name = "panel";
+      this.panel.Size = new System.Drawing.Size(345, 190);
+      this.panel.TabIndex = 3;
+      // 
+      // SolutionProgramView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Controls.Add(this.panel);
+      this.Name = "SolutionProgramView";
+      this.Size = new System.Drawing.Size(351, 219);
+      this.Controls.SetChildIndex(this.panel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+  }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/SolutionProgramView.cs	(revision 9565)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.Robocode {
+  [View("Robocode Tank Program Tree View")]
+  [Content(typeof(Solution), IsDefaultView = false)]
+  public sealed partial class SolutionProgramView : NamedItemView {
+    public new Solution Content {
+      get { return (Solution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SolutionProgramView() {
+      InitializeComponent();
+      this.graphTreeView = new GraphicalSymbolicExpressionTreeView();
+      graphTreeView.Dock = DockStyle.Fill;
+      panel.Controls.Add(graphTreeView);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        graphTreeView.Content = null;
+      } else {
+        graphTreeView.Content = Content.Tree;
+      }
+    }
+
+  }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Constant.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Constant.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Constant.cs	(revision 9565)
@@ -0,0 +1,34 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Constant : Symbol
+    {
+        public override int MinimumArity { get { return 0; } }
+        public override int MaximumArity { get { return 0; } }
+
+        [StorableConstructor]
+        private Constant(bool deserializing) : base(deserializing) { }
+        private Constant(Constant original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public Constant()
+            : base("Constant", "A random fixed integer.")
+        {
+        }
+
+        public override ISymbolicExpressionTreeNode CreateTreeNode()
+        {
+            return new ConstantTreeNode();
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Constant(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/ConstantTreeNode.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/ConstantTreeNode.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/ConstantTreeNode.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class ConstantTreeNode : SymbolicExpressionTreeTerminalNode
+    {
+        private int value;
+        [Storable]
+        public int Value
+        {
+            get { return value; }
+            private set { this.value = value; }
+        }
+
+        [StorableConstructor]
+        private ConstantTreeNode(bool deserializing) : base(deserializing) { }
+        private ConstantTreeNode(ConstantTreeNode original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.value = original.value;
+        }
+
+        public ConstantTreeNode()
+            : base(new Constant())
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new ConstantTreeNode(this, cloner);
+        }
+
+        public override bool HasLocalParameters
+        {
+            get { return true; }
+        }
+
+        public override void ResetLocalParameters(IRandom random)
+        {
+            value = random.Next(-360, 360);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Independent.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Independent.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/Independent.cs	(revision 9565)
@@ -0,0 +1,34 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    /*[StorableClass]
+    public class Independent : Symbol
+    {
+        public override int MinimumArity { get { return 0; } }
+        public override int MaximumArity { get { return 0; } }
+
+        [StorableConstructor]
+        private Independent(bool deserializing) : base(deserializing) { }
+        private Independent(Independent original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public Independent()
+            : base("Independent", "A random fixed integer.")
+        {
+        }
+
+        public override ISymbolicExpressionTreeNode CreateTreeNode()
+        {
+            return new BooleanTreeNode();
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Independent(this, cloner);
+        }
+    }*/
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustGunForRobotTurn.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustGunForRobotTurn.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustGunForRobotTurn.cs	(revision 9565)
@@ -0,0 +1,30 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class SetAdjustGunForRobotTurn : Symbol
+    {
+        public override int MinimumArity { get { return 1; } }
+        public override int MaximumArity { get { return 1; } }
+
+        [StorableConstructor]
+        private SetAdjustGunForRobotTurn(bool deserializing) : base(deserializing) { }
+        private SetAdjustGunForRobotTurn(SetAdjustGunForRobotTurn original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public SetAdjustGunForRobotTurn()
+            : base("SetAdjustGunForRobotTurn", "Sets the gun to turn independent from the robot's turn.")
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SetAdjustGunForRobotTurn(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForGunTurn.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForGunTurn.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForGunTurn.cs	(revision 9565)
@@ -0,0 +1,30 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class SetAdjustRadarForGunTurn : Symbol
+    {
+        public override int MinimumArity { get { return 1; } }
+        public override int MaximumArity { get { return 1; } }
+
+        [StorableConstructor]
+        private SetAdjustRadarForGunTurn(bool deserializing) : base(deserializing) { }
+        private SetAdjustRadarForGunTurn(SetAdjustRadarForGunTurn original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public SetAdjustRadarForGunTurn()
+            : base("SetAdjustRadarForGunTurn", "Sets the radar to turn independent from the gun's turn.")
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SetAdjustRadarForGunTurn(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForRobotTurn.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForRobotTurn.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Abandoned/SetAdjustRadarForRobotTurn.cs	(revision 9565)
@@ -0,0 +1,30 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class SetAdjustRadarForRobotTurn : Symbol
+    {
+        public override int MinimumArity { get { return 1; } }
+        public override int MaximumArity { get { return 1; } }
+
+        [StorableConstructor]
+        private SetAdjustRadarForRobotTurn(bool deserializing) : base(deserializing) { }
+        private SetAdjustRadarForRobotTurn(SetAdjustRadarForRobotTurn original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public SetAdjustRadarForRobotTurn()
+            : base("SetAdjustRadarForRobotTurn", "Sets the radar to turn independent from the robot's turn.")
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SetAdjustRadarForRobotTurn(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Block.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Block.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Block.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Block : CodeNode
+    {
+        public override int MinimumArity { get { return 1; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private Block(bool deserializing) : base(deserializing) { }
+        private Block(Block original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "{\r\n\t";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        public Block()
+            : base("Block", "A group of statements.")
+        {
+            this.Prefix = "{\r\n\t";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Block(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/ElseStatement.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/ElseStatement.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/ElseStatement.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class ElseStatement : 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]
+        private ElseStatement(bool deserializing) : base(deserializing) { }
+        private ElseStatement(ElseStatement original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "else";
+            this.Suffix = "";
+        }
+
+        public ElseStatement()
+            : base("ElseStatement", "An ElseStatement.")
+        {
+            this.Prefix = "else";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new ElseStatement(this, cloner);
+        }
+
+        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 (result == "")? "" : this.Prefix + "\r\n" + result + "\r\n" + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/IfStatement.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/IfStatement.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/IfStatement.cs	(revision 9565)
@@ -0,0 +1,58 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class IfStatement : 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]
+        private IfStatement(bool deserializing) : base(deserializing) { }
+        private IfStatement(IfStatement original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "if(";
+            this.Suffix = ")";
+        }
+
+        public IfStatement()
+            : base("IfStatement", "An IfStatement.")
+        {
+            this.Prefix = "if(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new IfStatement(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            string condition = "", ifTrue = "", ifElse = "";
+            foreach (ISymbolicExpressionTreeNode c in children)
+            {
+                if(c.Symbol is LogicalExpression)
+                    condition = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+                else if(c.Symbol is Block)
+                    ifTrue = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+                else if(c.Symbol is ElseStatement || c.Symbol is DoNothing)
+                    ifElse = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+                else
+                    throw new System.Exception("Unexpected Child node.");
+            }
+            return this.Prefix + " " + condition + " " + this.Suffix +
+                "\r\n" + ifTrue + "\r\n" + ifElse + "\r\n";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/WhileLoop.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/WhileLoop.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Branches/WhileLoop.cs	(revision 9565)
@@ -0,0 +1,56 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class WhileLoop : 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]
+        private WhileLoop(bool deserializing) : base(deserializing) { }
+        private WhileLoop(WhileLoop original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "while(";
+            this.Suffix = ")";
+        }
+
+        public WhileLoop()
+            : base("WhileLoop", "A WhileLoop.")
+        {
+            this.Prefix = "while(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new WhileLoop(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            string condition = "", ifTrue = "";
+            foreach (ISymbolicExpressionTreeNode c in children)
+            {
+                if (c.Symbol is LogicalExpression)
+                    condition = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+                else if (c.Symbol is Block)
+                    ifTrue = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
+                else
+                    throw new System.Exception("Unexpected Child node.");
+            }
+            return this.Prefix + " " + condition + " " + this.Suffix +
+                "\r\n" + ifTrue + "\r\n";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNode.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNode.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNode.cs	(revision 9565)
@@ -0,0 +1,40 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public abstract class CodeNode : Symbol
+    {
+        public abstract string Prefix { get; set; }
+        public abstract string Suffix { get; set; }
+
+        [StorableConstructor]
+        protected CodeNode(bool deserializing) : base(deserializing) { }
+        protected CodeNode(CodeNode original, Cloner cloner)
+            : base(original, cloner) { }
+        protected CodeNode(string name, string description)
+            : base(name, description)
+        {
+        }
+
+        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);
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.Designer.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.Designer.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.Designer.cs	(revision 9565)
@@ -0,0 +1,155 @@
+﻿namespace HeuristicLab.Problems.Robocode
+{
+    partial class CodeNodeView
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.prefixCode = new System.Windows.Forms.TextBox();
+            this.prefixLabel = new System.Windows.Forms.Label();
+            this.suffixLabel = new System.Windows.Forms.Label();
+            this.suffixCode = new System.Windows.Forms.TextBox();
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // initialFrequencyLabel
+            // 
+            //this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+            //// 
+            //// initialFrequencyTextBox
+            //// 
+            //this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+            //// 
+            //// minimumArityLabel
+            //// 
+            //this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
+            //// 
+            //// maximumArityLabel
+            //// 
+            //this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
+            //// 
+            //// minimumArityTextBox
+            //// 
+            //this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+            //// 
+            //// maximumArityTextBox
+            //// 
+            //this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+            // 
+            // nameTextBox
+            // 
+            this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+            this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+            this.nameTextBox.Visible = false;
+            // 
+            // nameLabel
+            // 
+            this.nameLabel.Visible = false;
+            // 
+            // infoLabel
+            // 
+            this.infoLabel.Visible = false;
+            // 
+            // prefixCode
+            // 
+            this.prefixCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.prefixCode.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.prefixCode.Location = new System.Drawing.Point(6, 19);
+            this.prefixCode.Multiline = true;
+            this.prefixCode.Name = "prefixCode";
+            this.prefixCode.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.prefixCode.Size = new System.Drawing.Size(333, 93);
+            this.prefixCode.TabIndex = 3;
+            this.prefixCode.Leave += new System.EventHandler(this.prefixCode_Leave);
+            // 
+            // prefixLabel
+            // 
+            this.prefixLabel.AutoSize = true;
+            this.prefixLabel.Location = new System.Drawing.Point(3, 3);
+            this.prefixLabel.Name = "prefixLabel";
+            this.prefixLabel.Size = new System.Drawing.Size(35, 13);
+            this.prefixLabel.TabIndex = 4;
+            this.prefixLabel.Text = "Prefix";
+            // 
+            // suffixLabel
+            // 
+            this.suffixLabel.AutoSize = true;
+            this.suffixLabel.Location = new System.Drawing.Point(6, 115);
+            this.suffixLabel.Name = "suffixLabel";
+            this.suffixLabel.Size = new System.Drawing.Size(35, 13);
+            this.suffixLabel.TabIndex = 5;
+            this.suffixLabel.Text = "Suffix";
+            // 
+            // suffixCode
+            // 
+            this.suffixCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.suffixCode.Location = new System.Drawing.Point(6, 131);
+            this.suffixCode.Multiline = true;
+            this.suffixCode.Name = "suffixCode";
+            this.suffixCode.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
+            this.suffixCode.Size = new System.Drawing.Size(333, 87);
+            this.suffixCode.TabIndex = 6;
+            this.suffixCode.Leave += new System.EventHandler(this.suffixCode_Leave);
+            // 
+            // CodeNodeView
+            // 
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+            this.Controls.Add(this.suffixCode);
+            this.Controls.Add(this.suffixLabel);
+            this.Controls.Add(this.prefixLabel);
+            this.Controls.Add(this.prefixCode);
+            this.Name = "CodeNodeView";
+            this.Size = new System.Drawing.Size(351, 238);
+            //this.Controls.SetChildIndex(this.enabledCheckBox, 0);
+            //this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+            //this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+            //this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+            //this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+            //this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+            //this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+            this.Controls.SetChildIndex(this.nameLabel, 0);
+            this.Controls.SetChildIndex(this.nameTextBox, 0);
+            this.Controls.SetChildIndex(this.infoLabel, 0);
+            this.Controls.SetChildIndex(this.prefixCode, 0);
+            this.Controls.SetChildIndex(this.prefixLabel, 0);
+            this.Controls.SetChildIndex(this.suffixLabel, 0);
+            this.Controls.SetChildIndex(this.suffixCode, 0);
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox prefixCode;
+        private System.Windows.Forms.Label prefixLabel;
+        private System.Windows.Forms.Label suffixLabel;
+        private System.Windows.Forms.TextBox suffixCode;
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.cs	(revision 9565)
@@ -0,0 +1,64 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using System.Diagnostics;
+using System.IO;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [View("CodeNode View")]
+    [Content(typeof(CodeNode), IsDefaultView = true)]
+    public partial class CodeNodeView : NamedItemView
+    {
+        public CodeNode Content
+        {
+            get { return (CodeNode)base.Content; }
+            set { base.Content = value; }
+        }
+
+        public CodeNodeView() : base()
+        {
+            InitializeComponent();
+            //this.prefixCode.Text = Content.Prefix;
+            //this.suffixCode.Text = Content.Suffix;
+        }
+
+        protected override void OnContentChanged()
+        {
+            base.OnContentChanged();
+            if (Content == null)
+            {
+                this.prefixCode.Text = "";
+                this.suffixCode.Text = "";
+            }
+            else
+            {
+                this.prefixCode.Text = Content.Prefix;
+                this.suffixCode.Text = Content.Suffix;
+                //Content.Prefix = this.prefixCode.Text;
+                //Content.Suffix = this.suffixCode.Text;
+            }
+        }
+
+        private void prefixCode_Leave(object sender, EventArgs e)
+        {
+            Content.Prefix = this.prefixCode.Text;
+        }
+
+        private void suffixCode_Leave(object sender, EventArgs e)
+        {
+            Content.Suffix = this.suffixCode.Text;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.resx
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.resx	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.resx	(revision 9565)
@@ -0,0 +1,132 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>140, 17</value>
+  </metadata>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>140, 17</value>
+  </metadata>
+</root>
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletHit.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletHit.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletHit.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnBulletHit : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnBulletHit(bool deserializing) : base(deserializing) { }
+        private OnBulletHit(OnBulletHit original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void onBulletHit(BulletHitEvent e) {\r\n";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnBulletHit(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletMissed.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletMissed.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnBulletMissed.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnBulletMissed : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnBulletMissed(bool deserializing) : base(deserializing) { }
+        private OnBulletMissed(OnBulletMissed original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void onBulletMissed(BulletMissedEvent e) {\r\n";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnBulletMissed(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitByBullet.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitByBullet.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitByBullet.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnHitByBullet : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnHitByBullet(bool deserializing) : base(deserializing) { }
+        private OnHitByBullet(OnHitByBullet original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void onHitByBullet(HitByBulletEvent e) {\r\n";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnHitByBullet(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitRobot.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitRobot.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitRobot.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnHitRobot : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnHitRobot(bool deserializing) : base(deserializing) { }
+        private OnHitRobot(OnHitRobot original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void onHitRobot(HitRobotEvent e) {\r\n";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnHitRobot(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitWall.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitWall.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnHitWall.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnHitWall : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnHitWall(bool deserializing) : base(deserializing) { }
+        private OnHitWall(OnHitWall original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void onHitWall(HitWallEvent e) {\r\n";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnHitWall(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnScannedRobot.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnScannedRobot.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/OnScannedRobot.cs	(revision 9565)
@@ -0,0 +1,54 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class OnScannedRobot : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private OnScannedRobot(bool deserializing) : base(deserializing) { }
+        private OnScannedRobot(OnScannedRobot original, Cloner cloner)
+            : base(original, cloner)
+        {
+            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";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new OnScannedRobot(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Run.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Run.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Run.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Run : CodeNode
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return 10; } }
+        
+        [Storable]
+        public override string Prefix { get; set; }
+        
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private Run(bool deserializing) : base(deserializing) { }
+        private Run(Run original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "\r\npublic void run() {\r\n\tsetAdjustGunForRobotTurn(true);\r\n\tturnRadarRightRadians(Double.POSITIVE_INFINITY);";
+            this.Suffix = "\r\nexecute();\r\n}\r\n";
+        }
+
+        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";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Run(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/BooleanTreeNode.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/BooleanTreeNode.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/BooleanTreeNode.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class BooleanTreeNode : SymbolicExpressionTreeTerminalNode
+    {
+        private bool value;
+        [Storable]
+        public bool Value
+        {
+            get { return value; }
+            private set { this.value = value; }
+        }
+
+        [StorableConstructor]
+        private BooleanTreeNode(bool deserializing) : base(deserializing) { }
+        private BooleanTreeNode(BooleanTreeNode original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.value = original.value;
+        }
+
+        public BooleanTreeNode()
+            : base(new LogicalValue())
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new BooleanTreeNode(this, cloner);
+        }
+
+        public override bool HasLocalParameters
+        {
+            get { return true; }
+        }
+
+        public override void ResetLocalParameters(IRandom random)
+        {
+            value = (bool)(random.Next(0, 1) == 1);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Conjunction.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿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)
+        {
+            this.Prefix = "&&";
+            this.Suffix = "";
+        }
+
+        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/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Disjunction.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿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)
+        {
+            this.Prefix = "||";
+            this.Suffix = "";
+        }
+
+        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/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Equal.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Equal.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/Equal.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Equal : 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 Equal(bool deserializing) : base(deserializing) { }
+        private Equal(Equal original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "==";
+            this.Suffix = "";
+        }
+
+        public Equal()
+            : base("Equal", "Equal comparator.")
+        {
+            this.Prefix = "==";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Equal(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + " " + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThan.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GreaterThan : 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 GreaterThan(bool deserializing) : base(deserializing) { }
+        private GreaterThan(GreaterThan original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = ">";
+            this.Suffix = "";
+        }
+
+        public GreaterThan()
+            : base("GreaterThan", "GreaterThan comparator.")
+        {
+            this.Prefix = ">";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GreaterThan(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + " " + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/GreaterThanOrEqual.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GreaterThanOrEqual : 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 GreaterThanOrEqual(bool deserializing) : base(deserializing) { }
+        private GreaterThanOrEqual(GreaterThanOrEqual original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = ">=";
+            this.Suffix = "";
+        }
+
+        public GreaterThanOrEqual()
+            : base("GreaterThanOrEqual", "GreaterThanOrEqual comparator.")
+        {
+            this.Prefix = ">=";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GreaterThanOrEqual(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + " " + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThan.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThan.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThan.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class LessThan : 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 LessThan(bool deserializing) : base(deserializing) { }
+        private LessThan(LessThan original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "<";
+            this.Suffix = "";
+        }
+
+        public LessThan()
+            : base("LessThan", "LessThan comparator.")
+        {
+            this.Prefix = "<";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new LessThan(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + " " + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Logical Comparators/LessThanOrEqual.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class LessThanOrEqual : 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 LessThanOrEqual(bool deserializing) : base(deserializing) { }
+        private LessThanOrEqual(LessThanOrEqual original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "<=";
+            this.Suffix = "";
+        }
+
+        public LessThanOrEqual()
+            : base("LessThanOrEqual", "LessThanOrEqual comparator.")
+        {
+            this.Prefix = "<=";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new LessThanOrEqual(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + " " + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalComparison.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalComparison.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalComparison.cs	(revision 9565)
@@ -0,0 +1,75 @@
+﻿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)
+        {
+            this.Prefix = "(";
+            this.Suffix = ")";
+        }
+
+        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/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalExpression.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalExpression.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalExpression.cs	(revision 9565)
@@ -0,0 +1,60 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class LogicalExpression : 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]
+        private LogicalExpression(bool deserializing) : base(deserializing) { }
+        private LogicalExpression(LogicalExpression original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public LogicalExpression()
+            : base("LogicalExpression", "A LogicalExpression.")
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new LogicalExpression(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalValue.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalValue.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/LogicalValue.cs	(revision 9565)
@@ -0,0 +1,51 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class LogicalValue : 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 LogicalValue(bool deserializing) : base(deserializing) { }
+        private LogicalValue(LogicalValue original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public LogicalValue()
+            : base("LogicalValue", "A LogicalValue.")
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public override ISymbolicExpressionTreeNode CreateTreeNode()
+        {
+
+            return new BooleanTreeNode();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new LogicalValue(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return " " + ((BooleanTreeNode)node).Value.ToString().ToLower() + " ";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Negation.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Negation.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/Negation.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Negation : 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]
+        private Negation(bool deserializing) : base(deserializing) { }
+        private Negation(Negation original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "!(";
+            this.Suffix = ")";
+        }
+
+        public Negation()
+            : base("Negation", "A Negation.")
+        {
+            this.Prefix = "!(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Negation(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/NumericalComparison.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/NumericalComparison.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Logical Expressions/NumericalComparison.cs	(revision 9565)
@@ -0,0 +1,79 @@
+﻿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)
+        {
+            this.Prefix = "(";
+            this.Suffix = ")";
+        }
+
+        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/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Number.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Number.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Number.cs	(revision 9565)
@@ -0,0 +1,51 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Number : 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 Number(bool deserializing) : base(deserializing) { }
+        private Number(Number original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public Number()
+            : base("Number", "A Number.")
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public override ISymbolicExpressionTreeNode CreateTreeNode()
+        {
+            
+            return new NumberTreeNode();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Number(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return " " + ((NumberTreeNode)node).Value + " ";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumberTreeNode.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumberTreeNode.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumberTreeNode.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class NumberTreeNode : SymbolicExpressionTreeTerminalNode
+    {
+        private int value;
+        [Storable]
+        public int Value
+        {
+            get { return value; }
+            private set { this.value = value; }
+        }
+
+        [StorableConstructor]
+        private NumberTreeNode(bool deserializing) : base(deserializing) { }
+        private NumberTreeNode(NumberTreeNode original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.value = original.value;
+        }
+
+        public NumberTreeNode()
+            : base(new Number())
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new NumberTreeNode(this, cloner);
+        }
+
+        public override bool HasLocalParameters
+        {
+            get { return true; }
+        }
+
+        public override void ResetLocalParameters(IRandom random)
+        {
+            value = random.Next(-360, 360);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Addition.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Addition.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Addition.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Addition : 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 Addition(bool deserializing) : base(deserializing) { }
+        private Addition(Addition original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "+";
+            this.Suffix = "";
+        }
+
+        public Addition()
+            : base("Addition", "Addition operator.")
+        {
+            this.Prefix = "+";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Addition(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Division.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Division.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Division.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Division : 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 Division(bool deserializing) : base(deserializing) { }
+        private Division(Division original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "/";
+            this.Suffix = "";
+        }
+
+        public Division()
+            : base("Division", "Division operator.")
+        {
+            this.Prefix = "/";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Division(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Modulus.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Modulus : 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 Modulus(bool deserializing) : base(deserializing) { }
+        private Modulus(Modulus original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "%";
+            this.Suffix = "";
+        }
+
+        public Modulus()
+            : base("Modulus", "Modulus operator.")
+        {
+            this.Prefix = "%";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Modulus(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Multiplication.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Multiplication : 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 Multiplication(bool deserializing) : base(deserializing) { }
+        private Multiplication(Multiplication original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "*";
+            this.Suffix = "";
+        }
+
+        public Multiplication()
+            : base("Multiplication", "Multiplication operator.")
+        {
+            this.Prefix = "*";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Multiplication(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/Numerical Operators/Subtraction.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Subtraction : 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 Subtraction(bool deserializing) : base(deserializing) { }
+        private Subtraction(Subtraction original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "-";
+            this.Suffix = "";
+        }
+
+        public Subtraction()
+            : base("Subtraction", "Subtraction operator.")
+        {
+            this.Prefix = "-";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Subtraction(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalExpression.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalExpression.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalExpression.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class NumericalExpression : 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]
+        private NumericalExpression(bool deserializing) : base(deserializing) { }
+        private NumericalExpression(NumericalExpression original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public NumericalExpression()
+            : base("NumericalExpression", "A NumericalExpression.")
+        {
+            this.Prefix = "";
+            this.Suffix = "";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new NumericalExpression(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalOperation.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalOperation.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/NumericalOperation.cs	(revision 9565)
@@ -0,0 +1,79 @@
+﻿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)
+        {
+            this.Prefix = "(";
+            this.Suffix = ")";
+        }
+
+        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/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPower.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPower.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPower.cs	(revision 9565)
@@ -0,0 +1,46 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class ShotPower : 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 ShotPower(bool deserializing) : base(deserializing) { }
+        private ShotPower(ShotPower original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public ShotPower()
+            : base("ShotPower", "The power of a shot between 0.1 and 3.")
+        {
+        }
+
+        public override ISymbolicExpressionTreeNode CreateTreeNode()
+        {
+            return new ShotPowerTreeNode();
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new ShotPower(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return " " + ((ShotPowerTreeNode)node).Value + " ";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPowerTreeNode.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPowerTreeNode.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPowerTreeNode.cs	(revision 9565)
@@ -0,0 +1,48 @@
+﻿using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class ShotPowerTreeNode : SymbolicExpressionTreeTerminalNode
+    {
+        private double value;
+        [Storable]
+        public double Value
+        {
+            get { return value; }
+            private set { this.value = value; }
+        }
+
+        [StorableConstructor]
+        private ShotPowerTreeNode(bool deserializing) : base(deserializing) { }
+        private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.value = original.value;
+        }
+
+        public ShotPowerTreeNode()
+            : base(new ShotPower())
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new ShotPowerTreeNode(this, cloner);
+        }
+
+        public override bool HasLocalParameters
+        {
+            get { return true; }
+        }
+
+        public override void ResetLocalParameters(IRandom random)
+        {
+            value = (double)random.Next(1, 3);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetEnergy.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetEnergy.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetEnergy.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetEnergy : CodeNode, INumericalMethod
+    {
+        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 GetEnergy(bool deserializing) : base(deserializing) { }
+        private GetEnergy(GetEnergy original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getEnergy(";
+            this.Suffix = ")";
+        }
+
+        public GetEnergy()
+            : base("GetEnergy", "Returns the robot's current energy.")
+        {
+            this.Prefix = "getEnergy(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetEnergy(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetGunHeading.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetGunHeading.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetGunHeading.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetGunHeading : CodeNode, INumericalMethod
+    {
+        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 GetGunHeading(bool deserializing) : base(deserializing) { }
+        private GetGunHeading(GetGunHeading original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getGunHeading(";
+            this.Suffix = ")";
+        }
+
+        public GetGunHeading()
+            : base("GetGunHeading", "Returns the direction that the robot's gun is facing, in degrees.")
+        {
+            this.Prefix = "getGunHeading(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetGunHeading(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetHeading.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetHeading.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetHeading.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetHeading : CodeNode, INumericalMethod
+    {
+        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 GetHeading(bool deserializing) : base(deserializing) { }
+        private GetHeading(GetHeading original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getHeading(";
+            this.Suffix = ")";
+        }
+
+        public GetHeading()
+            : base("GetHeading", "Returns the direction that the robot's body is facing, in degrees.")
+        {
+            this.Prefix = "getHeading(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetHeading(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetRadarHeading.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetRadarHeading.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetRadarHeading.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetRadarHeading : CodeNode, INumericalMethod
+    {
+        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 GetRadarHeading(bool deserializing) : base(deserializing) { }
+        private GetRadarHeading(GetRadarHeading original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getRadarHeading(";
+            this.Suffix = ")";
+        }
+
+        public GetRadarHeading()
+            : base("GetRadarHeading", "Returns the direction that the robot's radar is facing, in degrees.")
+        {
+            this.Prefix = "getRadarHeading(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetRadarHeading(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetX.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetX.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetX.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetX : CodeNode, INumericalMethod
+    {
+        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 GetX(bool deserializing) : base(deserializing) { }
+        private GetX(GetX original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getX(";
+            this.Suffix = ")";
+        }
+
+        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 = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetX(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetY.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetY.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/GetY.cs	(revision 9565)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class GetY : CodeNode, INumericalMethod
+    {
+        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 GetY(bool deserializing) : base(deserializing) { }
+        private GetY(GetY original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "getY(";
+            this.Suffix = ")";
+        }
+
+        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 = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new GetY(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return this.Prefix + this.Suffix;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/INumericalMethod.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/INumericalMethod.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Numerical Methods/INumericalMethod.cs	(revision 9565)
@@ -0,0 +1,11 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    public interface INumericalMethod
+    {
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Program.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Program.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Program.cs	(revision 9565)
@@ -0,0 +1,30 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Program : Symbol
+    {
+        public override int MinimumArity { get { return 2; } }
+        public override int MaximumArity { get { return byte.MaxValue; } }
+
+        [StorableConstructor]
+        private Program(bool deserializing) : base(deserializing) { }
+        private Program(Program original, Cloner cloner)
+            : base(original, cloner)
+        {
+        }
+
+        public Program()
+            : base("Program", "A Robocode tank program.")
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Program(this, cloner);
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Tank.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Tank.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Tank.cs	(revision 9565)
@@ -0,0 +1,62 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Tank : CodeNode
+    {
+        public override int MinimumArity { get { return 7; } }
+        public override int MaximumArity { get { return 7; } }
+
+        [Storable]
+        public override string Prefix { get; set; }
+
+        [Storable]
+        public override string Suffix { get; set; }
+
+        [StorableConstructor]
+        private Tank(bool deserializing) : base(deserializing) { }
+        private Tank(Tank original, Cloner cloner)
+            : base(original, cloner)
+        {
+            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}";
+        }
+
+        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}";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Tank(this, cloner);
+        }
+
+        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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Ahead.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Ahead.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Ahead.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Ahead : 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]
+        private Ahead(bool deserializing) : base(deserializing) { }
+        private Ahead(Ahead original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setAhead(";
+            this.Suffix = ");";
+        }
+
+        public Ahead()
+            : base("Ahead", "Immediately moves your robot ahead (forward) by distance measured in pixels.")
+        {
+            this.Prefix = "setAhead(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Ahead(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Back.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Back.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Back.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Back : 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]
+        private Back(bool deserializing) : base(deserializing) { }
+        private Back(Back original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setBack(";
+            this.Suffix = ");";
+        }
+
+        public Back()
+            : base("Back", "Immediately moves your robot backward by distance measured in pixels.")
+        {
+            this.Prefix = "setBack(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Back(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/DoNothing.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/DoNothing.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/DoNothing.cs	(revision 9565)
@@ -0,0 +1,41 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class DoNothing : 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 DoNothing(bool deserializing) : base(deserializing) { }
+        private 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 override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new DoNothing(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            return "";
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Fire.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Fire.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/Fire.cs	(revision 9565)
@@ -0,0 +1,57 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class Fire : 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]
+        private Fire(bool deserializing) : base(deserializing) { }
+        private Fire(Fire original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setFire(";
+            this.Suffix = ");";
+        }
+
+        public Fire()
+            : base("Fire", "Immediately fires a bullet.")
+        {
+            this.Prefix = "setFire(";
+            this.Suffix = ")";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new Fire(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunLeft.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunLeft.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunLeft.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnGunLeft : 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]
+        private TurnGunLeft(bool deserializing) : base(deserializing) { }
+        private TurnGunLeft(TurnGunLeft original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnGunLeft(";
+            this.Suffix = ");";
+        }
+
+        public TurnGunLeft()
+            : base("TurnGunLeft", "Immediately turns the robot's gun to the left by degrees.")
+        {
+            this.Prefix = "setTurnGunLeft(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnGunLeft(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunRight.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunRight.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnGunRight.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnGunRight : 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]
+        private TurnGunRight(bool deserializing) : base(deserializing) { }
+        private TurnGunRight(TurnGunRight original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnGunRight(";
+            this.Suffix = ");";
+        }
+
+        public TurnGunRight()
+            : base("TurnGunRight", "Immediately turns the robot's gun to the right by degrees.")
+        {
+            this.Prefix = "setTurnGunRight(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnGunRight(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnLeft.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnLeft.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnLeft.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnLeft : 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]
+        private TurnLeft(bool deserializing) : base(deserializing) { }
+        private TurnLeft(TurnLeft original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnLeft(";
+            this.Suffix = ");";
+        }
+
+        public TurnLeft()
+            : base("TurnLeft", "Immediately turns the robot's body to the left by degrees.")
+        {
+            this.Prefix = "setTurnLeft(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnLeft(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarLeft.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarLeft.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarLeft.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnRadarLeft : 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]
+        private TurnRadarLeft(bool deserializing) : base(deserializing) { }
+        private TurnRadarLeft(TurnRadarLeft original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnRadarLeft(";
+            this.Suffix = ");";
+        }
+
+        public TurnRadarLeft()
+            : base("TurnRadarLeft", "Immediately turns the robot's radar to the left by degrees.")
+        {
+            this.Prefix = "setTurnRadarLeft(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnRadarLeft(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarRight.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarRight.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRadarRight.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnRadarRight : 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]
+        private TurnRadarRight(bool deserializing) : base(deserializing) { }
+        private TurnRadarRight(TurnRadarRight original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnRadarRight(";
+            this.Suffix = ");";
+        }
+
+        public TurnRadarRight()
+            : base("TurnRadarRight", "Immediately turns the robot's radar to the right by degrees.")
+        {
+            this.Prefix = "setTurnRadarRight(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnRadarRight(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
Index: /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRight.cs
===================================================================
--- /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRight.cs	(revision 9565)
+++ /branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Void Methods/TurnRight.cs	(revision 9565)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode
+{
+    [StorableClass]
+    public class TurnRight : 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]
+        private TurnRight(bool deserializing) : base(deserializing) { }
+        private TurnRight(TurnRight original, Cloner cloner)
+            : base(original, cloner)
+        {
+            this.Prefix = "setTurnRight(";
+            this.Suffix = ");";
+        }
+
+        public TurnRight()
+            : base("TurnRight", "Immediately turns the robot's body to the right by degrees.")
+        {
+            this.Prefix = "setTurnRight(";
+            this.Suffix = ");";
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new TurnRight(this, cloner);
+        }
+
+        public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children)
+        {
+            var enumerator = children.GetEnumerator();
+
+            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() + ".");
+
+            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;
+        }
+    }
+}
