Index: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointGroupingVectorDecoder3D.cs
===================================================================
--- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointGroupingVectorDecoder3D.cs	(revision 9563)
+++ branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointGroupingVectorDecoder3D.cs	(revision 9593)
@@ -37,4 +37,5 @@
 using HeuristicLab.Problems.BinPacking.Interfaces;
 using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
+using HeuristicLab.Parameters;
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
@@ -46,6 +47,11 @@
       CuboidPackingItem>, I3DGVDecoder {
 
+    public ValueParameter<BoolValue> StackingConstraintsParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; }
+    }
+
     public ExtremePointGroupingVectorDecoder3D ()
       : base() {
+      Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not."));
     }
     [StorableConstructor]
@@ -58,9 +64,9 @@
     }
 
-    public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(GroupingVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+    public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(GroupingVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints) {
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result =
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremePointsFunctions3D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
+      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, stackingConstraints);
 
       return result;
@@ -72,5 +78,5 @@
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
 
-      return Decode(solution, binMeasures, itemMeasures);
+      return Decode(solution, binMeasures, itemMeasures, StackingConstraintsParameter.Value.Value);
     }
   }
Index: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointMultiComponentVectorDecoder3D.cs
===================================================================
--- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointMultiComponentVectorDecoder3D.cs	(revision 9563)
+++ branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointMultiComponentVectorDecoder3D.cs	(revision 9593)
@@ -38,4 +38,5 @@
 using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Parameters;
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
@@ -47,6 +48,11 @@
       CuboidPackingItem>, I3DMCVDecoder {
 
+    public ValueParameter<BoolValue> StackingConstraintsParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; }
+    }
+
     public ExtremePointMultiComponentVectorDecoder3D ()
       : base() {
+      Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not."));
     }
     [StorableConstructor]
@@ -59,9 +65,9 @@
     }
 
-    public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+    public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints) {
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result =
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremePointsFunctions3D.ExtremePointBasedPacking(ref solution, itemMeasures, binMeasures);
+      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, stackingConstraints);
 
       return result;
@@ -73,5 +79,5 @@
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
 
-      return Decode(solution, binMeasures, itemMeasures);
+      return Decode(solution, binMeasures, itemMeasures, StackingConstraintsParameter.Value.Value);
     }
   }
Index: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointPackingSequenceDecoder3D.cs
===================================================================
--- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointPackingSequenceDecoder3D.cs	(revision 9563)
+++ branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointPackingSequenceDecoder3D.cs	(revision 9593)
@@ -36,4 +36,5 @@
 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
 using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Parameters;
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
@@ -45,6 +46,11 @@
       CuboidPackingItem>, I3DPSDecoder {
 
+    public ValueParameter<BoolValue> StackingConstraintsParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; }
+    }
+
     public ExtremePointPackingSequenceDecoder3D ()
       : base() {
+        Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not."));
     }
     [StorableConstructor]
@@ -64,7 +70,7 @@
 
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremePointsFunctions3D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
+      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, StackingConstraintsParameter.Value.Value); 
 
       return result;
Index: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointsFunctions3D.cs
===================================================================
--- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointsFunctions3D.cs	(revision 9563)
+++ branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointsFunctions3D.cs	(revision 9593)
@@ -8,4 +8,5 @@
 using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
 using HeuristicLab.Encodings.PermutationEncoding;
@@ -20,6 +21,6 @@
 
 
-    public static ObservableDictionary<int, ThreeDimensionalPacking> ExtremePointBasedPacking(ref MultiComponentVectorEncoding solution, 
-        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures) {
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(ref MultiComponentVectorEncoding solution, 
+        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
 
       #region Preperations
@@ -97,10 +98,10 @@
       }
 
-      return itemPositions;
-    }
-
-
-    public static ObservableDictionary<int, ThreeDimensionalPacking> ExtremePointBasedPacking(GroupingVectorEncoding solution,
-        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures) {
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(GroupingVectorEncoding solution,
+        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
 
       #region Preperations
@@ -139,5 +140,5 @@
 
           extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions);
+          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, stackingConstraints);
           if (positionFound != null) {
             extremePointsForBin[binNr].Remove(positionFound);
@@ -162,5 +163,5 @@
 
           extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions);
+          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, stackingConstraints);
           if (positionFound != null) {
             extremePointsForBin[binNr].Remove(positionFound);
@@ -179,10 +180,10 @@
       }
 
-      return itemPositions;
-    }
-
-
-    public static ObservableDictionary<int, ThreeDimensionalPacking> ExtremePointBasedPacking(PackingSequenceEncoding solution, 
-        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures) {
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(PackingSequenceEncoding solution,
+        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
 
       #region Preperations 
@@ -200,5 +201,5 @@
         var item = itemMeasures[itemIndex];
         extremePoints = OrderExtremePoints(extremePoints, occupiedPoints, binMeasures);
-        var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions);
+        var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions, stackingConstraints);
         if (positionFound != null) {
           extremePoints.Remove(positionFound); 
@@ -214,12 +215,40 @@
       }
 
