Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/BestSolutionAnalyzer.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/BestSolutionAnalyzer.cs	(revision 13013)
+++ 	(revision )
@@ -1,124 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.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.GeneticProgramming.Robocode {
-  [StorableClass]
-  [Item("Best Tank Program Analyzer",
-        "Analyzer that stores the best tank program.")]
-  public class BestSolutionAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer {
-    private const string QualityParameterName = "Quality";
-    private const string SymbolicExpressionTreeParameterName = "TankProgram";
-    private const string BestSolutionParameterName = "Best solution";
-    private const string ResultsParameterName = "Results";
-    private const string RobocodePathParamaterName = "RobocodePath";
-    private const string NrOfRoundsParameterName = "NrOfRounds";
-    private const string EnemiesParameterName = "Enemies";
-
-    public bool EnabledByDefault {
-      get { return true; }
-    }
-
-    #region Parameters
-    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
-      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
-    }
-    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
-    }
-    public ILookupParameter<Solution> BestSolutionParameter {
-      get { return (ILookupParameter<Solution>)Parameters[BestSolutionParameterName]; }
-    }
-    public ILookupParameter<ResultCollection> ResultParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
-    }
-    public ILookupParameter<DirectoryValue> RobocodePathParameter {
-      get { return (ILookupParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
-    }
-    public ILookupParameter<IntValue> NrOfRoundsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters[NrOfRoundsParameterName]; }
-    }
-    public ILookupParameter<EnemyCollection> EnemiesParameter {
-      get { return (ILookupParameter<EnemyCollection>)Parameters[EnemiesParameterName]; }
-    }
-    #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<ResultCollection>(ResultsParameterName, "The result collection of the algorithm."));
-      Parameters.Add(new LookupParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
-      Parameters.Add(new LookupParameter<IntValue>(NrOfRoundsParameterName, "Nr. of Rounds a Robot has to fight against each opponent."));
-      Parameters.Add(new LookupParameter<EnemyCollection>(EnemiesParameterName, "The enemies that should be battled."));
-    }
-
-    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];
-        }
-      }
-
-      // create a solution instance
-      var bestSolution = new Solution(bestTree, RobocodePathParameter.ActualValue.Value, NrOfRoundsParameter.ActualValue.Value, EnemiesParameter.ActualValue);
-      // 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));
-      } else {
-        resultCollection[BestSolutionParameterName].Value = bestSolution;
-      }
-
-      return base.Apply();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new BestSolutionAnalyzer(this, cloner);
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 13013)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 13015)
@@ -92,5 +92,4 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="BestSolutionAnalyzer.cs" />
     <None Include="BattleObserver.class">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -102,5 +101,4 @@
     <None Include="Plugin.cs.frame" />
     <Compile Include="EnemyCollection.cs" />
