Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs	(revision 16816)
@@ -0,0 +1,353 @@
+﻿#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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Encodings.LinearLinkageEncoding;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  #region single-objective
+  [Item("Binary Vector External Evaluation Problem (single-objective)", "Represents a binary vector single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 100)]
+  [StorableType("4ea0ded8-4451-4011-b88e-4d0680721b01")]
+  public sealed class SingleObjectiveBinaryVectorExternalEvaluationProblem : ExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> {
+
+    [StorableConstructor]
+    private SingleObjectiveBinaryVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveBinaryVectorExternalEvaluationProblem(SingleObjectiveBinaryVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectiveBinaryVectorExternalEvaluationProblem()
+      : base(new BinaryVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveBinaryVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Integer Vector External Evaluation Problem (single-objective)", "Represents an integer vector single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 101)]
+  [StorableType("46465e8c-11d8-4d02-8c45-de41a08db7fa")]
+  public sealed class SingleObjectiveIntegerVectorExternalEvaluationProblem : ExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> {
+
+    [StorableConstructor]
+    private SingleObjectiveIntegerVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveIntegerVectorExternalEvaluationProblem(SingleObjectiveIntegerVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectiveIntegerVectorExternalEvaluationProblem()
+      : base(new IntegerVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveIntegerVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Real Vector External Evaluation Problem (single-objective)", "Represents a real vector single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 102)]
+  [StorableType("637f091f-6601-494e-bafb-2a8ea474210c")]
+  public sealed class SingleObjectiveRealVectorExternalEvaluationProblem : ExternalEvaluationProblem<RealVectorEncoding, RealVector> {
+
+    [StorableConstructor]
+    private SingleObjectiveRealVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveRealVectorExternalEvaluationProblem(SingleObjectiveRealVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectiveRealVectorExternalEvaluationProblem()
+      : base(new RealVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveRealVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Permutation External Evaluation Problem (single-objective)", "Represents a permutation single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 103)]
+  [StorableType("ad9d45f8-b97e-49a7-b3d2-487d9a2cbdf9")]
+  public sealed class SingleObjectivePermutationExternalEvaluationProblem : ExternalEvaluationProblem<PermutationEncoding, Permutation> {
+
+    [StorableConstructor]
+    private SingleObjectivePermutationExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectivePermutationExternalEvaluationProblem(SingleObjectivePermutationExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectivePermutationExternalEvaluationProblem()
+      : base(new PermutationEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the permutation.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectivePermutationExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Symbolic Expression Tree External Evaluation Problem (single-objective)", "Represents a symbolic expression tree single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 104)]
+  [StorableType("9b3ee4a8-7076-4edd-ae7e-4188bc49aaa3")]
+  public sealed class SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem : ExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> {
+
+    [StorableConstructor]
+    private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem()
+      : base(new SymbolicExpressionTreeEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50));
+      Parameters.Add(lengthParameter);
+      Encoding.TreeLengthParameter = lengthParameter;
+      var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10));
+      Parameters.Add(depthParameter);
+      Encoding.TreeDepthParameter = depthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Linear Linkage External Evaluation Problem (single-objective)", "Represents a linear linkage single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 105)]
+  [StorableType("945a35d9-89a8-4423-9ea0-21829ac68887")]
+  public sealed class SingleObjectiveLinearLinkageExternalEvaluationProblem : ExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> {
+
+    [StorableConstructor]
+    private SingleObjectiveLinearLinkageExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveLinearLinkageExternalEvaluationProblem(SingleObjectiveLinearLinkageExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public SingleObjectiveLinearLinkageExternalEvaluationProblem()
+      : base(new LinearLinkageEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveLinearLinkageExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Combined Encoding External Evaluation Problem (single-objective)", "Represents a combined encoding single-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 1000)]
+  [StorableType("0effb975-c1ff-4485-afc9-5f4cf30ac62b")]
+  public sealed class SingleObjectiveCombinedEncodingExternalEvaluationProblem : ExternalEvaluationProblem<CombinedEncoding, CombinedSolution> {
+
+    [StorableConstructor]
+    private SingleObjectiveCombinedEncodingExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveCombinedEncodingExternalEvaluationProblem(SingleObjectiveCombinedEncodingExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+    public SingleObjectiveCombinedEncodingExternalEvaluationProblem() : base(new CombinedEncoding()) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveCombinedEncodingExternalEvaluationProblem(this, cloner);
+    }
+  }
+  #endregion
+
+  #region multi-objective
+  [Item("Binary Vector External Evaluation Problem (multi-objective)", "Represents a binary vector multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 100)]
+  [StorableType("f14c7e88-b74d-4cad-ae55-83daf7b4c288")]
+  public sealed class MultiObjectiveBinaryVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveBinaryVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveBinaryVectorExternalEvaluationProblem(MultiObjectiveBinaryVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveBinaryVectorExternalEvaluationProblem()
+      : base(new BinaryVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveBinaryVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Integer Vector External Evaluation Problem (multi-objective)", "Represents an integer vector multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 101)]
+  [StorableType("90a82c2f-6c37-4ffd-8495-bee278c583d3")]
+  public sealed class MultiObjectiveIntegerVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveIntegerVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveIntegerVectorExternalEvaluationProblem(MultiObjectiveIntegerVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveIntegerVectorExternalEvaluationProblem()
+      : base(new IntegerVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveIntegerVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Real Vector External Evaluation Problem (multi-objective)", "Represents a real vector multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 102)]
+  [StorableType("38e1d068-d569-48c5-bad6-cbdd685b7c6b")]
+  public sealed class MultiObjectiveRealVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<RealVectorEncoding, RealVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveRealVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveRealVectorExternalEvaluationProblem(MultiObjectiveRealVectorExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveRealVectorExternalEvaluationProblem()
+      : base(new RealVectorEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveRealVectorExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Permutation External Evaluation Problem (multi-objective)", "Represents a permutation multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 103)]
+  [StorableType("f1b265b0-ac7c-4c36-b346-5b3f2c37694b")]
+  public sealed class MultiObjectivePermutationExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<PermutationEncoding, Permutation> {
+
+    [StorableConstructor]
+    private MultiObjectivePermutationExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectivePermutationExternalEvaluationProblem(MultiObjectivePermutationExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectivePermutationExternalEvaluationProblem()
+      : base(new PermutationEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the permutation.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectivePermutationExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Symbolic Expression Tree External Evaluation Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 104)]
+  [StorableType("fb6834e2-2d56-4711-a3f8-5e0ab55cd040")]
+  public sealed class MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> {
+
+    [StorableConstructor]
+    private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem()
+      : base(new SymbolicExpressionTreeEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50));
+      Parameters.Add(lengthParameter);
+      Encoding.TreeLengthParameter = lengthParameter;
+      var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10));
+      Parameters.Add(depthParameter);
+      Encoding.TreeDepthParameter = depthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Linear Linkage External Evaluation Problem (multi-objective)", "Represents a linear linkage multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 105)]
+  [StorableType("ed0c1129-651d-465f-87b0-f412f3e3b3d1")]
+  public sealed class MultiObjectiveLinearLinkageExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> {
+
+    [StorableConstructor]
+    private MultiObjectiveLinearLinkageExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveLinearLinkageExternalEvaluationProblem(MultiObjectiveLinearLinkageExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveLinearLinkageExternalEvaluationProblem()
+      : base(new LinearLinkageEncoding()) {
+      var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the vector.", new IntValue(10));
+      Parameters.Add(lengthParameter);
+      Encoding.LengthParameter = lengthParameter;
+      // TODO: Add and parameterize additional operators, 
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveLinearLinkageExternalEvaluationProblem(this, cloner);
+    }
+  }
+
+  [Item("Combined Encoding External Evaluation Problem (multi-objective)", "Represents a combined encoding multi-objective problem that is evaluated by a separate process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 1000)]
+  [StorableType("5f136869-1750-4d96-ba7e-b25edd2bcab1")]
+  public sealed class MultiObjectiveCombinedEncodingExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<CombinedEncoding, CombinedSolution> {
+
+    [StorableConstructor]
+    private MultiObjectiveCombinedEncodingExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveCombinedEncodingExternalEvaluationProblem(MultiObjectiveCombinedEncodingExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveCombinedEncodingExternalEvaluationProblem() : base(new CombinedEncoding()) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveCombinedEncodingExternalEvaluationProblem(this, cloner);
+    }
+  }
+  #endregion
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/HeuristicLab.Problems.ExternalEvaluation-3.4.csproj
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/HeuristicLab.Problems.ExternalEvaluation-3.4.csproj	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/HeuristicLab.Problems.ExternalEvaluation-3.4.csproj	(revision 16816)
@@ -137,5 +137,6 @@
     <Compile Include="Interfaces\IMultiObjectiveOptimizationSupport.cs" />
     <Compile Include="MultiObjectiveExternalEvaluationProblem.cs" />
-    <Compile Include="ExternalEvaluationProblem.cs" />
+    <Compile Include="ExternalEvaluationProblemInstances.cs" />
+    <Compile Include="SingleObjectiveExternalEvaluationProblem.cs" />
     <Compile Include="Interfaces\IEvaluationServiceClient.cs" />
     <Compile Include="Interfaces\IEvaluationChannel.cs" />
@@ -144,9 +145,9 @@
     <Compile Include="Plugin.cs" />
     <Compile Include="Programmable\CompiledOptimizationSupport.cs" />
-    <Compile Include="Programmable\CompiledMultiObjectiveOptimizationSupport.cs" />
-    <Compile Include="Programmable\CompiledSingleObjectiveOptimizationSupport.cs" />
-    <Compile Include="Programmable\MultiObjectiveOptimizationSupportScript.cs" />
+    <Content Include="Programmable\MultiObjective\CompiledMultiObjectiveOptimizationSupport.cs" />
+    <Content Include="Programmable\SingleObjective\CompiledSingleObjectiveOptimizationSupport.cs" />
+    <Compile Include="Programmable\MultiObjective\MultiObjectiveOptimizationSupportScript.cs" />
     <Compile Include="Programmable\OptimizationSupportScript.cs" />
-    <Compile Include="Programmable\SingleObjectiveOptimizationSupportScript.cs" />
+    <Compile Include="Programmable\SingleObjective\SingleObjectiveOptimizationSupportScript.cs" />
     <Compile Include="Programmable\OptimizationSupportScriptException.cs" />
     <Compile Include="Programmable\Templates.Designer.cs">
@@ -187,4 +188,5 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Templates.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
   </ItemGroup>
@@ -218,4 +220,34 @@
       <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
       <Name>HeuristicLab.Data-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.BinaryVectorEncoding\3.3\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj">
+      <Project>{66d249c3-a01d-42a8-82a2-919bc8ec3d83}</Project>
+      <Name>HeuristicLab.Encodings.BinaryVectorEncoding-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.IntegerVectorEncoding\3.3\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj">
+      <Project>{ddfb14dd-2a85-493c-a52d-e69729bbaeb0}</Project>
+      <Name>HeuristicLab.Encodings.IntegerVectorEncoding-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.LinearLinkageEncoding\3.4\HeuristicLab.Encodings.LinearLinkageEncoding-3.4.csproj">
+      <Project>{be698769-975a-429e-828c-72bb2b6182c8}</Project>
+      <Name>HeuristicLab.Encodings.LinearLinkageEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">
+      <Project>{dbecb8b0-b166-4133-baf1-ed67c3fd7fca}</Project>
+      <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj">
+      <Project>{bb6d334a-4bb6-4674-9883-31a6ebb32cab}</Project>
+      <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
       <Private>False</Private>
     </ProjectReference>
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/IMultiObjectiveOptimizationSupport.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/IMultiObjectiveOptimizationSupport.cs	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/IMultiObjectiveOptimizationSupport.cs	(revision 16816)
@@ -20,12 +20,12 @@
 #endregion
 
+using HEAL.Attic;
 using HeuristicLab.Core;
 using HeuristicLab.Optimization;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.ExternalEvaluation {
   [StorableType("f924ef9c-d824-40d2-89b2-6dd1220df98b")]
-  public interface IMultiObjectiveOptimizationSupport {
-    void Analyze(IEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random);
+  public interface IMultiObjectiveOptimizationSupport<TEncodedSolution> {
+    void Analyze(TEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random);
   }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/ISingleObjectiveOptimizationSupport.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/ISingleObjectiveOptimizationSupport.cs	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Interfaces/ISingleObjectiveOptimizationSupport.cs	(revision 16816)
@@ -21,13 +21,16 @@
 
 using System.Collections.Generic;
+using HEAL.Attic;
+using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Optimization;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.ExternalEvaluation {
   [StorableType("09d522e0-c10f-474c-b7c0-7d7f98e63f44")]
-  public interface ISingleObjectiveOptimizationSupport {
-    void Analyze(IEncodedSolution[] individuals, double[] qualities, ResultCollection results, IRandom random);
-    IEnumerable<IEncodedSolution> GetNeighbors(IEncodedSolution individual, IRandom random);
+  public interface ISingleObjectiveOptimizationSupport<TEncodedSolution>
+    where TEncodedSolution : IDeepCloneable {
+
+    void Analyze(TEncodedSolution[] individuals, double[] qualities, ResultCollection results, IRandom random);
+    IEnumerable<TEncodedSolution> GetNeighbors(TEncodedSolution individual, IRandom random);
   }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs	(revision 16816)
@@ -26,4 +26,5 @@
 using System.Threading;
 using Google.ProtocolBuffers;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -31,5 +32,4 @@
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.ExternalEvaluation {
@@ -37,5 +37,7 @@
   [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 200)]
   [StorableType("CCA50199-A6AB-4C84-B4FA-0262CAF416EC")]
-  public class MultiObjectiveExternalEvaluationProblem : MultiObjectiveProblem<IEncoding<IEncodedSolution>, IEncodedSolution>, IExternalEvaluationProblem {
+  public class MultiObjectiveExternalEvaluationProblem<TEncoding, TEncodedSolution> : MultiObjectiveProblem<TEncoding, TEncodedSolution>, IExternalEvaluationProblem
+    where TEncoding : class, IEncoding<TEncodedSolution>
+    where TEncodedSolution : class, IEncodedSolution {
 
     public static new Image StaticItemImage {
@@ -53,15 +55,11 @@
       get { return (IValueParameter<SolutionMessageBuilder>)Parameters["MessageBuilder"]; }
     }
-    public IFixedValueParameter<MultiObjectiveOptimizationSupportScript> SupportScriptParameter {
-      get { return (IFixedValueParameter<MultiObjectiveOptimizationSupportScript>)Parameters["SupportScript"]; }
-    }
-
-    private IFixedValueParameter<BoolArray> MaximizationParameter {
-      get { return (IFixedValueParameter<BoolArray>)Parameters["Maximization"]; }
+    public IFixedValueParameter<MultiObjectiveOptimizationSupportScript<TEncodedSolution>> SupportScriptParameter {
+      get { return (IFixedValueParameter<MultiObjectiveOptimizationSupportScript<TEncodedSolution>>)Parameters["SupportScript"]; }
     }
     #endregion
 
     #region Properties
-    public new IEncoding<IEncodedSolution> Encoding {
+    public new TEncoding Encoding {
       get { return base.Encoding; }
       set { base.Encoding = value; }
@@ -76,8 +74,8 @@
       get { return MessageBuilderParameter.Value; }
     }
-    public MultiObjectiveOptimizationSupportScript OptimizationSupportScript {
+    public MultiObjectiveOptimizationSupportScript<TEncodedSolution> OptimizationSupportScript {
       get { return SupportScriptParameter.Value; }
     }
-    private IMultiObjectiveOptimizationSupport OptimizationSupport {
+    private IMultiObjectiveOptimizationSupport<TEncodedSolution> OptimizationSupport {
       get { return SupportScriptParameter.Value; }
     }
@@ -86,10 +84,10 @@
     [StorableConstructor]
     protected MultiObjectiveExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
-    protected MultiObjectiveExternalEvaluationProblem(MultiObjectiveExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
+    protected MultiObjectiveExternalEvaluationProblem(MultiObjectiveExternalEvaluationProblem<TEncoding, TEncodedSolution> original, Cloner cloner) : base(original, cloner) { }
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new MultiObjectiveExternalEvaluationProblem(this, cloner);
+      return new MultiObjectiveExternalEvaluationProblem<TEncoding, TEncodedSolution>(this, cloner);
     }
-    public MultiObjectiveExternalEvaluationProblem()
-      : base() {
+    public MultiObjectiveExternalEvaluationProblem(TEncoding encoding)
+      : base(encoding) {
       Parameters.Remove("Maximization"); // readonly in base class
       Parameters.Add(new FixedValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", new BoolArray()));
@@ -97,5 +95,5 @@
       Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() }));
       Parameters.Add(new ValueParameter<SolutionMessageBuilder>("MessageBuilder", "The message builder that converts from HeuristicLab objects to SolutionMessage representation.", new SolutionMessageBuilder()) { Hidden = true });
-      Parameters.Add(new FixedValueParameter<MultiObjectiveOptimizationSupportScript>("SupportScript", "A script that can analyze the results of the optimization.", new MultiObjectiveOptimizationSupportScript()));
+      Parameters.Add(new FixedValueParameter<MultiObjectiveOptimizationSupportScript<TEncodedSolution>>("SupportScript", "A script that can analyze the results of the optimization.", new MultiObjectiveOptimizationSupportScript<TEncodedSolution>()));
     }
 
@@ -114,5 +112,5 @@
     }
 
-    public override double[] Evaluate(IEncodedSolution individual, IRandom random) {
+    public override double[] Evaluate(TEncodedSolution individual, IRandom random) {
       var qualityMessage = Evaluate(BuildSolutionMessage(individual));
       if (!qualityMessage.HasExtension(MultiObjectiveQualityMessage.QualityMessage_))
@@ -126,5 +124,5 @@
     }
 
-    public override void Analyze(IEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
+    public override void Analyze(TEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
       OptimizationSupport.Analyze(individuals, qualities, results, random);
     }
@@ -164,5 +162,5 @@
     }
 
-    private SolutionMessage BuildSolutionMessage(IEncodedSolution solution, int solutionId = 0) {
+    private SolutionMessage BuildSolutionMessage(TEncodedSolution solution, int solutionId = 0) {
       lock (clientLock) {
         SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Plugin.cs.frame
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Plugin.cs.frame	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Plugin.cs.frame	(revision 16816)
@@ -32,4 +32,5 @@
   [PluginDependency("HeuristicLab.Core", "3.3")]
   [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.RealVectorEncoding", "3.3")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
   [PluginDependency("HeuristicLab.Parameters", "3.3")]
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/CompiledMultiObjectiveOptimizationSupport.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/CompiledMultiObjectiveOptimizationSupport.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/CompiledMultiObjectiveOptimizationSupport.cs	(revision 16816)
@@ -0,0 +1,15 @@
+﻿using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using ENCODING_NAMESPACE;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  public class CompiledMultiObjectiveOptimizationSupport : CompiledOptimizationSupport, IMultiObjectiveOptimizationSupport<SOLUTION_CLASS> {
+
+    public void Analyze(SOLUTION_CLASS[] solutions, double[][] qualities, ResultCollection results, IRandom random) {
+      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+      // Write or update results given the range of vectors and resulting qualities
+    }
+
+    // Implement further classes and methods
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/MultiObjectiveOptimizationSupportScript.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/MultiObjectiveOptimizationSupportScript.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/MultiObjective/MultiObjectiveOptimizationSupportScript.cs	(revision 16816)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.ExternalEvaluation.Programmable;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  [Item("ProblemDefinitionScript", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
+  [StorableType("617A7BEE-1B2F-4E39-A814-54CC4DFA2F02")]
+  public sealed class MultiObjectiveOptimizationSupportScript<TEncodedSolution> : OptimizationSupportScript<IMultiObjectiveOptimizationSupport<TEncodedSolution>>, IMultiObjectiveOptimizationSupport<TEncodedSolution> {
+    [StorableConstructor]
+    private MultiObjectiveOptimizationSupportScript(StorableConstructorFlag _) : base(_) { }
+    private MultiObjectiveOptimizationSupportScript(MultiObjectiveOptimizationSupportScript<TEncodedSolution> original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveOptimizationSupportScript() {
+      var codeTemplate = Templates.CompiledMultiObjectiveOptimizationSupport;
+      codeTemplate = codeTemplate.Replace("ENCODING_NAMESPACE", typeof(TEncodedSolution).Namespace);
+      codeTemplate = codeTemplate.Replace("SOLUTION_CLASS", typeof(TEncodedSolution).Name);
+      Code = codeTemplate;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveOptimizationSupportScript<TEncodedSolution>(this, cloner);
+    }
+
+    void IMultiObjectiveOptimizationSupport<TEncodedSolution>.Analyze(TEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
+      CompiledInstance.Analyze(individuals, qualities, results, random);
+    }
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/CompiledSingleObjectiveOptimizationSupport.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/CompiledSingleObjectiveOptimizationSupport.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/CompiledSingleObjectiveOptimizationSupport.cs	(revision 16816)
@@ -0,0 +1,38 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using ENCODING_NAMESPACE;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  public class CompiledSingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport<SOLUTION_CLASS> {
+
+    public void Analyze(SOLUTION_CLASS[] solutions, double[] qualities, ResultCollection results, IRandom random) {
+      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+      // Write or update results given the range of vectors and resulting qualities
+      // Uncomment the following lines if you want to retrieve the best individual
+      // Maximization:
+      // var bestIndex = qualities.Select((v, i) => Tuple.Create(i, v)).OrderByDescending(x => x.Item2).First().Item1;
+      // Minimization:
+      // var bestIndex = qualities.Select((v, i) => Tuple.Create(i, v)).OrderBy(x => x.Item2).First().Item1;
+      // var best = solutions[bestIndex];
+    }
+
+    public IEnumerable<SOLUTION_CLASS> GetNeighbors(SOLUTION_CLASS solution, IRandom random) {
+      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+      // Create new vectors, based on the given one that represent small changes
+      // This method is only called from move-based algorithms (Local Search, Simulated Annealing, etc.)
+      while (true) {
+        // Algorithm will draw only a finite amount of samples
+        // Change to a for-loop to return a concrete amount of neighbors
+        var neighbor = (SOLUTION_CLASS)solution.Clone();
+        // For instance, perform a single bit-flip in a binary parameter
+        //var bIndex = random.Next(solution.Length);
+        //neighbor[bIndex] = !neighbor[bIndex];
+        yield return neighbor;
+      }
+    }
+
+    // Implement further classes and methods
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/SingleObjectiveOptimizationSupportScript.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/SingleObjectiveOptimizationSupportScript.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/SingleObjective/SingleObjectiveOptimizationSupportScript.cs	(revision 16816)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.ExternalEvaluation.Programmable;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  [Item("ProblemDefinitionScript", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
+  [StorableType("3EB74171-6ECB-4479-861E-DA4EB39FE70C")]
+  public sealed class SingleObjectiveOptimizationSupportScript<TEncodedSolution> : OptimizationSupportScript<ISingleObjectiveOptimizationSupport<TEncodedSolution>>, ISingleObjectiveOptimizationSupport<TEncodedSolution>
+    where TEncodedSolution : IDeepCloneable {
+    
+    [StorableConstructor]
+    private SingleObjectiveOptimizationSupportScript(StorableConstructorFlag _) : base(_) { }
+    private SingleObjectiveOptimizationSupportScript(SingleObjectiveOptimizationSupportScript<TEncodedSolution> original, Cloner cloner) : base(original, cloner) { }
+    public SingleObjectiveOptimizationSupportScript() : base() {
+      var codeTemplate = Templates.CompiledSingleObjectiveOptimizationSupport;
+      codeTemplate = codeTemplate.Replace("ENCODING_NAMESPACE", typeof(TEncodedSolution).Namespace);
+      codeTemplate = codeTemplate.Replace("SOLUTION_CLASS", typeof(TEncodedSolution).Name);
+      Code = codeTemplate;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveOptimizationSupportScript<TEncodedSolution>(this, cloner);
+    }
+
+    void ISingleObjectiveOptimizationSupport<TEncodedSolution>.Analyze(TEncodedSolution[] individuals, double[] qualities, ResultCollection results, IRandom random) {
+      CompiledInstance.Analyze(individuals, qualities, results, random);
+    }
+
+    IEnumerable<TEncodedSolution> ISingleObjectiveOptimizationSupport<TEncodedSolution>.GetNeighbors(TEncodedSolution individual, IRandom random) {
+      return CompiledInstance.GetNeighbors(individual, random);
+    }
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.Designer.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.Designer.cs	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.Designer.cs	(revision 16816)
@@ -20,5 +20,5 @@
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -62,17 +62,14 @@
         
         /// <summary>
-        ///   Looks up a localized string similar to using System;
-        ///using System.Linq;
-        ///using System.Collections.Generic;
-        ///using HeuristicLab.Common;
-        ///using HeuristicLab.Core;
-        ///using HeuristicLab.Data;
+        ///   Looks up a localized string similar to using HeuristicLab.Core;
         ///using HeuristicLab.Optimization;
+        ///using ENCODING_NAMESPACE;
         ///
         ///namespace HeuristicLab.Problems.ExternalEvaluation {
-        ///  public class CompiledMultiObjectiveOptimizationSupport : CompiledOptimizationSupport, IMultiObjectiveOptimizationSupport {
+        ///  public class CompiledMultiObjectiveOptimizationSupport : CompiledOptimizationSupport, IMultiObjectiveOptimizationSupport&lt;SOLUTION_CLASS&gt; {
         ///
-        ///    public void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
-        ///      // Use vars.yourVaria [rest of string was truncated]&quot;;.
+        ///    public void Analyze(SOLUTION_CLASS[] solutions, double[][] qualities, ResultCollection results, IRandom random) {
+        ///      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+        ///      // Write [rest of string was truncated]&quot;;.
         /// </summary>
         internal static string CompiledMultiObjectiveOptimizationSupport {
@@ -83,17 +80,15 @@
         
         /// <summary>
-        ///   Looks up a localized string similar to using System;
-        ///using System.Linq;
-        ///using System.Collections.Generic;
+        ///   Looks up a localized string similar to using System.Collections.Generic;
         ///using HeuristicLab.Common;
         ///using HeuristicLab.Core;
-        ///using HeuristicLab.Data;
         ///using HeuristicLab.Optimization;
+        ///using ENCODING_NAMESPACE;
         ///
         ///namespace HeuristicLab.Problems.ExternalEvaluation {
-        ///  public class CompiledSingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport {
+        ///  public class CompiledSingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport&lt;SOLUTION_CLASS&gt; {
         ///
-        ///    public void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
-        ///      // Use vars.yourVaria [rest of string was truncated]&quot;;.
+        ///    public void Analyze(SOLUTION_CLASS[] solutions, double[] qualities, ResultCollection results, IRandom random) {
+        ///      // Use vars.yourVariable to access va [rest of string was truncated]&quot;;.
         /// </summary>
         internal static string CompiledSingleObjectiveOptimizationSupport {
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.resx
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.resx	(revision 16815)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/Templates.resx	(revision 16816)
@@ -120,8 +120,8 @@
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="CompiledMultiObjectiveOptimizationSupport" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>compiledmultiobjectiveoptimizationsupport.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+    <value>MultiObjective\CompiledMultiObjectiveOptimizationSupport.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
   <data name="CompiledSingleObjectiveOptimizationSupport" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>CompiledSingleObjectiveOptimizationSupport.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+    <value>SingleObjective\CompiledSingleObjectiveOptimizationSupport.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
 </root>
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs	(revision 16816)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs	(revision 16816)
@@ -0,0 +1,186 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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.Drawing;
+using System.Linq;
+using System.Threading;
+using Google.ProtocolBuffers;
+using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.ExternalEvaluation {
+  [Item("External Evaluation Problem (single-objective)", "A problem that is evaluated in a different process.")]
+  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblems, Priority = 100)]
+  [StorableType("115EB3A5-A8A8-4A2E-9799-9485FE896DEC")]
+  // BackwardsCompatibility3.3
+  // Rename class to SingleObjectiveExternalEvaluationProblem
+  public class ExternalEvaluationProblem<TEncoding, TEncodedSolution> : SingleObjectiveProblem<TEncoding, TEncodedSolution>, IExternalEvaluationProblem
+    where TEncoding : class, IEncoding<TEncodedSolution>
+    where TEncodedSolution : class, IEncodedSolution {
+
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; }
+    }
+
+    #region Parameters
+    public OptionalValueParameter<EvaluationCache> CacheParameter {
+      get { return (OptionalValueParameter<EvaluationCache>)Parameters["Cache"]; }
+    }
+    public IValueParameter<CheckedItemCollection<IEvaluationServiceClient>> ClientsParameter {
+      get { return (IValueParameter<CheckedItemCollection<IEvaluationServiceClient>>)Parameters["Clients"]; }
+    }
+    public IValueParameter<SolutionMessageBuilder> MessageBuilderParameter {
+      get { return (IValueParameter<SolutionMessageBuilder>)Parameters["MessageBuilder"]; }
+    }
+    public IFixedValueParameter<SingleObjectiveOptimizationSupportScript<TEncodedSolution>> SupportScriptParameter {
+      get { return (IFixedValueParameter<SingleObjectiveOptimizationSupportScript<TEncodedSolution>>)Parameters["SupportScript"]; }
+    }
+    #endregion
+
+    #region Properties
+    public new TEncoding Encoding {
+      get { return base.Encoding; }
+      set { base.Encoding = value; }
+    }
+    public EvaluationCache Cache {
+      get { return CacheParameter.Value; }
+    }
+    public CheckedItemCollection<IEvaluationServiceClient> Clients {
+      get { return ClientsParameter.Value; }
+    }
+    public SolutionMessageBuilder MessageBuilder {
+      get { return MessageBuilderParameter.Value; }
+    }
+    public SingleObjectiveOptimizationSupportScript<TEncodedSolution> OptimizationSupportScript {
+      get { return SupportScriptParameter.Value; }
+    }
+    private ISingleObjectiveOptimizationSupport<TEncodedSolution> OptimizationSupport {
+      get { return SupportScriptParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected ExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
+    protected ExternalEvaluationProblem(ExternalEvaluationProblem<TEncoding, TEncodedSolution> original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ExternalEvaluationProblem<TEncoding, TEncodedSolution>(this, cloner);
+    }
+    public ExternalEvaluationProblem(TEncoding encoding)
+      : base(encoding) {
+      Parameters.Remove("Maximization"); // readonly in base class
+      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", new BoolValue()));
+      Parameters.Add(new OptionalValueParameter<EvaluationCache>("Cache", "Cache of previously evaluated solutions."));
+      Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() }));
+      Parameters.Add(new ValueParameter<SolutionMessageBuilder>("MessageBuilder", "The message builder that converts from HeuristicLab objects to SolutionMessage representation.", new SolutionMessageBuilder()) { Hidden = true });
+      Parameters.Add(new FixedValueParameter<SingleObjectiveOptimizationSupportScript<TEncodedSolution>>("SupportScript", "A script that can provide neighborhood and analyze the results of the optimization.", new SingleObjectiveOptimizationSupportScript<TEncodedSolution>()));
+
+      Operators.Add(new BestScopeSolutionAnalyzer());
+    }
+
+    #region Single Objective Problem Overrides
+    public override bool Maximization {
+      get { return Parameters.ContainsKey("Maximization") && ((IValueParameter<BoolValue>)Parameters["Maximization"]).Value.Value; }
+    }
+
+    public virtual void SetMaximization(bool maximization) {
+      MaximizationParameter.Value.Value = maximization;
+    }
+
+    public override double Evaluate(TEncodedSolution solution, IRandom random) {
+      var qualityMessage = Evaluate(BuildSolutionMessage(solution));
+      if (!qualityMessage.HasExtension(SingleObjectiveQualityMessage.QualityMessage_))
+        throw new InvalidOperationException("The received message is not a SingleObjectiveQualityMessage.");
+      return qualityMessage.GetExtension(SingleObjectiveQualityMessage.QualityMessage_).Quality;
+    }
+    public virtual QualityMessage Evaluate(SolutionMessage solutionMessage) {
+      return Cache == null
+        ? EvaluateOnNextAvailableClient(solutionMessage)
+        : Cache.GetValue(solutionMessage, EvaluateOnNextAvailableClient, GetQualityMessageExtensions());
+    }
+
+    public override void Analyze(TEncodedSolution[] solutions, double[] qualities, ResultCollection results, IRandom random) {
+      OptimizationSupport.Analyze(solutions, qualities, results, random);
+    }
+
+    public override IEnumerable<TEncodedSolution> GetNeighbors(TEncodedSolution solutions, IRandom random) {
+      return OptimizationSupport.GetNeighbors(solutions, random);
+    }
+    #endregion
+
+    public virtual ExtensionRegistry GetQualityMessageExtensions() {
+      var extensions = ExtensionRegistry.CreateInstance();
+      extensions.Add(SingleObjectiveQualityMessage.QualityMessage_);
+      return extensions;
+    }
+
+    #region Evaluation
+    private HashSet<IEvaluationServiceClient> activeClients = new HashSet<IEvaluationServiceClient>();
+    private object clientLock = new object();
+
+    private QualityMessage EvaluateOnNextAvailableClient(SolutionMessage message) {
+      IEvaluationServiceClient client = null;
+      lock (clientLock) {
+        client = Clients.CheckedItems.FirstOrDefault(c => !activeClients.Contains(c));
+        while (client == null && Clients.CheckedItems.Any()) {
+          Monitor.Wait(clientLock);
+          client = Clients.CheckedItems.FirstOrDefault(c => !activeClients.Contains(c));
+        }
+        if (client != null)
+          activeClients.Add(client);
+      }
+      try {
+        return client.Evaluate(message, GetQualityMessageExtensions());
+      }
+      finally {
+        lock (clientLock) {
+          activeClients.Remove(client);
+          Monitor.PulseAll(clientLock);
+        }
+      }
+    }
+
+    private SolutionMessage BuildSolutionMessage(TEncodedSolution solution, int solutionId = 0) {
+      lock (clientLock) {
+        SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
+        protobufBuilder.SolutionId = solutionId;
+        var scope = new Scope();
+        ScopeUtil.CopyEncodedSolutionToScope(scope, Encoding, solution);
+        foreach (var variable in scope.Variables) {
+          try {
+            MessageBuilder.AddToMessage(variable.Value, variable.Name, protobufBuilder);
+          }
+          catch (ArgumentException ex) {
+            throw new InvalidOperationException(string.Format("ERROR while building solution message: Parameter {0} cannot be added to the message", Name), ex);
+          }
+        }
+        return protobufBuilder.Build();
+      }
+    }
+    #endregion
+  }
+}
