Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/DataReducer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/DataReducer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/DataReducer.cs	(revision 8660)
@@ -70,16 +70,10 @@
       var values = ParameterToReduce.ActualValue;
       if (values.Count() > 0) {
-        if (values.All(x => x.GetType() == typeof(IntValue))) {
-          List<IntValue> intValues = new List<IntValue>();
-          values.ForEach(x => intValues.Add((IntValue)x));
-          CalculateResult(intValues);
-        } else if (values.All(x => x.GetType() == typeof(DoubleValue))) {
-          List<DoubleValue> doubleValues = new List<DoubleValue>();
-          values.ForEach(x => doubleValues.Add((DoubleValue)x));
-          CalculateResult(doubleValues);
-        } else if (values.All(x => x.GetType() == typeof(TimeSpanValue))) {
-          List<TimeSpanValue> timeSpanValues = new List<TimeSpanValue>();
-          values.ForEach(x => timeSpanValues.Add((TimeSpanValue)x));
-          CalculateResult(timeSpanValues);
+        if (values.All(x => typeof(IntValue).IsAssignableFrom(x.GetType()))) {
+          CalculateResult(values.OfType<IntValue>().Select(x => x.Value), values.First().GetType());
+        } else if (values.All(x => typeof(DoubleValue).IsAssignableFrom(x.GetType()))) {
+          CalculateResult(values.OfType<DoubleValue>().Select(x => x.Value), values.First().GetType());
+        } else if (values.All(x => typeof(TimeSpanValue).IsAssignableFrom(x.GetType()))) {
+          CalculateResult(values.OfType<TimeSpanValue>().Select(x => x.Value), values.First().GetType());
         } else {
           throw new ArgumentException(string.Format("Type {0} is not supported by the DataReducer.", values.First().GetType()));
@@ -89,120 +83,188 @@
     }
 
-    private void CalculateResult(List<IntValue> values) {
-      int result = 1;
-      if (TargetParameter.ActualValue == null) TargetParameter.ActualValue = new IntValue();
-      IntValue target = (IntValue)TargetParameter.ActualValue;
-
+    #region integer reduction
+    private void CalculateResult(IEnumerable<int> values, Type targetType) {
+      int result;
       switch (ReductionOperation.Value.Value) {
         case ReductionOperations.Sum:
-          result = values.Sum(x => x.Value);
-          break;
-        case ReductionOperations.Prod:
-          values.ForEach(x => result *= x.Value);
-          break;
-        case ReductionOperations.Avg:
-          result = (int)Math.Round(values.Average(x => x.Value));
-          break;
-        case ReductionOperations.Min:
-          result = values.Min(x => x.Value);
-          break;
-        case ReductionOperations.Max:
-          result = values.Max(x => x.Value);
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, result.GetType()));
-      }
-
+          result = values.Sum();
+          break;
+        case ReductionOperations.Product:
+          result = values.Aggregate(1, (x, y) => x * y);
+          break;
+        case ReductionOperations.Count:
+          result = values.Count();
+          break;
+        case ReductionOperations.Min:
+          result = values.Min();
+          break;
+        case ReductionOperations.Max:
+          result = values.Max();
+          break;
+        case ReductionOperations.Avg:
+          result = (int)Math.Round(values.Average());
+          break;
+        case ReductionOperations.Assign:
+          result = values.Last();
+          break;
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
+      }
+
+      IntValue target;
       switch (TargetOperation.Value.Value) {
-        case ReductionOperations.Assign:
+        case ReductionOperations.Sum:
+          target = InitializeTarget<IntValue, int>(targetType, 0);
+          target.Value += result;
+          break;
+        case ReductionOperations.Product:
+          target = InitializeTarget<IntValue, int>(targetType, 1);
+          target.Value = target.Value * result;
+          break;
+        case ReductionOperations.Min:
+          target = InitializeTarget<IntValue, int>(targetType, int.MaxValue);
+          target.Value = Math.Min(target.Value, result);
+          break;
+        case ReductionOperations.Max:
+          target = InitializeTarget<IntValue, int>(targetType, int.MinValue);
+          target.Value = Math.Max(target.Value, result);
+          break;
+        case ReductionOperations.Avg:
+          target = InitializeTarget<IntValue, int>(targetType, result);
+          target.Value = (int)Math.Round((target.Value + result) / 2.0);
+          break;
+        case ReductionOperations.Assign:
+          target = InitializeTarget<IntValue, int>(targetType, 0);
           target.Value = result;
           break;
-        case ReductionOperations.Sum:
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
+      }
+    }
+    #endregion
+    #region double reduction
+    private void CalculateResult(IEnumerable<double> values, Type targetType) {
+      double result;
+      switch (ReductionOperation.Value.Value) {
+        case ReductionOperations.Sum:
+          result = values.Sum();
+          break;
+        case ReductionOperations.Product:
+          result = values.Aggregate(1.0, (x, y) => x * y);
+          break;
+        case ReductionOperations.Count:
+          result = values.Count();
+          break;
+        case ReductionOperations.Min:
+          result = values.Min();
+          break;
+        case ReductionOperations.Max:
+          result = values.Max();
+          break;
+        case ReductionOperations.Avg:
+          result = values.Average();
+          break;
+        case ReductionOperations.Assign:
+          result = values.Last();
+          break;
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
+      }
+
+      DoubleValue target;
+      switch (TargetOperation.Value.Value) {
+        case ReductionOperations.Sum:
+          target = InitializeTarget<DoubleValue, double>(targetType, 0.0);
           target.Value += result;
           break;
-        case ReductionOperations.Prod:
-          if (target.Value == 0) target.Value = 1;
-          target.Value *= result;
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, result.GetType()));
-      }
-    }
-
-    private void CalculateResult(List<DoubleValue> values) {
-      double result = 1.0;
-      if (TargetParameter.ActualValue == null) TargetParameter.ActualValue = new DoubleValue();
-      DoubleValue target = (DoubleValue)TargetParameter.ActualValue;
-
+        case ReductionOperations.Product:
+          target = InitializeTarget<DoubleValue, double>(targetType, 1.0);
+          target.Value = target.Value * result;
+          break;
+        case ReductionOperations.Min:
+          target = InitializeTarget<DoubleValue, double>(targetType, double.MaxValue);
+          target.Value = Math.Min(target.Value, result);
+          break;
+        case ReductionOperations.Max:
+          target = InitializeTarget<DoubleValue, double>(targetType, double.MinValue);
+          target.Value = Math.Max(target.Value, result);
+          break;
+        case ReductionOperations.Avg:
+          target = InitializeTarget<DoubleValue, double>(targetType, result);
+          target.Value = (target.Value + result) / 2.0;
+          break;
+        case ReductionOperations.Assign:
+          target = InitializeTarget<DoubleValue, double>(targetType, 0.0);
+          target.Value = result;
+          break;
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
+      }
+    }
+    #endregion
+    #region TimeSpan reduction
+    private void CalculateResult(IEnumerable<TimeSpan> values, Type targetType) {
+      TimeSpan result;
       switch (ReductionOperation.Value.Value) {
         case ReductionOperations.Sum:
-          result = values.Sum(x => x.Value);
-          break;
-        case ReductionOperations.Prod:
-          values.ForEach(x => result *= x.Value);
-          break;
-        case ReductionOperations.Avg:
-          result = values.Average(x => x.Value);
-          break;
-        case ReductionOperations.Min:
-          result = values.Min(x => x.Value);
-          break;
-        case ReductionOperations.Max:
-          result = values.Max(x => x.Value);
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, result.GetType()));
-      }
-
+          result = values.Aggregate(new TimeSpan(), (x, y) => x + y);
+          break;
+        case ReductionOperations.Min:
+          result = values.Min();
+          break;
+        case ReductionOperations.Max:
+          result = values.Max();
+          break;
+        case ReductionOperations.Avg:
+          result = TimeSpan.FromMilliseconds(values.Average(x => x.TotalMilliseconds));
+          break;
+        case ReductionOperations.Assign:
+          result = values.Last();
+          break;
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
+      }
+
+      TimeSpanValue target;
       switch (TargetOperation.Value.Value) {
-        case ReductionOperations.Assign:
+        case ReductionOperations.Sum:
+          target = InitializeTarget<TimeSpanValue, TimeSpan>(targetType, new TimeSpan());
+          target.Value += result;
+          break;
+        case ReductionOperations.Min:
+          target = InitializeTarget<TimeSpanValue, TimeSpan>(targetType, TimeSpan.MaxValue);
+          target.Value = target.Value < result ? target.Value : result;
+          break;
+        case ReductionOperations.Max:
+          target = InitializeTarget<TimeSpanValue, TimeSpan>(targetType, TimeSpan.MinValue);
+          target.Value = target.Value > result ? target.Value : result;
+          break;
+        case ReductionOperations.Avg:
+          target = InitializeTarget<TimeSpanValue, TimeSpan>(targetType, result);
+          target.Value = TimeSpan.FromMilliseconds((target.Value.TotalMilliseconds + result.TotalMilliseconds) / 2);
+          break;
+        case ReductionOperations.Assign:
+          target = InitializeTarget<TimeSpanValue, TimeSpan>(targetType, new TimeSpan());
           target.Value = result;
           break;
-        case ReductionOperations.Sum:
-          target.Value += result;
-          break;
-        case ReductionOperations.Prod:
-          if (target.Value == 0.0) target.Value = 1.0;
-          target.Value *= result;
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, result.GetType()));
-      }
-    }
-
-    private void CalculateResult(List<TimeSpanValue> values) {
-      TimeSpan result = TimeSpan.Zero;
-      if (TargetParameter.ActualValue == null) TargetParameter.ActualValue = new TimeSpanValue();
-      TimeSpanValue target = (TimeSpanValue)TargetParameter.ActualValue;
-
-      switch (ReductionOperation.Value.Value) {
-        case ReductionOperations.Sum:
-          values.ForEach(x => result = result.Add(x.Value));
-          break;
-        case ReductionOperations.Avg:
-          double avg = values.Average(x => x.Value.TotalMilliseconds);
-          result = TimeSpan.FromMilliseconds(avg);
-          break;
-        case ReductionOperations.Min:
-          result = values.Min(x => x.Value);
-          break;
-        case ReductionOperations.Max:
-          result = values.Max(x => x.Value);
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, result.GetType()));
-      }
-
-      switch (TargetOperation.Value.Value) {
-        case ReductionOperations.Assign:
-          target.Value = result;
-          break;
-        case ReductionOperations.Sum:
-          target.Value += result;
-          break;
-        default:
-          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, result.GetType()));
-      }
-    }
+        default:
+          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
+      }
+    }
+    #endregion
+
+    #region helpers
+    private T1 InitializeTarget<T1, T2>(Type targetType, T2 initialValue)
+      where T1 : ValueTypeValue<T2>
+      where T2 : struct {
+      T1 target = (T1)TargetParameter.ActualValue;
+      if (target == null) {
+        target = (T1)Activator.CreateInstance(targetType);
+        TargetParameter.ActualValue = target;
+        target.Value = initialValue;
+      }
+      return target;
+    }
+    #endregion
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 8660)
@@ -221,5 +221,5 @@
   -->
   <PropertyGroup>