-    <Compile Include="RobocodeEvaluator.cs" />
     <Compile Include="Grammar.cs" />
     <Compile Include="Interpreter.cs" />
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeEvaluator.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeEvaluator.cs	(revision 13013)
+++ 	(revision )
@@ -1,84 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.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.GeneticProgramming.Robocode {
-  [StorableClass]
-  [Item("Robocode Evaluator", "Evaluator for the Robocode GP problem.")]
-  public class RobocodeEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
-    private const string QualityParameterName = "Quality";
-    private const string TankProgramParameterName = "TankProgram";
-    private const string RobocodePathParamaterName = "RobocodePath";
-    private const string NrOfRoundsParameterName = "NrOfRounds";
-    private const string EnemiesParameterName = "Enemies";
-
-    #region Parameters
-    public ILookupParameter<DoubleValue> QualityParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
-    }
-    public ILookupParameter<ISymbolicExpressionTree> TankProgramParameter {
-      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[TankProgramParameterName]; }
-    }
-    public ILookupParameter<DirectoryValue> RobocodePathParameter {
-      get { return (ILookupParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
-    }
-    public ILookupParameter<IntValue> NrOfRoundsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters[NrOfRoundsParameterName]; }
-    }
-    public ILookupParameter<EnemyCollection> EnemiesParameter {
-      get { return (ILookupParameter<EnemyCollection>)Parameters[EnemiesParameterName]; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    protected RobocodeEvaluator(bool deserializing) : base(deserializing) { }
-    protected RobocodeEvaluator(RobocodeEvaluator original, Cloner cloner)
-      : base(original, cloner) { }
-
-    public RobocodeEvaluator() {
-      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<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation."));
-      Parameters.Add(new LookupParameter<IntValue>(NrOfRoundsParameterName, "Nr. of Rounds a Robot has to fight against each opponent."));
-      Parameters.Add(new LookupParameter<EnemyCollection>(EnemiesParameterName, "The enemies that should be battled."));
-    }
-
-    public override IOperation Apply() {
-      ISymbolicExpressionTree tree = TankProgramParameter.ActualValue;
-      string path = RobocodePathParameter.ActualValue.Value;
-      QualityParameter.ActualValue = new DoubleValue(Interpreter.EvaluateTankProgram(tree, path, EnemiesParameter.ActualValue, null, false, NrOfRoundsParameter.ActualValue.Value));
-
-      return base.Apply();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new RobocodeEvaluator(this, cloner);
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs	(revision 13013)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/RobocodeProblem.cs	(revision 13015)
@@ -20,5 +20,4 @@
 #endregion
 
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -28,18 +27,13 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.GeneticProgramming.Robocode {
   [StorableClass]
-  [Creatable("Problems")]
-  [Item("Robocode Problem",
-        "The Robocode problem for genetic programming.")]
-  public class RobocodeProblem : SingleObjectiveHeuristicOptimizationProblem<RobocodeEvaluator,
-    ISymbolicExpressionTreeCreator> {
+  [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 360)]
+  [Item("Robocode Problem", "Evolution of a robocode program in java using genetic programming.")]
+  public class RobocodeProblem : SymbolicExpressionTreeProblem {
     #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 = "RobocodePath";
     private const string NrOfRoundsParameterName = "NrOfRounds";
@@ -48,13 +42,10 @@
 
     #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<IntValue> MaxTankProgramLengthParameter {
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaxTankProgramLengthParameterName]; }
+    //}
+    //public IFixedValueParameter<IntValue> MaxTankProgramDepthParameter {
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaxTankProgramDepthParameterName]; }
+    //}
     public IFixedValueParameter<DirectoryValue> RobocodePathParameter {
       get { return (IFixedValueParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; }
@@ -65,4 +56,29 @@
     public IValueParameter<EnemyCollection> EnemiesParameter {
       get { return (IValueParameter<EnemyCollection>)Parameters[EnemiesParameterName]; }
+    }
+
+    //public int MaxTankProgramDepth {
+    //  get { return MaxTankProgramDepthParameter.Value.Value; }
+    //  set { MaxTankProgramDepthParameter.Value.Value = value; }
+    //}
+    //
+    //public int MaxTankProgramLength {
+    //  get { return MaxTankProgramLengthParameter.Value.Value; }
+    //  set { MaxTankProgramLengthParameter.Value.Value = value; }
+    //}
+
+    public string RobocodePath {
+      get { return RobocodePathParameter.Value.Value; }
+      set { RobocodePathParameter.Value.Value = value; }
+    }
+
+    public int NrOfRounds {
+      get { return NrOfRoundsParameter.Value.Value; }
+      set { NrOfRoundsParameter.Value.Value = value; }
+    }
+
+    public EnemyCollection Enemies {
+      get { return EnemiesParameter.Value; }
+      set { EnemiesParameter.Value = value; }
     }
     #endregion
@@ -76,20 +92,19 @@
 
     public RobocodeProblem()
-      : base(new RobocodeEvaluator(), new ProbabilisticTreeCreator()) {
-      DirectoryValue robocodeDir = new DirectoryValue();
-      robocodeDir.Value = @"C:\robocode";
+      : base() {
+      DirectoryValue robocodeDir = new DirectoryValue { Value = @"C:\robocode" };
 
       var robotList = EnemyCollection.ReloadEnemies(robocodeDir.Value);
       robotList.RobocodePath = robocodeDir.Value;
 
-      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramDepthParameterName, "Maximal depth of the Robocode tank program.", new IntValue(10)));
-      Parameters.Add(new FixedValueParameter<IntValue>(MaxTankProgramLengthParameterName, "Maximal length of the tank program.", new IntValue(1000)));
-      Parameters.Add(new ValueParameter<Grammar>(TankGrammarParameterName, "Grammar for the tank program.", new Grammar()));
+
       Parameters.Add(new FixedValueParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation.", robocodeDir));
-      Parameters.Add(new FixedValueParameter<IntValue>(NrOfRoundsParameterName, "Nr. of rounds a robot has to fight against each opponent.", new IntValue(3)));
+      Parameters.Add(new FixedValueParameter<IntValue>(NrOfRoundsParameterName, "Number of rounds a robot has to fight against each opponent.", new IntValue(3)));
       Parameters.Add(new ValueParameter<EnemyCollection>(EnemiesParameterName, "The enemies that should be battled.", robotList));
 
-      Maximization.Value = true;
-      InitializeOperators();
+      Encoding = new SymbolicExpressionTreeEncoding(new Grammar(), 1000, 10);
+      Encoding.FunctionArguments = 0;
+      Encoding.FunctionDefinitions = 0;
+
       RegisterEventHandlers();
     }
@@ -100,16 +115,35 @@
 
     [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEventHandlers();
+    private void AfterDeserialization() { RegisterEventHandlers(); }
+
+    public override double Evaluate(ISymbolicExpressionTree tree, IRandom random) {
+      return Interpreter.EvaluateTankProgram(tree, RobocodePath, Enemies, null, false, NrOfRounds);
     }
 
-    private void InitializeOperators() {
-      Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>()
-        .Where(x => !(x is ISymbolicExpressionTreeArchitectureAlteringOperator)));
-      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
-      Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
-      Operators.Add(new BestSolutionAnalyzer());
-      ParameterizeOperators();
-      ParameterizeAnalyzers();
+    public override void Analyze(ISymbolicExpressionTree[] trees, double[] qualities, ResultCollection results, IRandom random) {
+      // 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] > maxQuality) {
+          maxQuality = qualities[i];
+          bestTree = trees[i];
+        }
+      }
+
+      // create a solution instance
+      var bestSolution = new Solution(bestTree, RobocodePath, NrOfRounds, Enemies);
+
+      // also add the best solution as a result to the result collection
+      // or alternatively update the existing result
+      if (!results.ContainsKey("BestSolution")) {
+        results.Add(new Result("BestSolution", "The best tank program", bestSolution));
+      } else {
+        results["BestSolution"].Value = bestSolution;
+      }
+    }
+
+    public override bool Maximization {
+      get { return true; }
     }
 
@@ -121,67 +155,4 @@
       EnemiesParameter.Value.RobocodePath = RobocodePathParameter.Value.Value;
     }
-
-    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<RobocodeEvaluator>()) {
-        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;
-      }
-    }
   }
 }
