Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProgrammableProblemView.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProgrammableProblemView.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProgrammableProblemView.cs	(revision 11393)
@@ -24,5 +24,5 @@
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
-using HeuristicLab.Scripting.Views;
+using HeuristicLab.MainForm.WindowsForms;
 
 namespace HeuristicLab.Problems.Programmable.Views {
@@ -30,5 +30,5 @@
   [Content(typeof(SingleObjectiveProgrammableProblem), true)]
   public partial class ProgrammableProblemView : ItemView {
-    protected ScriptView ScriptView;
+    protected ViewHost DefinitionView;
 
     public new SingleObjectiveProgrammableProblem Content {
@@ -39,6 +39,6 @@
     public ProgrammableProblemView() {
       InitializeComponent();
-      ScriptView = new ScriptView { Dock = DockStyle.Fill };
-      Controls.Add(ScriptView);
+      DefinitionView = new ViewHost() { ViewsLabelVisible = false, Dock = DockStyle.Fill };
+      Controls.Add(DefinitionView);
     }
 
@@ -46,7 +46,7 @@
       base.OnContentChanged();
       if (Content == null) {
-        ScriptView.Content = null;
+        DefinitionView.Content = null;
       } else {
-        ScriptView.Content = Content.ScriptParameter.Value;
+        DefinitionView.Content = Content.ProblemDefinitionParameter.Value;
         Caption = Content.Name;
       }
@@ -54,5 +54,5 @@
 
     protected override void RegisterContentEvents() {
-      Content.ScriptParameter.ValueChanged += ScriptParameterOnValueChanged;
+      Content.ProblemDefinitionParameter.ValueChanged += ProblemDefinitionParameterOnValueChanged;
       Content.NameChanged += ContentOnNameChanged;
       base.RegisterContentEvents();
@@ -61,10 +61,10 @@
     protected override void DeregisterContentEvents() {
       base.DeregisterContentEvents();
-      Content.ScriptParameter.ValueChanged -= ScriptParameterOnValueChanged;
+      Content.ProblemDefinitionParameter.ValueChanged -= ProblemDefinitionParameterOnValueChanged;
       Content.NameChanged -= ContentOnNameChanged;
     }
 
-    private void ScriptParameterOnValueChanged(object sender, EventArgs eventArgs) {
-      ScriptView.Content = Content.ScriptParameter.Value;
+    private void ProblemDefinitionParameterOnValueChanged(object sender, EventArgs eventArgs) {
+      DefinitionView.Content = Content.ProblemDefinitionParameter.Value;
     }
 
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 11393)
@@ -139,4 +139,5 @@
     <Compile Include="Datastructures\ParameterVector.cs" />
     <Compile Include="Interfaces\IParameterVectorMoveOperator.cs" />
+    <Compile Include="Interfaces\ISingleObjectiveProblemDefinitionHost.cs" />
     <Compile Include="Interfaces\ISingleObjectiveProgrammableProblemEvaluator.cs" />
     <Compile Include="Operators\ParameterVectorManipulator.cs" />
@@ -149,6 +150,7 @@
     <Compile Include="Interfaces\IProblemDefinition.cs" />
     <Compile Include="Interfaces\ISingleObjectiveProblemDefinition.cs" />
-    <Compile Include="ProgrammableProblemScript.cs" />
-    <Compile Include="SingleObjectiveScript.cs" />
+    <Compile Include="ProblemDefinitionScript.cs" />
+    <Compile Include="SingleObjectiveProblemDefinition.cs" />
+    <Compile Include="SingleObjectiveProblemDefinitionScript.cs" />
     <Compile Include="SingleObjectiveProgrammableProblem.cs" />
     <None Include="HeuristicLab.snk" />
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IProblemDefinition.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IProblemDefinition.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IProblemDefinition.cs	(revision 11393)
@@ -20,4 +20,5 @@
 #endregion
 
+
 namespace HeuristicLab.Problems.Programmable {
   public interface IProblemDefinition {
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinition.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinition.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinition.cs	(revision 11393)
@@ -22,4 +22,5 @@
 using System.Collections.Generic;
 using HeuristicLab.Core;
+using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Problems.Programmable {
@@ -27,4 +28,5 @@
     bool IsMaximizationProblem { get; }
     double Evaluate(IRandom random, ParameterVector vector);
+    void Analyze(ParameterVector[] vectors, double[] qualities, ResultCollection results);
     IEnumerable<ParameterVector> GetNeighbors(IRandom random, ParameterVector vector);
   }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinitionHost.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinitionHost.cs	(revision 11393)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProblemDefinitionHost.cs	(revision 11393)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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 HeuristicLab.Core;
+
+namespace HeuristicLab.Problems.Programmable {
+  public interface ISingleObjectiveProblemDefinitionHost : INamedItem {
+    ISingleObjectiveProblemDefinition Instance { get; }
+
+    event EventHandler InstanceChanged;
+  }
+}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveEvaluator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveEvaluator.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveEvaluator.cs	(revision 11393)
@@ -43,6 +43,6 @@
     }
 
-    public ILookupParameter<SingleObjectiveScript> ScriptParameter {
-      get { return (ILookupParameter<SingleObjectiveScript>)Parameters["Script"]; }
+    public ILookupParameter<ISingleObjectiveProblemDefinitionHost> ProblemDefinitionParameter {
+      get { return (ILookupParameter<ISingleObjectiveProblemDefinitionHost>)Parameters["ProblemDefinition"]; }
     }
 
@@ -64,5 +64,5 @@
     public ParameterVectorMoveEvaluator() {
       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
-      Parameters.Add(new LookupParameter<SingleObjectiveScript>("Script", "The script that will execute the evaluation function and define the parameter vector."));
+      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinitionHost>("ProblemDefinition", "The host that holds the problem definition."));
       Parameters.Add(new LookupParameter<Configuration>("Configuration", "An item that holds the problem's configuration."));
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
@@ -76,6 +76,6 @@
     public override IOperation InstrumentedApply() {
       var random = RandomParameter.ActualValue;
-      var runner = ScriptParameter.ActualValue;
-      if (runner.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile.");
+      var host = ProblemDefinitionParameter.ActualValue;
+      if (host.Instance == null) throw new InvalidOperationException("Problem definition instance is null.");
       var config = ConfigurationParameter.ActualValue;
       var binDict = new Dictionary<string, BinaryVector>();
@@ -111,5 +111,5 @@
         realVectors: realDict.Count > 0 ? realDict : null,
         permutations: permDict.Count > 0 ? permDict : null);
-      MoveQualityParameter.ActualValue = new DoubleValue(runner.Instance.Evaluate(random, vector));
+      MoveQualityParameter.ActualValue = new DoubleValue(host.Instance.Evaluate(random, vector));
       return base.InstrumentedApply();
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveGenerator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveGenerator.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveGenerator.cs	(revision 11393)
@@ -48,6 +48,6 @@
     }
 
-    public ILookupParameter<SingleObjectiveScript> ScriptParameter {
-      get { return (ILookupParameter<SingleObjectiveScript>)Parameters["Script"]; }
+    public ILookupParameter<ISingleObjectiveProblemDefinitionHost> ProblemDefinitionParameter {
+      get { return (ILookupParameter<ISingleObjectiveProblemDefinitionHost>)Parameters["ProblemDefinition"]; }
     }
 
@@ -63,5 +63,5 @@
       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
       Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to sample."));
-      Parameters.Add(new LookupParameter<SingleObjectiveScript>("Script", "The script that will execute the evaluation function and define the parameter vector."));
+      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinitionHost>("ProblemDefinition", "The host that holds the problem definition."));
       Parameters.Add(new LookupParameter<Configuration>("Configuration", "An item that holds the problem's configuration."));
     }
@@ -73,6 +73,6 @@
     public override IOperation InstrumentedApply() {
       var random = RandomParameter.ActualValue;
-      var runner = ScriptParameter.ActualValue;
-      if (runner.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile.");
+      var host = ProblemDefinitionParameter.ActualValue;
+      if (host.Instance == null) throw new InvalidOperationException("Problem definition instance is null.");
       var sampleSize = SampleSizeParameter.ActualValue.Value;
       var config = ConfigurationParameter.ActualValue;
@@ -109,5 +109,5 @@
         realVectors: realDict.Count > 0 ? realDict : null,
         permutations: permDict.Count > 0 ? permDict : null);
-      var nbhood = runner.Instance.GetNeighbors(random, vector).Take(sampleSize).ToList();
+      var nbhood = host.Instance.GetNeighbors(random, vector).Take(sampleSize).ToList();
 
       var moveScopes = new Scope[nbhood.Count];
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveMaker.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveMaker.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorMoveMaker.cs	(revision 11393)
@@ -50,6 +50,4 @@
     protected ParameterVectorMoveMaker(ParameterVectorMoveMaker original, Cloner cloner) : base(original, cloner) { }
     public ParameterVectorMoveMaker() {
-      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
-      Parameters.Add(new LookupParameter<SingleObjectiveScript>("Script", "The script that will execute the evaluation function and define the parameter vector."));
       Parameters.Add(new LookupParameter<Configuration>("Configuration", "An item that holds the problem's configuration."));
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs	(revision 11393)
@@ -43,6 +43,6 @@
     }
 
-    public ILookupParameter<SingleObjectiveScript> ScriptParameter {
-      get { return (ILookupParameter<SingleObjectiveScript>)Parameters["Script"]; }
+    public ILookupParameter<ISingleObjectiveProblemDefinitionHost> ProblemDefinitionParameter {
+      get { return (ILookupParameter<ISingleObjectiveProblemDefinitionHost>)Parameters["ProblemDefinition"]; }
     }
 
@@ -60,5 +60,5 @@
     public SingleObjectiveEvaluator() {
       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
-      Parameters.Add(new LookupParameter<SingleObjectiveScript>("Script", "The script that will execute the evaluation function and define the parameter vector."));
+      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinitionHost>("ProblemDefinition", "The host that holds the problem definition."));
       Parameters.Add(new LookupParameter<Configuration>("Configuration", "An item that holds the problem's configuration."));
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
@@ -71,6 +71,6 @@
     public override IOperation Apply() {
       var random = RandomParameter.ActualValue;
-      var runner = ScriptParameter.ActualValue;
-      if (runner.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile.");
+      var host = ProblemDefinitionParameter.ActualValue;
+      if (host.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile.");
       var config = ConfigurationParameter.ActualValue;
       var binDict = new Dictionary<string, BinaryVector>();
@@ -106,5 +106,5 @@
         realVectors: realDict.Count > 0 ? realDict : null,
         permutations: permDict.Count > 0 ? permDict : null);
-      QualityParameter.ActualValue = new DoubleValue(runner.Instance.Evaluate(random, vector));
+      QualityParameter.ActualValue = new DoubleValue(host.Instance.Evaluate(random, vector));
       return base.Apply();
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs	(revision 11393)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs	(revision 11393)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Linq;
+using System.Reflection;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Scripting;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("ProblemDefinitionScript", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
+  [StorableClass]
+  public abstract class ProblemDefinitionScript : Script {
+    protected bool SuppressEvents { get; set; }
+
+    [StorableConstructor]
+    protected ProblemDefinitionScript(bool deserializing) : base(deserializing) { }
+    protected ProblemDefinitionScript(ProblemDefinitionScript original, Cloner cloner)
+      : base(original, cloner) { }
+    public ProblemDefinitionScript() { }
+
+    private volatile IProblemDefinition instance;
+    private object locker = new object();
+    public IProblemDefinition Instance {
+      get {
+        SuppressEvents = true;
+        try {
+          var oldInstance = instance;
+          var compilationNecessary = false;
+          if (instance == null) {
+            lock (locker) {
+              if (instance == null) {
+                compilationNecessary = true;
+                Compile();
+              }
+            }
+          }
+          if (compilationNecessary && (oldInstance != null || instance != null))
+            OnInstanceChanged();
+          return instance;
+        } finally {
+          SuppressEvents = false;
+        }
+      }
+      protected set {
+        instance = value;
+        if (!SuppressEvents) OnInstanceChanged();
+      }
+    }
+
+    public override Assembly Compile() {
+      var assembly = base.Compile();
+      var types = assembly.GetTypes();
+      try {
+        Instance = (IProblemDefinition)Activator.CreateInstance(types.First(x => typeof(IProblemDefinition).IsAssignableFrom(x)));
+      } catch {
+        Instance = null;
+      }
+      return assembly;
+    }
+
+    protected override void OnCodeChanged() {
+      base.OnCodeChanged();
+      instance = null;
+    }
+
+    public event EventHandler InstanceChanged;
+    protected void OnInstanceChanged() {
+      var handler = InstanceChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+  }
+}
Index: anches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProgrammableProblemScript.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProgrammableProblemScript.cs	(revision 11392)
+++ 	(revision )
@@ -1,93 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 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.Linq;
-using System.Reflection;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Scripting;
-
-namespace HeuristicLab.Problems.Programmable {
-  [Item("ProgrammableProblemScript", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
-  [StorableClass]
-  public abstract class ProgrammableProblemScript : Script {
-    protected bool SuppressEvents { get; set; }
-
-    [StorableConstructor]
-    protected ProgrammableProblemScript(bool deserializing) : base(deserializing) { }
-    protected ProgrammableProblemScript(ProgrammableProblemScript original, Cloner cloner)
-      : base(original, cloner) { }
-    public ProgrammableProblemScript() { }
-
-    private volatile IProblemDefinition instance;
-    private object locker = new object();
-    public IProblemDefinition Instance {
-      get {
-        SuppressEvents = true;
-        try {
-          var oldInstance = instance;
-          var compilationNecessary = false;
-          if (instance == null) {
-            lock (locker) {
-              if (instance == null) {
-                compilationNecessary = true;
-                Compile();
-              }
-            }
-          }
-          if (compilationNecessary && (oldInstance != null || instance != null))
-            OnInstanceChanged();
-          return instance;
-        } finally {
-          SuppressEvents = false;
-        }
-      }
-      protected set {
-        instance = value;
-        if (!SuppressEvents) OnInstanceChanged();
-      }
-    }
-
-    public override Assembly Compile() {
-      var assembly = base.Compile();
-      var types = assembly.GetTypes();
-      try {
-        Instance = (IProblemDefinition)Activator.CreateInstance(types.First(x => typeof(IProblemDefinition).IsAssignableFrom(x)));
-      } catch {
-        Instance = null;
-      }
-      return assembly;
-    }
-
-    protected override void OnCodeChanged() {
-      base.OnCodeChanged();
-      instance = null;
-    }
-
-    public event EventHandler InstanceChanged;
-    protected void OnInstanceChanged() {
-      var handler = InstanceChanged;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-  }
-}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.cs	(revision 11393)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.cs	(revision 11393)
@@ -0,0 +1,246 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("Single-objective Problem Definition", "This definition can be dynamically created through code and assigned to the problem.")]
+  public class SingleObjectiveProblemDefinition : ISingleObjectiveProblemDefinitionHost, ISingleObjectiveProblemDefinition {
+
+    private bool isMaximizationProblem;
+    public bool IsMaximizationProblem {
+      get { return isMaximizationProblem; }
+      set {
+        isMaximizationProblem = value;
+        OnInstanceChanged();
+      }
+    }
+
+    private Func<Configuration> configuration;
+    public Func<Configuration> Configuration {
+      get { return configuration; }
+      set {
+        configuration = value;
+        OnInstanceChanged();
+      }
+    }
+
+    private Func<IRandom, ParameterVector, double> evaluate;
+    public Func<IRandom, ParameterVector, double> Evaluate {
+      get { return evaluate; }
+      set {
+        evaluate = value;
+        OnInstanceChanged();
+      }
+    }
+
+    private Action<ParameterVector[], double[], ResultCollection> analyze;
+    public Action<ParameterVector[], double[], ResultCollection> Analyze {
+      get { return analyze; }
+      set {
+        analyze = value;
+        OnInstanceChanged();
+      }
+    }
+
+    private Func<IRandom, ParameterVector, IEnumerable<ParameterVector>> neighbors;
+    public Func<IRandom, ParameterVector, IEnumerable<ParameterVector>> Neighbors {
+      get { return neighbors; }
+      set {
+        neighbors = value;
+        OnInstanceChanged();
+      }
+    }
+
+    protected SingleObjectiveProblemDefinition(SingleObjectiveProblemDefinition original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+      name = original.name;
+      description = original.description;
+      isMaximizationProblem = original.isMaximizationProblem;
+      configuration = original.configuration;
+      evaluate = original.evaluate;
+      analyze = original.analyze;
+      neighbors = original.neighbors;
+    }
+
+    public SingleObjectiveProblemDefinition() : this((string)null, null) { }
+    public SingleObjectiveProblemDefinition(string name) : this(name, null) { }
+    public SingleObjectiveProblemDefinition(string name, string description) {
+      this.name = name ?? ItemName;
+      this.description = description ?? ItemDescription;
+      configuration = () => new Configuration();
+      evaluate = (random, vector) => 0;
+      analyze = (vectors, doubles, results) => { };
+      neighbors = (random, vector) => new[] { (ParameterVector)vector.Clone() };
+    }
+
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveProblemDefinition(this, cloner);
+    }
+
+    public ISingleObjectiveProblemDefinition Instance {
+      get { return this; }
+    }
+
+    public event EventHandler InstanceChanged;
+    protected void OnInstanceChanged() {
+      var handler = InstanceChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    #region Problem definition explicit interface implementations
+    bool ISingleObjectiveProblemDefinition.IsMaximizationProblem {
+      get { return IsMaximizationProblem; }
+    }
+
+    double ISingleObjectiveProblemDefinition.Evaluate(IRandom random, ParameterVector vector) {
+      return Evaluate(random, vector);
+    }
+
+    void ISingleObjectiveProblemDefinition.Analyze(ParameterVector[] vectors, double[] qualities, ResultCollection results) {
+      Analyze(vectors, qualities, results);
+    }
+
+    IEnumerable<ParameterVector> ISingleObjectiveProblemDefinition.GetNeighbors(IRandom random, ParameterVector vector) {
+      return Neighbors(random, vector);
+    }
+
+    Configuration IProblemDefinition.GetConfiguration() {
+      return Configuration();
+    }
+    #endregion
+
+    #region INamedItem
+    protected string name;
+    /// <inheritdoc/>
+    /// <remarks>Calls <see cref="OnNameChanging"/> and also <see cref="OnNameChanged"/> 
+    /// eventually in the setter.</remarks>
+    public string Name {
+      get { return name; }
+      set {
+        if (!CanChangeName) throw new NotSupportedException("Name cannot be changed.");
+        if (!(name.Equals(value) || (value == null) && (name == string.Empty))) {
+          CancelEventArgs<string> e = value == null ? new CancelEventArgs<string>(string.Empty) : new CancelEventArgs<string>(value);
+          OnNameChanging(e);
+          if (!e.Cancel) {
+            name = value == null ? string.Empty : value;
+            OnNameChanged();
+          }
+        }
+      }
+    }
+    public virtual bool CanChangeName {
+      get { return true; }
+    }
+    protected string description;
+    public string Description {
+      get { return description; }
+      set {
+        if (!CanChangeDescription) throw new NotSupportedException("Description cannot be changed.");
+        if (!(description.Equals(value) || (value == null) && (description == string.Empty))) {
+          description = value == null ? string.Empty : value;
+          OnDescriptionChanged();
+        }
+      }
+    }
+    public virtual bool CanChangeDescription {
+      get { return true; }
+    }
+
+    /// <summary>
+    /// Gets the string representation of the current instance in the format: <c>Name: [null|Value]</c>.
+    /// </summary>
+    /// <returns>The current instance as a string.</returns>
+    public override string ToString() {
+      return Name;
+    }
+
+    /// <inheritdoc/>
+    public event EventHandler<CancelEventArgs<string>> NameChanging;
+    /// <summary>
+    /// Fires a new <c>NameChanging</c> event.
+    /// </summary>
+    /// <param name="e">The event arguments of the changing.</param>
+    protected virtual void OnNameChanging(CancelEventArgs<string> e) {
+      var handler = NameChanging;
+      if (handler != null) handler(this, e);
+    }
+    /// <inheritdoc/>
+    public event EventHandler NameChanged;
+    /// <summary>
+    /// Fires a new <c>NameChanged</c> event.
+    /// </summary>
+    /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks>
+    protected virtual void OnNameChanged() {
+      var handler = NameChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+      OnToStringChanged();
+    }
+    /// <inheritdoc/>
+    public event EventHandler DescriptionChanged;
+    /// <summary>
+    /// Fires a new <c>DescriptionChanged</c> event.
+    /// </summary>
+    /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks>
+    protected virtual void OnDescriptionChanged() {
+      var handler = DescriptionChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    #endregion
+    #region IItem
+    public virtual string ItemName {
+      get { return ItemAttribute.GetName(this.GetType()); }
+    }
+    public virtual string ItemDescription {
+      get { return ItemAttribute.GetDescription(this.GetType()); }
+    }
+    public Version ItemVersion {
+      get { return ItemAttribute.GetVersion(this.GetType()); }
+    }
+    public static Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; }
+    }
+    public virtual Image ItemImage {
+      get { return ItemAttribute.GetImage(this.GetType()); }
+    }
+    public object Clone() {
+      return Clone(new Cloner());
+    }
+
+    public event EventHandler ItemImageChanged;
+    protected virtual void OnItemImageChanged() {
+      var handler = ItemImageChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler ToStringChanged;
+    protected virtual void OnToStringChanged() {
+      var handler = ToStringChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    #endregion
+  }
+}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 11393)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs	(revision 11393)
@@ -0,0 +1,106 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("Single-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
+  [StorableClass]
+  public class SingleObjectiveProblemDefinitionScript : ProblemDefinitionScript, ISingleObjectiveProblemDefinitionHost, IStorableContent {
+    public string Filename { get; set; }
+
+    [StorableConstructor]
+    protected SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
+    protected SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public SingleObjectiveProblemDefinitionScript() {
+      Code = CodeTemplate;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SingleObjectiveProblemDefinitionScript(this, cloner);
+    }
+
+    public new ISingleObjectiveProblemDefinition Instance {
+      get { return (ISingleObjectiveProblemDefinition)base.Instance; }
+      protected set { base.Instance = value; }
+    }
+
+    protected override string CodeTemplate {
+      get {
+        return @"using System;
+using System.Linq;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.Programmable;
+
+public class ProblemDefinition : ISingleObjectiveProblemDefinition {
+  public ProblemDefinition() {
+    // initialize private fields
+  }
+
+  public bool IsMaximizationProblem { get { return false; } }
+
+  public Configuration GetConfiguration() {
+    return new Configuration()
+      // .AddBinary(""b"", length: 5)
+      // .AddInteger(""i"", length: 5, min: 2, max: 14, step: 4)
+      // .AddReal(""r"", length: 5, min: -1.0, max: 1.0)
+      // .AddPermutation(""P"", length: 5, type: PermutationTypes.Absolute)
+    ;
+  }
+
+  public double Evaluate(IRandom random, ParameterVector vector) {
+    var quality = 0.0;
+    // quality = vector.Real(""r"").Sum(x => x * x);
+    return quality;
+  }
+
+  public void Analyze(ParameterVector[] vectors, double[] qualities, ResultCollection results) {
+    // write or update results given the range of vectors and resulting qualities
+  }
+
+  public IEnumerable<ParameterVector> GetNeighbors(IRandom random, ParameterVector vector) {
+    // Create new vectors, based on the given one that represent small changes
+    // This method is only called from move-based algorithms (LocalSearch, SimulatedAnnealing, etc.)
+    while (true) {
+      var neighbor = (ParameterVector)vector.Clone();
+      //e.g. make a bit flip in a binary parameter
+      //var bIndex = random.Next(neighbor.Binary(""b"").Length);
+      //neighbor.Binary(""b"")[bIndex] = !neighbor.Binary(""b"")[bIndex];
+      yield return neighbor;
+      yield break;
+    }
+  }
+
+  // implement further classes and methods
+}";
+      }
+    }
+  }
+}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 11392)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 11393)
@@ -55,10 +55,15 @@
     }
 
-    public IValueParameter<SingleObjectiveScript> ScriptParameter {
-      get { return (IValueParameter<SingleObjectiveScript>)Parameters["Script"]; }
-    }
-
-    public IValueParameter<Configuration> ConfigurationParameter {
+    public IValueParameter<ISingleObjectiveProblemDefinitionHost> ProblemDefinitionParameter {
+      get { return (IValueParameter<ISingleObjectiveProblemDefinitionHost>)Parameters["ProblemDefinition"]; }
+    }
+
+    protected IValueParameter<Configuration> ConfigurationParameter {
       get { return (IValueParameter<Configuration>)Parameters["Configuration"]; }
+    }
+
+    public ISingleObjectiveProblemDefinitionHost ProblemDefinition {
+      get { return ProblemDefinitionParameter.Value; }
+      set { ProblemDefinitionParameter.Value = value; }
     }
 
@@ -76,5 +81,5 @@
     public SingleObjectiveProgrammableProblem()
       : base(new SingleObjectiveEvaluator(), new ParameterVectorCreater()) {
-      Parameters.Add(new ValueParameter<SingleObjectiveScript>("Script", "Defines the problem.", new SingleObjectiveScript() { Name = Name }));
+      Parameters.Add(new ValueParameter<ISingleObjectiveProblemDefinitionHost>("ProblemDefinition", "Defines the problem.", new SingleObjectiveProblemDefinitionScript() { Name = Name }));
       Parameters.Add(new ValueParameter<Configuration>("Configuration", "Describes which parameters exist, what they're called, what type they are and their bounds if any."));
 
@@ -100,32 +105,40 @@
 
     private void RegisterEventHandlers() {
-      ScriptParameter.ValueChanged += ScriptParameterOnValueChanged;
-      RegisterScriptInstanceChanges();
-    }
-
-    private void ScriptParameterOnValueChanged(object sender, EventArgs eventArgs) {
-      RegisterScriptInstanceChanges();
-    }
-
-    private void RegisterScriptInstanceChanges() {
-      ScriptParameter.Value.InstanceChanged += ScriptOnInstanceChanged;
-      ScriptParameter.Value.NameChanged += ScriptOnNameChanged;
-    }
-
-    private void ScriptOnNameChanged(object sender, EventArgs eventArgs) {
-      if (sender != ScriptParameter.Value) return;
-      Name = ScriptParameter.Value.Name;
+      ProblemDefinitionParameter.ValueChanged += ProblemDefinitionParameterOnValueChanged;
+      RegisterHostInstanceChanges();
+    }
+
+    private void ProblemDefinitionParameterOnValueChanged(object sender, EventArgs eventArgs) {
+      RegisterHostInstanceChanges();
+      Parameterize();
+    }
+
+    private void RegisterHostInstanceChanges() {
+      ProblemDefinitionParameter.Value.InstanceChanged += ProblemDefinitionHostOnInstanceChanged;
+      ProblemDefinitionParameter.Value.NameChanged += ProblemDefinitionHostOnNameChanged;
+    }
+
+    private void ProblemDefinitionHostOnNameChanged(object sender, EventArgs eventArgs) {
+      if (sender != ProblemDefinitionParameter.Value) return;
+      Name = ProblemDefinitionParameter.Value.Name;
     }
 
     protected override void OnNameChanged() {
       base.OnNameChanged();
-      ScriptParameter.Value.Name = Name;
-    }
-
-    protected virtual void ScriptOnInstanceChanged(object sender, EventArgs eventArgs) {
-      var instance = ScriptParameter.Value.Instance;
+      ProblemDefinitionParameter.Value.Name = Name;
+    }
+
+    protected virtual void ProblemDefinitionHostOnInstanceChanged(object sender, EventArgs eventArgs) {
+      Parameterize();
+    }
+
+    protected virtual void Parameterize() {
+      var instance = ProblemDefinitionParameter.Value.Instance;
       if (instance == null) return;
 
-      var configuration = instance.GetConfiguration();
+      Configuration configuration;
+      try {
+        configuration = instance.GetConfiguration();
+      } catch { return; }
       ConfigurationParameter.Value = configuration;
       Maximization.Value = instance.IsMaximizationProblem;
@@ -602,10 +615,10 @@
       var generator = new ParameterVectorMoveGenerator();
       generator.ConfigurationParameter.ActualName = ConfigurationParameter.Name;
-      generator.ScriptParameter.ActualName = ScriptParameter.Name;
+      generator.ProblemDefinitionParameter.ActualName = ProblemDefinitionParameter.Name;
 
       var evaluator = new ParameterVectorMoveEvaluator();
       evaluator.ConfigurationParameter.ActualName = ConfigurationParameter.Name;
       evaluator.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
-      evaluator.ScriptParameter.ActualName = ScriptParameter.Name;
+      evaluator.ProblemDefinitionParameter.ActualName = ProblemDefinitionParameter.Name;
 
       var maker = new ParameterVectorMoveMaker();
Index: anches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs	(revision 11392)
+++ 	(revision )
@@ -1,100 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 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.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Programmable {
-  [Item("Single-objective Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
-  [StorableClass]
-  public class SingleObjectiveScript : ProgrammableProblemScript, IStorableContent {
-    public string Filename { get; set; }
-
-    [StorableConstructor]
-    protected SingleObjectiveScript(bool deserializing) : base(deserializing) { }
-    protected SingleObjectiveScript(SingleObjectiveScript original, Cloner cloner)
-      : base(original, cloner) { }
-
-    public SingleObjectiveScript() {
-      Code = CodeTemplate;
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SingleObjectiveScript(this, cloner);
-    }
-
-    public new ISingleObjectiveProblemDefinition Instance {
-      get { return (ISingleObjectiveProblemDefinition)base.Instance; }
-      protected set { base.Instance = value; }
-    }
-
-    protected override string CodeTemplate {
-      get {
-        return @"using System;
-using System.Linq;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Problems.Programmable;
-
-public class ProblemDefinition : ISingleObjectiveProblemDefinition {
-  public ProblemDefinition() {
-    // initialize private fields
-  }
-
-  public bool IsMaximizationProblem { get { return false; } }
-
-  public Configuration GetConfiguration() {
-    return new Configuration()
-      // .AddBinary(""b"", length: 5)
-      // .AddInteger(""i"", length: 5, min: 2, max: 14, step: 4)
-      // .AddReal(""r"", length: 5, min: -1.0, max: 1.0)
-      // .AddPermutation(""P"", length: 5, type: PermutationTypes.Absolute)
-    ;
-  }
-
-  public double Evaluate(IRandom random, ParameterVector vector) {
-    var quality = 0.0;
-    // quality = vector.Real(""r"").Select(x => x * x).Sum();
-    return quality;
-  }
-
-  public IEnumerable<ParameterVector> GetNeighbors(IRandom random, ParameterVector vector) {
-    // Create new vectors, based on the given one that represent small changes
-    // This method is only called from move-based algorithms (LocalSearch, SimulatedAnnealing, etc.)
-    while (true) {
-      var neighbor = (ParameterVector)vector.Clone();
-      //e.g. make a bit flip in a binary parameter
-      //var bIndex = random.Next(neighbor.Binary(""b"").Length);
-      //neighbor.Binary(""b"")[bIndex] = !neighbor.Binary(""b"")[bIndex];
-      yield return neighbor;
-    }
-  }
-
-  // implement further classes and methods
-}";
-      }
-    }
-  }
-}
