Index: /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs	(revision 13339)
@@ -26,7 +26,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Binary;
 
 namespace HeuristicLab.Algorithms.ParameterlessPopulationPyramid {
@@ -34,6 +34,6 @@
   // B. W. Goldman and W. F. Punch, "Parameter-less Population Pyramid," GECCO, pp. 785–792, 2014
   // and the original source code in C++11 available from: https://github.com/brianwgoldman/Parameter-less_Population_Pyramid
-  internal sealed class EvaluationTracker : BinaryProblem {
-    private readonly BinaryProblem problem;
+  internal sealed class EvaluationTracker : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> {
+    private readonly ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem;
 
     private int maxEvaluations;
@@ -59,4 +59,8 @@
       private set;
     }
+
+    public new BinaryVectorEncoding Encoding {
+      get { return problem.Encoding; }
+    }
     #endregion
 
@@ -75,8 +79,8 @@
       return new EvaluationTracker(this, cloner);
     }
-    public EvaluationTracker(BinaryProblem problem, int maxEvaluations) {
+    public EvaluationTracker(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, int maxEvaluations) {
       this.problem = problem;
       this.maxEvaluations = maxEvaluations;
-      BestSolution = new BinaryVector(Length);
+      BestSolution = new BinaryVector(problem.Encoding.Length);
       BestQuality = double.NaN;
       Evaluations = 0;
@@ -99,9 +103,4 @@
     }
 
-    public override int Length {
-      get { return problem.Length; }
-      set { problem.Length = value; }
-    }
-
     public override bool Maximization {
       get {
Index: /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj	(revision 13339)
@@ -148,9 +148,4 @@
       <Private>False</Private>
     </ProjectReference>
-    <ProjectReference Include="..\..\HeuristicLab.Problems.Binary\3.3\HeuristicLab.Problems.Binary-3.3.csproj">
-      <Project>{fc627be5-0f93-47d8-bd2e-530ea2b8aa5f}</Project>
-      <Name>HeuristicLab.Problems.Binary-3.3</Name>
-      <Private>False</Private>
-    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
       <Project>{f4539fb6-4708-40c9-be64-0a1390aea197}</Project>
Index: /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs	(revision 13339)
@@ -32,5 +32,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Binary;
 using HeuristicLab.Random;
 
@@ -50,8 +49,8 @@
 
     public override Type ProblemType {
-      get { return typeof(BinaryProblem); }
+      get { return typeof(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector>); }
     }
-    public new BinaryProblem Problem {
-      get { return (BinaryProblem)base.Problem; }
+    public new ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> Problem {
+      get { return (ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector>)base.Problem; }
       set { base.Problem = value; }
     }
@@ -84,5 +83,5 @@
       Results.Add(new Result("Best quality", BestQuality));
       for (int iteration = 0; iteration < Iterations; iteration++) {
-        var solution = new BinaryVector(Problem.Length);
+        var solution = new BinaryVector(Problem.Encoding.Length);
         for (int i = 0; i < solution.Length; i++) {
           solution[i] = random.Next(2) == 1;
@@ -98,5 +97,5 @@
     }
     // In the GECCO paper, Section 2.1
-    public static double ImproveToLocalOptimum(BinaryProblem problem, BinaryVector solution, double fitness, IRandom rand) {
+    public static double ImproveToLocalOptimum(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, BinaryVector solution, double fitness, IRandom rand) {
       var tried = new HashSet<int>();
       do {
Index: /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs	(revision 13339)
@@ -24,5 +24,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.BinaryVectorEncoding;
-using HeuristicLab.Problems.Binary;
+using HeuristicLab.Optimization;
 using HeuristicLab.Random;
 
@@ -33,5 +33,5 @@
   public static class LinkageCrossover {
     // In the GECCO paper, Figure 3
-    public static double ImproveUsingTree(LinkageTree tree, IList<BinaryVector> donors, BinaryVector solution, double fitness, BinaryProblem problem, IRandom rand) {
+    public static double ImproveUsingTree(LinkageTree tree, IList<BinaryVector> donors, BinaryVector solution, double fitness, ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, IRandom rand) {
       var options = Enumerable.Range(0, donors.Count).ToArray();
       foreach (var cluster in tree.Clusters) {
@@ -48,5 +48,5 @@
     }
 
-    private static double Donate(BinaryVector solution, double fitness, BinaryVector source, IEnumerable<int> cluster, BinaryProblem problem, IRandom rand, out bool changed) {
+    private static double Donate(BinaryVector solution, double fitness, BinaryVector source, IEnumerable<int> cluster, ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, IRandom rand, out bool changed) {
       // keep track of which bits flipped to make the donation
       List<int> flipped = new List<int>();
Index: /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs	(revision 13339)
@@ -32,5 +32,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Binary;
 using HeuristicLab.Random;
 
@@ -44,8 +43,8 @@
   public class ParameterlessPopulationPyramid : BasicAlgorithm {
     public override Type ProblemType {
-      get { return typeof(BinaryProblem); }
-    }
-    public new BinaryProblem Problem {
-      get { return (BinaryProblem)base.Problem; }
+      get { return typeof(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector>); }
+    }
+    public new ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> Problem {
+      get { return (ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector>)base.Problem; }
       set { base.Problem = value; }
     }
@@ -183,5 +182,5 @@
       if (seen.Contains(solution)) return;
       if (level == pyramid.Count) {
-        pyramid.Add(new Population(tracker.Length, random));
+        pyramid.Add(new Population(tracker.Encoding.Length, random));
       }
       var copied = (BinaryVector)solution.Clone();
@@ -193,5 +192,5 @@
     private double iterate() {
       // Create a random solution
-      BinaryVector solution = new BinaryVector(tracker.Length);
+      BinaryVector solution = new BinaryVector(tracker.Encoding.Length);
       for (int i = 0; i < solution.Length; i++) {
         solution[i] = random.Next(2) == 1;
@@ -249,5 +248,6 @@
           fitness = iterate();
           cancellationToken.ThrowIfCancellationRequested();
-        } finally {
+        }
+        finally {
           ResultsEvaluations = tracker.Evaluations;
           ResultsBestSolution = new BinaryVector(tracker.BestSolution);
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiObjectiveProblemDefinition.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiObjectiveProblemDefinition.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiObjectiveProblemDefinition.cs	(revision 13339)
@@ -23,6 +23,7 @@
 
 namespace HeuristicLab.Optimization {
-  public interface IMultiObjectiveProblemDefinition<TSolution> : IProblemDefinition
-  where TSolution : class, ISolution {
+  public interface IMultiObjectiveProblemDefinition<TEncoding, TSolution> : IProblemDefinition<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
     bool[] Maximization { get; }
     double[] Evaluate(TSolution individual, IRandom random);
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IProblemDefinition.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IProblemDefinition.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IProblemDefinition.cs	(revision 13339)
@@ -21,6 +21,8 @@
 
 namespace HeuristicLab.Optimization {
-  public interface IProblemDefinition {
-    //IEncoding Encoding { get; }
+  public interface IProblemDefinition<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
+    TEncoding Encoding { get; }
   }
 }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblem.cs	(revision 13339)
@@ -24,5 +24,6 @@
 
 namespace HeuristicLab.Optimization {
-  public interface ISingleObjectiveProblem<TSolution> : IProblem<TSolution>, ISingleObjectiveProblemDefinition<TSolution>, ISingleObjectiveHeuristicOptimizationProblem
+  public interface ISingleObjectiveProblem<TEncoding, TSolution> : IProblem<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, ISingleObjectiveHeuristicOptimizationProblem
+    where TEncoding : class, IEncoding<TSolution>
     where TSolution : class, ISolution {
     bool IsBetter(double quality, double bestQuality);
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs	(revision 13339)
@@ -24,6 +24,7 @@
 
 namespace HeuristicLab.Optimization {
-  public interface ISingleObjectiveProblemDefinition<TSolution> : IProblemDefinition
-  where TSolution : class, ISolution {
+  public interface ISingleObjectiveProblemDefinition<TEncoding, TSolution> : IProblemDefinition<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
     bool Maximization { get; }
     double Evaluate(TSolution individual, IRandom random);
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs	(revision 13339)
@@ -29,10 +29,11 @@
 namespace HeuristicLab.Optimization {
   [StorableClass]
-  public abstract class MultiObjectiveProblem<TSolution> : Problem<TSolution, MultiObjectiveEvaluator<TSolution>>, IMultiObjectiveHeuristicOptimizationProblem, IMultiObjectiveProblemDefinition<TSolution>
-  where TSolution : class, ISolution {
+  public abstract class MultiObjectiveProblem<TEncoding, TSolution> : Problem<TEncoding, TSolution, MultiObjectiveEvaluator<TSolution>>, IMultiObjectiveHeuristicOptimizationProblem, IMultiObjectiveProblemDefinition<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
     [StorableConstructor]
     protected MultiObjectiveProblem(bool deserializing) : base(deserializing) { }
 
-    protected MultiObjectiveProblem(MultiObjectiveProblem<TSolution> original, Cloner cloner)
+    protected MultiObjectiveProblem(MultiObjectiveProblem<TEncoding, TSolution> original, Cloner cloner)
       : base(original, cloner) {
       ParameterizeOperators();
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs	(revision 13339)
@@ -30,5 +30,6 @@
 namespace HeuristicLab.Optimization {
   [StorableClass]
-  public abstract class Problem<TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition, IStorableContent
+  public abstract class Problem<TEncoding, TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition<TEncoding, TSolution>, IStorableContent
+    where TEncoding : class, IEncoding<TSolution>
     where TSolution : class, ISolution
     where TEvaluator : class, IEvaluator {
@@ -36,9 +37,9 @@
     public string Filename { get; set; }
 
-    protected IValueParameter<IEncoding<TSolution>> EncodingParameter {
-      get { return (IValueParameter<IEncoding<TSolution>>)Parameters["Encoding"]; }
+    protected IValueParameter<TEncoding> EncodingParameter {
+      get { return (IValueParameter<TEncoding>)Parameters["Encoding"]; }
     }
 
-    public IEncoding<TSolution> Encoding {
+    public TEncoding Encoding {
       get { return EncodingParameter.Value; }
       protected set {
@@ -61,10 +62,13 @@
     protected Problem()
       : base() {
-      Parameters.Add(new ValueParameter<IEncoding<TSolution>>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any."));
-      if (Encoding != null) Parameterize();
+      Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any."));
+      if (Encoding != null) {
+        SolutionCreator = Encoding.SolutionCreator;
+        Parameterize();
+      }
       RegisterEvents();
     }
 
-    protected Problem(Problem<TSolution, TEvaluator> original, Cloner cloner)
+    protected Problem(Problem<TEncoding, TSolution, TEvaluator> original, Cloner cloner)
       : base(original, cloner) {
       RegisterEvents();
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs	(revision 13339)
@@ -30,7 +30,7 @@
 namespace HeuristicLab.Optimization {
   [StorableClass]
-  public abstract class SingleObjectiveProblem<TSolution> : Problem<TSolution, SingleObjectiveEvaluator<TSolution>>,
-    ISingleObjectiveProblemDefinition<TSolution>, ISingleObjectiveHeuristicOptimizationProblem
-  where TSolution : class, ISolution {
+  public abstract class SingleObjectiveProblem<TEncoding, TSolution> : Problem<TEncoding, TSolution, SingleObjectiveEvaluator<TSolution>>, ISingleObjectiveProblem<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
 
     protected IValueParameter<DoubleValue> BestKnownQualityParameter {
@@ -52,5 +52,5 @@
     protected SingleObjectiveProblem(bool deserializing) : base(deserializing) { }
 
-    protected SingleObjectiveProblem(SingleObjectiveProblem<TSolution> original, Cloner cloner)
+    protected SingleObjectiveProblem(SingleObjectiveProblem<TEncoding, TSolution> original, Cloner cloner)
       : base(original, cloner) {
       ParameterizeOperators();
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs	(revision 13339)
@@ -36,6 +36,7 @@
   }
 
-  public interface IProblem<TSolution> : IHeuristicOptimizationProblem where TSolution : class, ISolution {
-    IEncoding<TSolution> Encoding { get; }
+  public interface IProblem<TEncoding, TSolution> : IHeuristicOptimizationProblem, IProblemDefinition<TEncoding, TSolution>
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
   }
 }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Problems/HeuristicOptimizationProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Problems/HeuristicOptimizationProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Problems/HeuristicOptimizationProblem.cs	(revision 13339)
@@ -99,5 +99,5 @@
     }
 
-    protected virtual void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
+    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
       OnSolutionCreatorChanged();
     }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/BinaryProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/BinaryProblem.cs	(revision 13338)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/BinaryProblem.cs	(revision 13339)
@@ -34,13 +34,8 @@
 namespace HeuristicLab.Problems.Binary {
   [StorableClass]
-  public abstract class BinaryProblem : SingleObjectiveProblem<BinaryVector> {
+  public abstract class BinaryProblem : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> {
     public virtual int Length {
       get { return Encoding.Length; }
       set { Encoding.Length = value; }
-    }
-
-    public new BinaryVectorEncoding Encoding {
-      get { return (BinaryVectorEncoding)base.Encoding; }
-      set { base.Encoding = value; }
     }
 
@@ -65,5 +60,4 @@
       var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the BinaryVector.", new IntValue(10));
       Parameters.Add(lengthParameter);
-      Encoding = new BinaryVectorEncoding();
       Encoding.LengthParameter = lengthParameter;
       RegisterEventHandlers();
