Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/AutoDefaultRule.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/AutoDefaultRule.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/AutoDefaultRule.cs	(revision 9605)
@@ -0,0 +1,125 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS.DefaultRule {
+  [Item("AutoDefaultRule", "Description missing")]
+  [StorableClass]
+  public class AutoDefaultRule : DefaultRuleOperator, IStochasticOperator {
+
+    #region Parameter Properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<ItemDictionary<IGAssistNiche, ItemList<DoubleValue>>> AverageAccuraciesParameter {
+      get { return (IValueLookupParameter<ItemDictionary<IGAssistNiche, ItemList<DoubleValue>>>)Parameters["AverageAccuracies"]; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<IntValue> AccuraciesCountParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["AccuraciesCount"]; }
+    }
+    public IValueLookupParameter<IGAssistNicheEqualityComparer> NicheComparerParameter {
+      get { return (IValueLookupParameter<IGAssistNicheEqualityComparer>)Parameters["NicheComparer"]; }
+    }
+    public IValueLookupParameter<DoubleValue> NicheStandardDeviationParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["NicheStandardDeviation"]; }
+    }
+    #endregion
+
+    public ItemDictionary<IGAssistNiche, ItemList<DoubleValue>> AverageAccuracies { get { return AverageAccuraciesParameter.ActualValue; } }
+    public int AccuraciesCount { get { return AccuraciesCountParameter.ActualValue.Value; } }
+
+    [StorableConstructor]
+    protected AutoDefaultRule(bool deserializing) : base(deserializing) { }
+    protected AutoDefaultRule(AutoDefaultRule original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public AutoDefaultRule()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<ItemDictionary<IGAssistNiche, ItemList<DoubleValue>>>("AverageAccuracies"));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality"));
+      Parameters.Add(new LookupParameter<IRandom>("Random"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("AccuraciesCount", new IntValue(15)));
+      Parameters.Add(new ValueLookupParameter<IGAssistNicheEqualityComparer>("NicheComparer"));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("NicheStandardDeviation", new DoubleValue(0.005)));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AutoDefaultRule(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      if (NichingParameter.ActualValue == null) {
+        IList<IGAssistNiche> niches = GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches().ToList();
+        NichingParameter.ActualValue = new BoolValue(true);
+        NichesParameter.ActualValue = new IntValue(niches.Count);
+        AverageAccuraciesParameter.ActualValue = new ItemDictionary<IGAssistNiche, ItemList<DoubleValue>>(NicheComparerParameter.ActualValue as IEqualityComparer<IGAssistNiche>);
+        foreach (var niche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          AverageAccuracies.Add(niche, new ItemList<DoubleValue>(AccuraciesCount));
+        }
+      } else {
+        var nicheFitness = new Dictionary<IGAssistNiche, double>(NicheComparerParameter.ActualValue);
+        foreach (var niche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          nicheFitness[niche] = 0.0;
+          while (AverageAccuracies[niche].Count >= AccuraciesCount) {
+            AverageAccuracies[niche].RemoveAt(AverageAccuracies.Count - 1);
+          }
+        }
+
+        var qualityEnumerator = QualityParameter.ActualValue.GetEnumerator();
+        var individualEnumerator = IndividualParameter.ActualValue.GetEnumerator();
+        while (qualityEnumerator.MoveNext() && individualEnumerator.MoveNext()) {
+          if (nicheFitness[individualEnumerator.Current.Niche] < qualityEnumerator.Current.Value) {
+            nicheFitness[individualEnumerator.Current.Niche] = qualityEnumerator.Current.Value;
+          }
+        }
+
+        foreach (var niche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          AverageAccuracies[niche].Insert(0, new DoubleValue(nicheFitness[niche]));
+        }
+
+        var averages = new List<double>(GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches().Count());
+        if (AverageAccuracies.Values.First().Count >= AccuraciesCount) {
+          foreach (var averageAccuracy in AverageAccuracies.Values) {
+            averages.Add(averageAccuracy.Select(x => x.Value).Average());
+          }
+          double avg = averages.Average();
+          double sum = averages.Sum(d => Math.Pow(d - avg, 2));
+          double std = Math.Sqrt(sum / averages.Count);
+
+          if (std < NicheStandardDeviationParameter.ActualValue.Value) {
+            NichingParameter.ActualValue.Value = false;
+          }
+        }
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DefaultRuleOperator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DefaultRuleOperator.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DefaultRuleOperator.cs	(revision 9605)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  [Item("DefaultRuleOperator", "Description missing")]
+  [StorableClass]
+  public abstract class DefaultRuleOperator : SingleSuccessorOperator, IDefaultRuleOperator {
+
+    #region Parameter Properties
+    public IValueLookupParameter<BoolValue> NichingParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Niching"]; }
+    }
+    public IValueLookupParameter<IntValue> NichesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Niches"]; }
+    }
+    public IValueLookupParameter<IGAssistNiche> DefaultClassParameter {
+      get { return (IValueLookupParameter<IGAssistNiche>)Parameters["DefaultClass"]; }
+    }
+    public ILookupParameter<IGAssistProblemData> GAssistNichesProblemDataParameter {
+      get { return (ILookupParameter<IGAssistProblemData>)Parameters["GAssistNichesProblemData"]; }
+    }
+    public ILookupParameter<ItemArray<IGAssistIndividual>> IndividualParameter {
+      get { return (ILookupParameter<ItemArray<IGAssistIndividual>>)Parameters["Individual"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected DefaultRuleOperator(bool deserializing) : base(deserializing) { }
+    protected DefaultRuleOperator(DefaultRuleOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public DefaultRuleOperator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Niching"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Niches"));
+      Parameters.Add(new ValueLookupParameter<IGAssistNiche>("DefaultClass"));
+      Parameters.Add(new LookupParameter<IGAssistProblemData>("GAssistNichesProblemData"));
+      Parameters.Add(new ScopeTreeLookupParameter<IGAssistIndividual>("Individual"));
+    }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DisabledDefaultRule.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DisabledDefaultRule.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/DisabledDefaultRule.cs	(revision 9605)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  [Item("DisabledDefaultRule", "Description missing")]
+  [StorableClass]
+  public class DisabledDefaultRule : DefaultRuleOperator {
+
+    [StorableConstructor]
+    protected DisabledDefaultRule(bool deserializing) : base(deserializing) { }
+    protected DisabledDefaultRule(DisabledDefaultRule original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public DisabledDefaultRule()
+      : base() {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DisabledDefaultRule(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      if (NichingParameter.ActualValue == null) {
+        NichingParameter.ActualValue = new BoolValue(false);
+        NichesParameter.ActualValue = new IntValue(1);
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/IDefaultRuleOperator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/IDefaultRuleOperator.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/IDefaultRuleOperator.cs	(revision 9605)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  public interface IDefaultRuleOperator : IOperator {
+    IValueLookupParameter<BoolValue> NichingParameter { get; }
+    IValueLookupParameter<IntValue> NichesParameter { get; }
+    IValueLookupParameter<IGAssistNiche> DefaultClassParameter { get; }
+    ILookupParameter<IGAssistProblemData> GAssistNichesProblemDataParameter { get; }
+    ILookupParameter<ItemArray<IGAssistIndividual>> IndividualParameter { get; }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MajorDefaultRule.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MajorDefaultRule.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MajorDefaultRule.cs	(revision 9605)
@@ -0,0 +1,76 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS.DefaultRule {
+  [Item("MajorDefaultRule", "Description missing")]
+  [StorableClass]
+  public class MajorDefaultRule : DefaultRuleOperator, IStochasticOperator {
+
+    #region Parameter Properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MajorDefaultRule(bool deserializing) : base(deserializing) { }
+    protected MajorDefaultRule(MajorDefaultRule original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public MajorDefaultRule()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random"));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MajorDefaultRule(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      if (NichingParameter.ActualValue == null) {
+        NichingParameter.ActualValue = new BoolValue(false);
+        NichesParameter.ActualValue = new IntValue(1);
+        var problemData = GAssistNichesProblemDataParameter.ActualValue;
+        var trainingIndices = problemData.TrainingIndices;
+        var actions = problemData.FetchAction(trainingIndices);
+
+        Dictionary<IGAssistNiche, int> classCount = new Dictionary<IGAssistNiche, int>(actions.First().Comparer);
+        foreach (var niche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          classCount[niche] = 0;
+        }
+        foreach (var action in actions) {
+          classCount[action] += 1;
+        }
+        var maxAction = classCount.MaxItems(x => x.Value).ToList();
+        var index = RandomParameter.ActualValue.Next(0, maxAction.Count);
+        DefaultClassParameter.ActualValue = maxAction[index].Key;
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MinorDefaultRule.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MinorDefaultRule.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/DefaultRule/MinorDefaultRule.cs	(revision 9605)
@@ -0,0 +1,76 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS.DefaultRule {
+  [Item("MinorDefaultRule", "Description missing")]
+  [StorableClass]
+  public class MinorDefaultRule : DefaultRuleOperator, IStochasticOperator {
+
+    #region Parameter Properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MinorDefaultRule(bool deserializing) : base(deserializing) { }
+    protected MinorDefaultRule(MinorDefaultRule original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public MinorDefaultRule()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random"));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MinorDefaultRule(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      if (NichingParameter.ActualValue == null) {
+        NichingParameter.ActualValue = new BoolValue(false);
+        NichesParameter.ActualValue = new IntValue(1);
+        var problemData = GAssistNichesProblemDataParameter.ActualValue;
+        var trainingIndices = problemData.TrainingIndices;
+        var actions = problemData.FetchAction(trainingIndices);
+
+        Dictionary<IGAssistNiche, int> classCount = new Dictionary<IGAssistNiche, int>(actions.First().Comparer);
+        foreach (var niche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          classCount[niche] = 0;
+        }
+        foreach (var action in actions) {
+          classCount[action] += 1;
+        }
+        var minAction = classCount.MinItems(x => x.Value).ToList();
+        var index = RandomParameter.ActualValue.Next(0, minAction.Count);
+        DefaultClassParameter.ActualValue = minAction[index].Key;
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistIndividual.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistIndividual.cs	(revision 9475)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistIndividual.cs	(revision 9605)
@@ -25,6 +25,6 @@
 namespace HeuristicLab.Optimization.Operators.LCS {
   public interface IGAssistIndividual : IGAssistModel {
+    double Length { get; }
     IGAssistNiche Niche { get; }
-    void SetNiche(IRandom random, IGAssistNiche niche);
     void ApplySplit(IRandom random, double probability);
     void ApplyMerge(IRandom random, double probability);
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistIndividualCreator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistIndividualCreator.cs	(revision 9475)
+++ 	(revision )
@@ -1,28 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Core;
-
-namespace HeuristicLab.Optimization.Operators.LCS {
-  public interface IGAssistIndividualCreator : ISolutionCreator {
-    IValueLookupParameter<ItemCollection<IDiscretizer>> DiscretizersParameter { get; }
-  }
-}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistObjectiveEvaluator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistObjectiveEvaluator.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistObjectiveEvaluator.cs	(revision 9605)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization.Operators.LCS.Selection;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  public interface IGAssistObjectiveEvaluator : IHierarchicalSingleObjectiveEvaluator {
+    ILookupParameter<ItemList<ItemList<IntValue>>> StrataParameter { get; }
+    IValueLookupParameter<BoolValue> MaximizationParameter { get; }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistProblem.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistProblem.cs	(revision 9475)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistProblem.cs	(revision 9605)
@@ -24,5 +24,5 @@
 namespace HeuristicLab.Optimization.Operators.LCS {
   public interface IGAssistProblem : ISingleObjectiveHeuristicOptimizationProblem, IDataAnalysisProblem {
-    new IStrataSingleObjectiveEvaluator Evaluator { get; }
+    new IGAssistObjectiveEvaluator Evaluator { get; }
     string NichingParameterName { get; }
   }
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistSolutionCreator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistSolutionCreator.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/Interfaces/IGAssistSolutionCreator.cs	(revision 9605)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Core;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  public interface IGAssistSolutionCreator : IOperator {
+    IValueLookupParameter<ItemCollection<IDiscretizer>> DiscretizersParameter { get; }
+    ILookupParameter<IGAssistNiche> GAssistNicheParameter { get; }
+  }
+}
Index: branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/NicheSolutionCreator.cs
===================================================================
--- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/NicheSolutionCreator.cs	(revision 9605)
+++ branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/NicheSolutionCreator.cs	(revision 9605)
@@ -0,0 +1,138 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization.Operators.LCS {
+  /// <summary>
+  /// An operator which creates new solutions. Evaluation of the new solutions is executed in parallel, if an engine is used which supports parallelization.
+  /// </summary>
+  [Item("NicheSolutionCreator", "")]
+  [StorableClass]
+  public sealed class NicheSolutionCreator : SingleSuccessorOperator {
+    private const string INITIALNICHEPARAMETERNAME = "InitialNiche";
+
+    public ValueLookupParameter<IntValue> NumberOfSolutionsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["NumberOfSolutions"]; }
+    }
+    public ValueLookupParameter<IGAssistSolutionCreator> SolutionCreatorParameter {
+      get { return (ValueLookupParameter<IGAssistSolutionCreator>)Parameters["SolutionCreator"]; }
+    }
+    public ValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public ValueLookupParameter<BoolValue> ParallelParameter {
+      get { return (ValueLookupParameter<BoolValue>)Parameters["Parallel"]; }
+    }
+    public IValueLookupParameter<BoolValue> NichingParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Niching"]; }
+    }
+    public ILookupParameter<IGAssistProblemData> GAssistNichesProblemDataParameter {
+      get { return (ILookupParameter<IGAssistProblemData>)Parameters["GAssistNichesProblemData"]; }
+    }
+    public ILookupParameter<IGAssistNiche> DefaultClassParameter {
+      get { return (ILookupParameter<IGAssistNiche>)Parameters["DefaultClass"]; }
+    }
+    private ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters["CurrentScope"]; }
+    }
+    public IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
+    }
+    public IntValue NumberOfSolutions {
+      get { return NumberOfSolutionsParameter.Value; }
+      set { NumberOfSolutionsParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private NicheSolutionCreator(bool deserializing) : base(deserializing) { }
+    private NicheSolutionCreator(NicheSolutionCreator original, Cloner cloner) : base(original, cloner) { }
+    public NicheSolutionCreator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSolutions", "The number of solutions that should be created."));
+      Parameters.Add(new ValueLookupParameter<IGAssistSolutionCreator>("SolutionCreator", "The operator which is used to create new solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Parallel", "True if the operator should be applied in parallel on all sub-scopes, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope to which the new solutions are added as sub-scopes."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Niching", ""));
+      Parameters.Add(new LookupParameter<IGAssistProblemData>("GAssistNichesProblemData", ""));
+      Parameters.Add(new LookupParameter<IGAssistNiche>("DefaultClass"));
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey("Parallel")) Parameters.Add(new ValueLookupParameter<BoolValue>("Parallel", "True if the operator should be applied in parallel on all sub-scopes, otherwise false.", new BoolValue(true))); // backwards compatibility
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new NicheSolutionCreator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      int count = NumberOfSolutionsParameter.ActualValue.Value;
+      var creator = SolutionCreatorParameter.ActualValue;
+      var evaluator = EvaluatorParameter.ActualValue;
+      bool parallel = ParallelParameter.ActualValue.Value;
+
+      int current = CurrentScope.SubScopes.Count;
+      for (int i = 0; i < count; i++)
+        CurrentScope.SubScopes.Add(new Scope((current + i).ToString()));
+
+      OperationCollection niche = new OperationCollection();
+      OperationCollection creation = new OperationCollection();
+      OperationCollection evaluation = new OperationCollection() { Parallel = parallel };
+      var vcList = new List<VariableCreator>();
+      if (DefaultClassParameter.ActualValue != null) {
+        //default rule has been set beforehand
+        var vc = new VariableCreator();
+        vc.CollectedValues.Add(new ValueParameter<IGAssistNiche>(INITIALNICHEPARAMETERNAME, DefaultClassParameter.ActualValue));
+        vcList.Add(vc);
+      } else {
+        //default rule is set to auto
+        foreach (var curNiche in GAssistNichesProblemDataParameter.ActualValue.GetPossibleNiches()) {
+          var vc = new VariableCreator();
+          vc.CollectedValues.Add(new ValueParameter<IGAssistNiche>(INITIALNICHEPARAMETERNAME, curNiche));
+          vcList.Add(vc);
+        }
+      }
+      creator.GAssistNicheParameter.ActualName = INITIALNICHEPARAMETERNAME;
+      for (int i = 0; i < count; i++) {
+        //only if niching is disabled and no default class has been set, then no niche has to be created in the scope
+        if (NichingParameter.ActualValue.Value || DefaultClassParameter.ActualValue != null) {
+          niche.Add(ExecutionContext.CreateOperation(vcList[i % vcList.Count], CurrentScope.SubScopes[current + i]));
+        }
+        if (creator != null) creation.Add(ExecutionContext.CreateOperation(creator, CurrentScope.SubScopes[current + i]));
+        if (evaluator != null) evaluation.Add(ExecutionContext.CreateOperation(evaluator, CurrentScope.SubScopes[current + i]));
+      }
+      OperationCollection next = new OperationCollection();
+      next.Add(niche);
+      next.Add(creation);
+      next.Add(evaluation);
+      next.Add(base.Apply());
+      return next;
+    }
+  }
+}
