Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 13350)
@@ -90,10 +90,16 @@
     </Compile>
     <Compile Include="Interfaces\IProgrammableProblem.cs" />
+    <Compile Include="MultiObjectiveProblemDefinitionScript.cs" />
+    <Compile Include="MultiObjectiveProgrammableProblem.cs" />
     <Compile Include="ProblemDefinitionScript.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="ProblemDefinitionScriptException.cs" />
+    <Compile Include="MultiObjectiveProgrammableProblems.cs" />
     <Compile Include="SingleObjectiveProgrammableProblems.cs" />
     <Content Include="Templates\CompiledSingleObjectiveProblemDefinition_Template.cs" />
+    <Content Include="Templates\CompiledMultiObjectiveProblemDefinition_Template.cs">
+      <SubType>Code</SubType>
+    </Content>
     <Compile Include="Templates\ScriptTemplates.Designer.cs">
       <AutoGen>True</AutoGen>
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs	(revision 13350)
@@ -28,29 +28,31 @@
   [Item("Multi-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
   [StorableClass]
-  public sealed class MultiObjectiveProblemDefinitionScript : ProblemDefinitionScript, IMultiObjectiveProblemDefinition, IStorableContent {
+  public sealed class MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, IMultiObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
     public string Filename { get; set; }
 
-    private new IMultiObjectiveProblemDefinition CompiledProblemDefinition {
-      get { return (IMultiObjectiveProblemDefinition)base.CompiledProblemDefinition; }
+    private new IMultiObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
+      get { return (IMultiObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; }
     }
 
     [StorableConstructor]
     private MultiObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
-    private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript original, Cloner cloner) : base(original, cloner) { }
-    public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition) { }
+    private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new MultiObjectiveProblemDefinitionScript(this, cloner);
+      return new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>(this, cloner);
     }
 
-    bool[] IMultiObjectiveProblemDefinition.Maximization {
+    bool[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Maximization {
       get { return CompiledProblemDefinition.Maximization; }
     }
 
-    double[] IMultiObjectiveProblemDefinition.Evaluate(Individual individual, IRandom random) {
+    double[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Evaluate(TSolution individual, IRandom random) {
       return CompiledProblemDefinition.Evaluate(individual, random);
     }
 
-    void IMultiObjectiveProblemDefinition.Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
+    void IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
       CompiledProblemDefinition.Analyze(individuals, qualities, results, random);
     }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13350)
@@ -28,4 +28,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Scripting;
 
 namespace HeuristicLab.Problems.Programmable {
@@ -33,32 +34,42 @@
   [Creatable(CreatableAttribute.Categories.Problems, Priority = 120)]
   [StorableClass]
-  public sealed class MultiObjectiveProgrammableProblem : MultiObjectiveProblem<IEncoding>, IProgrammableItem {
+  public class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
+    where TEncoding : class, IEncoding<TSolution>
+    where TSolution : class, ISolution {
+    protected static readonly string ENCODING_NAMESPACE = "ENCODING_NAMESPACE";
+    protected static readonly string ENCODING_CLASS = "ENCODING_CLASS";
+    protected static readonly string SOLUTION_CLASS = "SOLUTION_CLASS";
+
     public static new Image StaticItemImage {
       get { return VSImageLibrary.Script; }
     }
 
-    private FixedValueParameter<MultiObjectiveProblemDefinitionScript> MultiObjectiveProblemScriptParameter {
-      get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript>)Parameters["ProblemScript"]; }
+    private FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>> MultiObjectiveProblemScriptParameter {
+      get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>)Parameters["ProblemScript"]; }
     }
 
-    public MultiObjectiveProblemDefinitionScript ProblemScript {
+    Script IProgrammableProblem.ProblemScript {
+      get { return ProblemScript; }
+    }
+    public MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript {
       get { return MultiObjectiveProblemScriptParameter.Value; }
     }
 
-    public IMultiObjectiveProblemDefinition ProblemDefinition {
+    public IMultiObjectiveProblemDefinition<TEncoding, TSolution> ProblemDefinition {
       get { return MultiObjectiveProblemScriptParameter.Value; }
     }
 
-    private MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblem original, Cloner cloner)
+    protected MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblem<TEncoding, TSolution> original, Cloner cloner)
       : base(original, cloner) {
       RegisterEvents();
     }
-    public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem(this, cloner); }
+    public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner); }
 
     [StorableConstructor]
