Index: /branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/NKLandscape.cs
===================================================================
--- /branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/NKLandscape.cs	(revision 8004)
+++ /branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/NKLandscape.cs	(revision 8005)
@@ -20,36 +20,11 @@
   [Creatable("Problems")]
   [StorableClass]
-  public sealed class NKLandscape : ParameterizedNamedItem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent {
+  public sealed class NKLandscape : SingleObjectiveHeuristicOptimizationProblem<INKEvaluator, IBinaryVectorCreator>, IStorableContent {
+
     public string Filename { get; set; }
 
-    public static new Image StaticItemImage { get { return VSImageLibrary.Type; } }
-
     #region Parameter Properties
-    public ValueParameter<BoolValue> MaximizationParameter {
-      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
-    }
-    IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter {
-      get { return MaximizationParameter; }
-    }
     public ValueParameter<IntValue> LengthParameter {
       get { return (ValueParameter<IntValue>)Parameters["Length"]; }
-    }
-    public ValueParameter<IBinaryVectorCreator> SolutionCreatorParameter {
-      get { return (ValueParameter<IBinaryVectorCreator>)Parameters["SolutionCreator"]; }
-    }
-    IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter {
-      get { return SolutionCreatorParameter; }
-    }
-    public ValueParameter<INKEvaluator> EvaluatorParameter {
-      get { return (ValueParameter<INKEvaluator>)Parameters["Evaluator"]; }
-    }
-    IParameter IHeuristicOptimizationProblem.EvaluatorParameter {
-      get { return EvaluatorParameter; }
-    }
-    public ValueParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (ValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
-    }
-    IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter {
-      get { return BestKnownQualityParameter; }
     }
     public ValueParameter<BoolMatrix> GeneInteractionsParameter {
@@ -81,39 +56,16 @@
       set { LengthParameter.Value = value; }
     }
-    public IBinaryVectorCreator SolutionCreator {
-      get { return SolutionCreatorParameter.Value; }
-      set { SolutionCreatorParameter.Value = value; }
-    }
-    ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator {
-      get { return SolutionCreatorParameter.Value; }
-    }
-    public INKEvaluator Evaluator {
-      get { return EvaluatorParameter.Value; }
-      set { EvaluatorParameter.Value = value; }
-    }
-    ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator {
-      get { return EvaluatorParameter.Value; }
-    }
-    IEvaluator IHeuristicOptimizationProblem.Evaluator {
-      get { return EvaluatorParameter.Value; }
-    }
-    public DoubleValue BestKnownQuality {
-      get { return BestKnownQualityParameter.Value; }
-    }
-    public IEnumerable<IItem> Operators {
-      get { return operators; }
-    }
     public IInteractionInitializer InteractionInitializer {
       get { return InteractionInitializerParameter.Value; }
     }
-    //private BestOneMaxSolutionAnalyzer BestOneMaxSolutionAnalyzer {
-    //get { return operators.OfType<BestOneMaxSolutionAnalyzer>().FirstOrDefault(); }
-    //}
+    [Storable(AllowOneWay = true)]
+    private List<IOperator> operators {
+      set {
+       Operators.AddRange(value);
+      }
+    } 
     #endregion
 
     private static MersenneTwister random = new MersenneTwister();
-
-    [Storable]
-    private List<IItem> operators;
 
     [StorableConstructor]
@@ -121,17 +73,9 @@
     private NKLandscape(NKLandscape original, Cloner cloner)
       : base(original, cloner) {
-      operators = original.operators.Select(x => (IItem)cloner.Clone(x)).ToList();
       AttachEventHandlers();
     }
     public NKLandscape()
       : base() {
-      RandomBinaryVectorCreator creator = new RandomBinaryVectorCreator();
-      INKEvaluator evaluator = new NKEvaluator();
-
-      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to true as the OneMax Problem is a maximization problem.", new BoolValue(true)));
       Parameters.Add(new ValueParameter<IntValue>("Length", "The length of the BinaryVector.", new IntValue(10)));
-      Parameters.Add(new ValueParameter<IBinaryVectorCreator>("SolutionCreator", "The operator which should be used to create new OneMax solutions.", creator));
-      Parameters.Add(new ValueParameter<INKEvaluator>("Evaluator", "The operator which should be used to evaluate NK landscape solutions.", evaluator));
-      Parameters.Add(new ValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this OneMax instance.", new DoubleValue(0)));
       Parameters.Add(new ValueParameter<BoolMatrix>("GeneInteractions", "Every column gives the participating genes for each fitness component"));
       Parameters.Add(new ValueParameter<IntValue>("InteractionSeed", "The seed used for the hash function to generate interaction tables.", new IntValue(random.Next())));
@@ -142,4 +86,7 @@
       Parameters.Add(new OptionalConstrainedValueParameter<IWeightsInitializer>("WeightsInitializer", "Operator to initialize weights distribution"));
 
+      SolutionCreator = new RandomBinaryVectorCreator();
+      Evaluator = new NKEvaluator();
+
       InitializeInteractionInitializerParameter();
       InitializeWeightsInitializerParameter();
@@ -170,32 +117,11 @@
 
     #region Events
-    public event EventHandler SolutionCreatorChanged;
-    private void OnSolutionCreatorChanged() {
-      EventHandler handler = SolutionCreatorChanged;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-    public event EventHandler EvaluatorChanged;
-    private void OnEvaluatorChanged() {
-      EventHandler handler = EvaluatorChanged;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-    public event EventHandler OperatorsChanged;
-    private void OnOperatorsChanged() {
-      EventHandler handler = OperatorsChanged;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-    public event EventHandler Reset;
-    private void OnReset() {
-      EventHandler handler = Reset;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-
-    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
-      SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged);
+    protected override void OnSolutionCreatorChanged() {
+      SolutionCreator.BinaryVectorParameter.ActualNameChanged += SolutionCreator_BinaryVectorParameter_ActualNameChanged;
       ParameterizeSolutionCreator();
       ParameterizeEvaluator();
       ParameterizeAnalyzer();
       ParameterizeOperators();
-      OnSolutionCreatorChanged();
+      base.OnSolutionCreatorChanged();
     }
     private void SolutionCreator_BinaryVectorParameter_ActualNameChanged(object sender, EventArgs e) {
@@ -204,8 +130,8 @@
       ParameterizeOperators();
     }
-    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
-      ParameterizeEvaluator();
-      ParameterizeAnalyzer();
-      OnEvaluatorChanged();
+    protected override void OnEvaluatorChanged() {
+      ParameterizeEvaluator();
+      ParameterizeAnalyzer();
+      base.OnEvaluatorChanged();
     }
     void LengthParameter_ValueChanged(object sender, EventArgs e) {
@@ -217,7 +143,4 @@
       NrOfFitnessComponentsParameter.Value = new IntValue(Length.Value);
     }
-    void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
-      //BestKnownQualityParameter.Value.Value = Length.Value;
-    }
     void OneBitflipMoveParameter_ActualNameChanged(object sender, EventArgs e) {
       string name = ((ILookupParameter<OneBitflipMove>)sender).ActualName;
@@ -226,5 +149,4 @@
       }
     }
-
     #endregion
 
@@ -244,8 +166,5 @@
 
     private void AttachEventHandlers() {
-      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
       SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged);
-      BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
-      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
       LengthParameter.ValueChanged += new EventHandler(LengthParameter_ValueChanged);
       LengthParameter.Value.ValueChanged += new EventHandler(Length_ValueChanged);
@@ -286,10 +205,8 @@
 
     private void InitializeOperators() {
-      operators = new List<IItem>();
-      //operators.Add(new BestOneMaxSolutionAnalyzer());
       ParameterizeAnalyzer();
       foreach (IBinaryVectorOperator op in ApplicationManager.Manager.GetInstances<IBinaryVectorOperator>()) {
         if (!(op is ISingleObjectiveMoveEvaluator) || (op is INKMoveEvaluator)) {
-          operators.Add(op);
+          Operators.Add(op);
         }
       }
@@ -333,4 +250,5 @@
     }
     #endregion
+
   }
 }