-      return itemPositions;
-    }
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
 
 
     public static ThreeDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures,
-        HashSet<ThreeDimensionalPacking> extremePoints, List<int[, ,]> occupiedPoints, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions) {
-          return FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions, false);
-    }
+        HashSet<ThreeDimensionalPacking> extremePoints, List<int[, ,]> occupiedPoints, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, bool stackingConstraints) {
+          return FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions, stackingConstraints, false);
+    }
+    public static ThreeDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures,
+        HashSet<ThreeDimensionalPacking> extremePoints, List<int[, ,]> occupiedPoints, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, bool stackingConstraints, bool rotated) {
+
+      var itemFromList = itemMeasures[itemIndex];
+      CuboidPackingItem item = new CuboidPackingItem(
+        rotated ? itemFromList.Depth : itemFromList.Width, 
+        itemFromList.Height, 
+        rotated ? itemFromList.Width : itemFromList.Depth,
+        itemFromList.TargetBin);
+
+      int epIndex = 0;
+      while (epIndex < extremePoints.Count &&    
+        //(!IsPositionFeasible(binMeasures, item, extremePoints.ElementAt(epIndex), occupiedPoints) ||
+        (!DeepestBottomLeftFunctions.IsPositionFeasible(binMeasures, extremePoints.ElementAt(epIndex).AssignedBin, item, extremePoints.ElementAt(epIndex), itemPositions, itemMeasures) ||
+        (stackingConstraints && !IsStaticStable(occupiedPoints[extremePoints.ElementAt(epIndex).AssignedBin], item, extremePoints.ElementAt(epIndex))))) 
+      { epIndex++; }
+
+      if (epIndex < extremePoints.Count) {
+        var result = extremePoints.ElementAt(epIndex);
+        result.Rotated = rotated;
+        return result;
+      } 
+      return null;
+    }
+
+
     public static ThreeDimensionalPacking FindExtremePointForItemUsingMaterialAndWeightConstraint(int itemIndex, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures,
        HashSet<ThreeDimensionalPacking> extremePoints, List<int[, ,]> occupiedPoints, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, bool rotated) {
@@ -234,4 +263,5 @@
       int epIndex = 0;
       while (epIndex < extremePoints.Count &&
+        //(!IsPositionFeasible(binMeasures, item, extremePoints.ElementAt(epIndex), occupiedPoints) ||  
         (!DeepestBottomLeftFunctions.IsPositionFeasible(binMeasures, extremePoints.ElementAt(epIndex).AssignedBin, item, extremePoints.ElementAt(epIndex), itemPositions, itemMeasures) ||
         !IsStaticStable(occupiedPoints[extremePoints.ElementAt(epIndex).AssignedBin], item, extremePoints.ElementAt(epIndex)) ||
@@ -243,27 +273,4 @@
         return result;
       }
-      return null;
-    }
-    public static ThreeDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, 
-        HashSet<ThreeDimensionalPacking> extremePoints, List<int[,,]> occupiedPoints, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, bool rotated) {
-
-      var itemFromList = itemMeasures[itemIndex];
-      CuboidPackingItem item = new CuboidPackingItem(
-        rotated ? itemFromList.Depth : itemFromList.Width, 
-        itemFromList.Height, 
-        rotated ? itemFromList.Width : itemFromList.Depth,
-        itemFromList.TargetBin);
-
-      int epIndex = 0;
-      while (epIndex < extremePoints.Count &&
-        (!DeepestBottomLeftFunctions.IsPositionFeasible(binMeasures, extremePoints.ElementAt(epIndex).AssignedBin, item, extremePoints.ElementAt(epIndex), itemPositions, itemMeasures) ||
-        !IsStaticStable(occupiedPoints[extremePoints.ElementAt(epIndex).AssignedBin], item, extremePoints.ElementAt(epIndex)))) 
-      { epIndex++; }
-
-      if (epIndex < extremePoints.Count) {
-        var result = extremePoints.ElementAt(epIndex);
-        result.Rotated = rotated;
-        return result;
-      } 
       return null;
     }
@@ -439,4 +446,6 @@
       return shortestSide;
     }
+
+    
   }
 }
Index: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ISOContainerMultiComponentVectorDecoder3D.cs
===================================================================
--- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ISOContainerMultiComponentVectorDecoder3D.cs	(revision 9563)
+++ branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ISOContainerMultiComponentVectorDecoder3D.cs	(revision 9593)
@@ -62,6 +62,6 @@
       
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result =
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(new ObservableDictionary<int, CuboidPackingBin>(), itemMeasures);
-
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>();
+                                                                   /*
       #region Preperations
       int nrOfBins = solution.NrOfBins;
@@ -153,6 +153,5 @@
       }
 
-      result.PackingItemPositions = itemPositions;
-      result.PackingBinMeasures = resultingBinMeasures;
+      result.BinPackings = BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, resultingBinMeasures, itemMeasures, nrOfBins);   */
       return result;
     }