-    private MultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }
+    protected MultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }
     public MultiObjectiveProgrammableProblem()
       : base() {
-      Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript>("ProblemScript", "Defines the problem.", new MultiObjectiveProblemDefinitionScript() { Name = Name }));
+      Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
+        new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
       RegisterEvents();
     }
@@ -77,5 +88,5 @@
       Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true });
 
-      Encoding = ProblemDefinition.Encoding;
+      ProblemScript.Initialize();
       OnOperatorsChanged();
       OnReset();
@@ -86,9 +97,9 @@
     }
 
-    public override double[] Evaluate(Individual individual, IRandom random) {
+    public override double[] Evaluate(TSolution individual, IRandom random) {
       return ProblemDefinition.Evaluate(individual, random);
     }
 
-    public override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
+    public override void Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
       ProblemDefinition.Analyze(individuals, qualities, results, random);
     }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs	(revision 13350)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs	(revision 13350)
@@ -0,0 +1,135 @@
+﻿#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.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("Binary Vector Programmable Problem (multi-objective)", "Represents a binary vector multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectiveBinaryVectorProgrammableProblem : MultiObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveBinaryVectorProgrammableProblem(MultiObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+
+    public MultiObjectiveBinaryVectorProgrammableProblem()
+      : base() {
+      var codeTemplate = ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template;
+      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding");
+      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "BinaryVectorEncoding");
+      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "BinaryVector");
+      ProblemScript.Code = codeTemplate;
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveBinaryVectorProgrammableProblem(this, cloner);
+    }
+  }
+
+  //TODO
+  /*
+  [Item("Integer Vector Programmable Problem (multi-objective)", "Represents an integer vector multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveIntegerVectorProgrammableProblem(MultiObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveIntegerVectorProgrammableProblem()
+      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner);
+    }
+  }
+
+  [Item("Real Vector Programmable Problem (multi-objective)", "Represents a real vector multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectiveRealVectorProgrammableProblem : MultiObjectiveProgrammableProblem<RealVectorEncoding, RealVector> {
+
+    [StorableConstructor]
+    private MultiObjectiveRealVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveRealVectorProgrammableProblem(MultiObjectiveRealVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveRealVectorProgrammableProblem()
+      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.RealVectorEncoding", "RealVectorEncoding", "RealVector")) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveRealVectorProgrammableProblem(this, cloner);
+    }
+  }
+
+  [Item("Permutation Programmable Problem (multi-objective)", "Represents a permutation multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectivePermutationProgrammableProblem : MultiObjectiveProgrammableProblem<PermutationEncoding, Permutation> {
+
+    [StorableConstructor]
+    private MultiObjectivePermutationProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectivePermutationProgrammableProblem(MultiObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectivePermutationProgrammableProblem()
+      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.PermutationEncoding", "PermutationEncoding", "Permutation")) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectivePermutationProgrammableProblem(this, cloner);
+    }
+  }
+
+  [Item("Symbolic Expression Tree Programmable Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectiveSymbolicExpressionTreeProgrammableProblem : MultiObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> {
+
+    [StorableConstructor]
+    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(MultiObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveSymbolicExpressionTreeProgrammableProblem()
+      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "SymbolicExpressionTreeEncoding", "SymbolicExpressionTree")) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveSymbolicExpressionTreeProgrammableProblem(this, cloner);
+    }
+  }
+
+  [Item("Linear Linkage Programmable Problem (multi-objective)", "Represents a linear linkage multi-objective problem that can be programmed with a script.")]
+  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
+  [StorableClass]
+  public sealed class MultiObjectiveLinearLinkageProgrammableProblem : MultiObjectiveProgrammableProblem<LinearLinkageEncoding, LinearLinkage> {
+
+    [StorableConstructor]
+    private MultiObjectiveLinearLinkageProgrammableProblem(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveLinearLinkageProgrammableProblem(MultiObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveLinearLinkageProgrammableProblem()
+      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.LinearLinkageEncoding", "LinearLinkageEncoding", "LinearLinkage")) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveLinearLinkageProgrammableProblem(this, cloner);
+    }
+  }*/
+}
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 13350)
@@ -29,16 +29,16 @@
   [Item("Single-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
   [StorableClass]
-  public class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
+  public sealed class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
     where TEncoding : class, IEncoding<TSolution>
     where TSolution : class, ISolution {
     public string Filename { get; set; }
 
-    protected new ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
+    private new ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
       get { return (ISingleObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; }
     }
 
     [StorableConstructor]
-    protected SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
-    protected SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
+    private SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
+    private SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
     public SingleObjectiveProblemDefinitionScript(string codeTemplate) : base(codeTemplate) { }
     public SingleObjectiveProblemDefinitionScript() { }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13350)
@@ -30,4 +30,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Scripting;
 
 namespace HeuristicLab.Problems.Programmable {
@@ -49,4 +50,8 @@
     }
 
+
+    Script IProgrammableProblem.ProblemScript {
+      get { return ProblemScript; }
+    }
     public SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript {
       get { return SingleObjectiveProblemScriptParameter.Value; }
@@ -67,5 +72,6 @@
     public SingleObjectiveProgrammableProblem()
       : base() {
-      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
+      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
+        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
       Operators.Add(new BestScopeSolutionAnalyzer());
       RegisterEvents();
@@ -104,10 +110,4 @@
       return ProblemDefinition.GetNeighbors(individual, random);
     }
-
-    #region IProgrammableProblem Members
-    Scripting.Script IProgrammableProblem.ProblemScript {
-      get { return ProblemScript; }
-    }
-    #endregion
   }
 }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs	(revision 13349)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs	(revision 13350)
@@ -51,4 +51,5 @@
     }
   }