-    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
@@ -228,4 +228,10 @@
 call PreBuildEvent.cmd
 </PreBuildEvent>
+<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
   </PropertyGroup>
 </Project>
Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Plugin.cs.frame
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Plugin.cs.frame	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Plugin.cs.frame	(revision 8660)
@@ -26,5 +26,5 @@
   /// Plugin class for HeuristicLab.Operators plugin.
   /// </summary>
-  [Plugin("HeuristicLab.Operators", "3.3.6.$WCREV$")]
+  [Plugin("HeuristicLab.Operators", "3.3.7.$WCREV$")]
   [PluginFile("HeuristicLab.Operators-3.3.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Properties/AssemblyInfo.cs.frame	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/Properties/AssemblyInfo.cs.frame	(revision 8660)
@@ -54,3 +54,3 @@
 // by using the '*' as shown below:
 [assembly: AssemblyVersion("3.3.0.0")]
-[assembly: AssemblyFileVersion("3.3.6.$WCREV$")]
+[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/ReductionOperations.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/ReductionOperations.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/ReductionOperations.cs	(revision 8660)
@@ -22,10 +22,11 @@
 namespace HeuristicLab.Operators {
   public enum ReductionOperations {
-    Assign,
     Sum,
-    Prod,
+    Product,
+    Count,
     Min,
     Max,
-    Avg
+    Avg,
+    Assign
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Operators/3.3/SubScopesCounter.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Operators/3.3/SubScopesCounter.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Operators/3.3/SubScopesCounter.cs	(revision 8660)
@@ -27,5 +27,5 @@
 
 namespace HeuristicLab.Operators {
-  [Item("SubScopesCounter", "Counts the number of direct sub-scopes and increments the value given in the parameter.")]
+  [Item("SubScopesCounter", "Counts the number of direct sub-scopes and increments or assigns it to the value given in the parameter.")]
   [StorableClass]
   public class SubScopesCounter : SingleSuccessorOperator {
@@ -33,4 +33,7 @@
     public ILookupParameter<IntValue> ValueParameter {
       get { return (ILookupParameter<IntValue>)Parameters["Value"]; }
+    }
+    public IValueParameter<BoolValue> AccumulateParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["Accumulate"]; }
     }
 
@@ -41,5 +44,15 @@
     }
     public SubScopesCounter() {
-      Parameters.Add(new LookupParameter<IntValue>("Value", "The value that should be incremented by the number of direct sub-scopes. It will be created in the current scope if the value is not found."));
+      Parameters.Add(new LookupParameter<IntValue>("Value", "The value that should be incremented by the number of direct sub-scopes. It will be created in the current scope if the value is not found. If Accumulate is set to false, the number of direct sub-scopes is assigned and not accumulated."));
+      Parameters.Add(new ValueParameter<BoolValue>("Accumulate", "True if the number of direct sub-scopes should be accumulated, false if the number should be assigned.", new BoolValue(true)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey("Accumulate"))
+        Parameters.Add(new ValueParameter<BoolValue>("Accumulate", "True if the number of direct sub-scopes should be accumulated, false if the number should be assigned.", new BoolValue(true)));
+      #endregion
     }
 
@@ -49,7 +62,8 @@
 
     public override IOperation Apply() {
-      int increment = ExecutionContext.Scope.SubScopes.Count;
+      int count = ExecutionContext.Scope.SubScopes.Count;
       if (ValueParameter.ActualValue == null) ValueParameter.ActualValue = new IntValue();
-      ValueParameter.ActualValue.Value += increment;
+      if (AccumulateParameter.Value.Value) ValueParameter.ActualValue.Value += count;
+      else ValueParameter.ActualValue.Value = count;
       return base.Apply();
     }