+  //TODO
   /*
   [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")]
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/CompiledMultiObjectiveProblemDefinition_Template.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/CompiledMultiObjectiveProblemDefinition_Template.cs	(revision 13350)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/CompiledMultiObjectiveProblemDefinition_Template.cs	(revision 13350)
@@ -0,0 +1,57 @@
+﻿using System;
+using System.Linq;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using ENCODING_NAMESPACE;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.Programmable;
+
+namespace HeuristicLab.Problems.Programmable {
+  public class CompiledSingleObjectiveProblemDefinition : CompiledMultiObjectiveProblemDefinition<ENCODING_CLASS, SOLUTION_CLASS> {
+    public override bool[] Maximization { get { return new[] { false, false }; } }
+
+    public override void Initialize() {
+      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+      // Define e.g. the length of the solution encoding or the solution creator by modifying the Encoding property
+      // Add additional initialization code e.g. private variables that you need for evaluating
+    }
+
+    public override double[] Evaluate(SOLUTION_CLASS solution, IRandom random) {
+      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
+      var quality = new[] { 0.0, 0.0 };
+      return quality;
+    }
+
+    public override void Analyze(SOLUTION_CLASS[] solution, 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
+
+      //var orderedIndividuals = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderBy(z => z.Quality);
+      //var best = Maximization ? orderedIndividuals.Last().Individual : orderedIndividuals.First().Individual;
+
+      //if (!results.ContainsKey("Best Solution")) {
+      //  results.Add(new Result("Best Solution", typeof(SOLUTION_CLASS)));
+      //}
+      //results["Best Solution"].Value = (IItem)best.Clone();
+    }
+
+    public override IEnumerable<SOLUTION_CLASS> GetNeighbors(SOLUTION_CLASS individual, 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)individual.Clone();
+        // modify the solution specified as neighbor
+        yield return neighbor;
+      }
+    }
+
+    // Implement further classes and methods
+  }
+}
+
