Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs	(revision 9593)
@@ -55,14 +55,12 @@
     private void Redraw(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) {     
       int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;
-      var bin = plan.GetPackingBinMeasuresForBinNr(currentBin);
+      var bin = plan.BinPackings[currentBin].BinMeasures;
       packingPlan2D.InitializeContainer(bin.Width, bin.Height);
-      int i = 0;
-      foreach (var item in plan.PackingItemMeasures) {
-        var position = plan.PackingItemPositions[i++];
-        if (position.AssignedBin == currentBin)
+      foreach (var entry in plan.BinPackings[currentBin].ItemMeasures) {
+        var position = plan.BinPackings[currentBin].ItemPositions[entry.Key];
           packingPlan2D.AddItemToContainer(
-            position.Rotated ? item.Height : item.Width,
-            position.Rotated ? item.Width : item.Height, 
-            position.X, position.Y, i.ToString());
+            position.Rotated ? entry.Value.Height : entry.Value.Width,
+            position.Rotated ? entry.Value.Width : entry.Value.Height, 
+            position.X, position.Y, entry.Key.ToString());
       }
     }
@@ -70,6 +68,9 @@
     private void binSelection_SelectedIndexChanged(object sender, EventArgs e) {
       Redraw(Content);
-      packingPlan2D.Invalidate();
-      packingPlan2D.Update();
+      packingPlan2D.Refresh();
+      packingPlan2D.Refresh();
+      packingPlan2D.Refresh();
+      packingPlan2D.Refresh();
+      packingPlan2D.Refresh();
     }
 
@@ -88,6 +89,9 @@
           Redraw(Content);
         }
-        packingPlan2D.Invalidate();
-        packingPlan2D.Update();
+        packingPlan2D.Refresh();
+        packingPlan2D.Refresh();
+        packingPlan2D.Refresh();
+        packingPlan2D.Refresh();
+        packingPlan2D.Refresh();
       }
     }  
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs	(revision 9593)
@@ -54,16 +54,13 @@
     private void UpdateModel() {
       int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;
-      var bin = Content.GetPackingBinMeasuresForBinNr(currentBin);
+      var bin = Content.BinPackings[currentBin].BinMeasures;
       packingPlan3D.InitializeContainer(bin.Width, bin.Height, bin.Depth);
-      int i = 0;
-      foreach (var item in Content.PackingItemMeasures) {
-        var position = Content.PackingItemPositions[i];
-        if (position.AssignedBin == currentBin) 
-          packingPlan3D.AddItemToContainer(
-            position.Rotated ? item.Depth : item.Width, 
-            item.Height, 
-            position.Rotated ? item.Width : item.Depth, 
-            position.X, position.Y, position.Z, i);
-        i++;
+      foreach (var entry in Content.BinPackings[currentBin].ItemMeasures) {
+        var position = Content.BinPackings[currentBin].ItemPositions[entry.Key];
+        packingPlan3D.AddItemToContainer(
+        position.Rotated ? entry.Value.Depth : entry.Value.Width,
+        entry.Value.Height,
+        position.Rotated ? entry.Value.Width : entry.Value.Depth,
+        position.X, position.Y, position.Z, entry.Key, entry.Value.Material);
       }
     }
@@ -75,7 +72,10 @@
       itemSelection.Items.Clear();
       int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;
-      for (int i = 0; i < Content.PackingItemPositions.Count; i++) {
-        if (Content.PackingItemPositions[i].AssignedBin == currentBin)
-          itemSelection.Items.Add(i);
+      //for (int i = 0; i < Content.PackingItemPositions.Count; i++) {
+      //  if (Content.PackingItemPositions[i].AssignedBin == currentBin)
+      //    itemSelection.Items.Add(i);
+      //}
+      foreach (var entry in Content.BinPackings[currentBin].ItemMeasures) {
+        itemSelection.Items.Add(entry.Key);
       }
 
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs	(revision 9593)
@@ -26,5 +26,5 @@
   /// Plugin class for HeuristicLab.Problems.BinPacking.Views plugin.
   /// </summary>
-  [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9473")]
+  [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9495")]
   [PluginFile("HeuristicLab.Problems.BinPacking.Views-3.3.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Common", "3.3")]
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Properties/AssemblyInfo.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Properties/AssemblyInfo.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Properties/AssemblyInfo.cs	(revision 9593)
@@ -54,3 +54,3 @@
 // by using the '*' as shown below:
 [assembly: AssemblyVersion("3.3.0.0")]
-[assembly: AssemblyFileVersion("3.3.7.9473")]
+[assembly: AssemblyFileVersion("3.3.7.9495")]
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BestBinPackingSolutionAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BestBinPackingSolutionAnalyzer.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BestBinPackingSolutionAnalyzer.cs	(revision 9593)
@@ -93,14 +93,22 @@
           !max && bestSolution.Quality.Value > qualities[i].Value) {
           bestSolution.Quality.Value = qualities[i].Value;
-          bestSolution.PackingItemPositions = new ObservableDictionary<int, D> (solutions[i].PackingItemPositions);
-          bestSolution.PackingBinMeasures = new ObservableDictionary<int, B>(solutions[i].PackingBinMeasures);
+          //bestSolution.PackingItemPositions = new ObservableDictionary<int, D> (solutions[i].PackingItemPositions);
+          //bestSolution.PackingBinMeasures = new ObservableDictionary<int, B>(solutions[i].PackingBinMeasures);
+          bestSolution.BinPackings = new ObservableList<BinPacking<D, B, I>>(solutions[i].BinPackings);
         }
       }
       string binUtilKey = "Overall Bin Utilization";
       DoubleValue binUtil = BinUtilizationRegularIdenticalBinEvaluator<D, B, I>.CalculateBinUtilization(bestSolution);
-      if (!results.ContainsKey("Overall Bin Utilization"))
+      if (!results.ContainsKey(binUtilKey))
         results.Add(new Result(binUtilKey, binUtil));
       else
         results[binUtilKey].Value = binUtil;
+
+
+      string nocKey = "Nr Of Containers";
+      if (!results.ContainsKey(nocKey))
+        results.Add(new Result(nocKey, new IntValue (bestSolution.NrOfBins)));
+      else
+        results[nocKey].Value = new IntValue (bestSolution.NrOfBins);
 
       return base.Apply();
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftFunctions.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftFunctions.cs	(revision 9593)
@@ -7,4 +7,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;
@@ -18,6 +19,6 @@
   public static class BottomLeftFunctions {
 
-
-    public static ObservableDictionary<int, TwoDimensionalPacking> BottomLeftPacking(
+    /*
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
       MultiComponentVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
       int nrOfBins = solution.NrOfBins;
@@ -30,5 +31,5 @@
       }
 
-      ObservableDictionary<int, TwoDimensionalPacking> packingPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
+      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
       var remainingItems = new List<PackingInformation>();
 
@@ -42,14 +43,14 @@
           TwoDimensionalPacking position = null;
 
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures, unpackedItems[i].Rotated);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
 
           if (position == null) {
-            position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures, !unpackedItems[i].Rotated);
-          }
-          if (position == null) {
-            remainingItems.Add(unpackedItems[i]);
+            position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, !unpackedItems[i].Rotated);
+          }
+          if (position == null) {  
+            remainingItems.Add(unpackedItems[i]);     
+            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
           } else {
-            packingPositions[itemIndex] = position;
-            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
+            itemPositions[itemIndex] = position;
             solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
           }
@@ -67,11 +68,11 @@
 
           //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures, unpackedItems[i].Rotated);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
 
           if (position == null) {
-            position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures, !unpackedItems[i].Rotated);
+            position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, !unpackedItems[i].Rotated);
           }
           if (position != null) {
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
             remainingItems.Remove(unpackedItems[i]);
             solution.PackingInformations[binNr].Add(unpackedItems[i]);
@@ -85,8 +86,8 @@
       }
 
-      return packingPositions;
-    }
-
-    public static ObservableDictionary<int, TwoDimensionalPacking> BottomLeftPacking(
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
       GroupingVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
 
@@ -104,5 +105,5 @@
       }
 
-      ObservableDictionary<int, TwoDimensionalPacking> packingPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
+      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
       var remainingItems = new List<int>();
 
@@ -117,5 +118,5 @@
 
           //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
 
           //Did not find enough space in current bin
@@ -123,5 +124,5 @@
             remainingItems.Add(itemIndex);
           } else
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
         }
       }
@@ -137,8 +138,8 @@
 
           //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
 
           if (position != null) {
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
             remainingItems.Remove(itemIndex);
             solution.GroupingVector[itemIndex] = binNr;
@@ -150,11 +151,11 @@
       }
 
-      return packingPositions;
-    }
-
-    public static ObservableDictionary<int, TwoDimensionalPacking> BottomLeftPacking(
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
       PackingSequenceEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
 
-      ObservableDictionary<int, TwoDimensionalPacking> packingPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
+      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
       int nrOfBins = 1;
       for (int i = 0; i < solution.PackingSequence.Length; i++) {
@@ -163,5 +164,5 @@
         //Look for space in existing bins
         for (int binNr = 0; binNr < nrOfBins; binNr++) {
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
           if (position != null)
             break;
@@ -170,5 +171,5 @@
         if (position == null) {
           nrOfBins++;
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, nrOfBins - 1, item, packingPositions, itemMeasures);
+          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, nrOfBins - 1, item, itemPositions, itemMeasures);
         }
 
@@ -176,14 +177,15 @@
           position = new TwoDimensionalPacking(-1, 0, 0);
 
-        packingPositions[solution.PackingSequence[i]] = position;
-      }
-
-      return packingPositions;
-    }
-
-    private static TwoDimensionalPacking BottomLeftPosition(RectangularPackingBin binMeasures, int binNr, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures) {
+        itemPositions[solution.PackingSequence[i]] = position;
+      }
+
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+    */
+    public static TwoDimensionalPacking BottomLeftPosition(RectangularPackingBin binMeasures, int binNr, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures) {
       return BottomLeftPosition(binMeasures, binNr, currentItem, itemPositions, itemMeasures, false);
     }
-    private static TwoDimensionalPacking BottomLeftPosition(RectangularPackingBin binMeasures, int binNr, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures, bool rotated) {      
+    public static TwoDimensionalPacking BottomLeftPosition(RectangularPackingBin binMeasures, int binNr, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures, bool rotated) {      
       TwoDimensionalPacking currentPosition = new TwoDimensionalPacking(binNr, 
         binMeasures.Width - (rotated ? currentItem.Height : currentItem.Width), 
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftGroupingVectorDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftGroupingVectorDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftGroupingVectorDecoder.cs	(revision 9593)
@@ -66,7 +66,7 @@
 
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
 
-      result.PackingItemPositions = BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
+      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
       return result;
     }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftMultiComponentVectorDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftMultiComponentVectorDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftMultiComponentVectorDecoder.cs	(revision 9593)
@@ -66,7 +66,7 @@
 
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
-      
-      result.PackingItemPositions = BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
+
+      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftPackingSequenceDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftPackingSequenceDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftPackingSequenceDecoder.cs	(revision 9593)
@@ -65,7 +65,7 @@
 
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
 
-      result.PackingItemPositions = BottomLeftFunctions.BottomLeftPacking (solution, binMeasures, itemMeasures);
+      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointGroupingVectorDecoder2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointGroupingVectorDecoder2D.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointGroupingVectorDecoder2D.cs	(revision 9593)
@@ -60,7 +60,7 @@
     public static PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Decode(GroupingVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
+      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs	(revision 9593)
@@ -61,7 +61,7 @@
     public static PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Decode(MultiComponentVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
+      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointPackingSequenceDecoder2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointPackingSequenceDecoder2D.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointPackingSequenceDecoder2D.cs	(revision 9593)
@@ -64,7 +64,7 @@
 
       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
 
-      result.PackingItemPositions = ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
+      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointsFunctions2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointsFunctions2D.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointsFunctions2D.cs	(revision 9593)
@@ -7,4 +7,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;
@@ -21,5 +22,5 @@
 
 
-    public static ObservableDictionary<int, TwoDimensionalPacking> ExtremePointBasedPacking(MultiComponentVectorEncoding solution, 
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(MultiComponentVectorEncoding solution, 
         ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
 
@@ -98,9 +99,9 @@
       }
 
-      return itemPositions;
-    }
-
-
-    public static ObservableDictionary<int, TwoDimensionalPacking> ExtremePointBasedPacking(GroupingVectorEncoding solution,
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(GroupingVectorEncoding solution,
         ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
 
@@ -180,9 +181,9 @@
       }
 
-      return itemPositions;
-    }
-
-
-    public static ObservableDictionary<int, TwoDimensionalPacking> ExtremePointBasedPacking(PackingSequenceEncoding solution, 
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(PackingSequenceEncoding solution, 
         ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
 
@@ -215,13 +216,13 @@
       }
 
-      return itemPositions;
-    }
-
-
-    private static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures,
+      return BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+
+    public static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures,
         HashSet<TwoDimensionalPacking> extremePoints, List<int[,]> occupiedPoints, ObservableDictionary<int, TwoDimensionalPacking> itemPositions) {
           return FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions, false);
     }
-    private static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures, 
+    public static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures, 
         HashSet<TwoDimensionalPacking> extremePoints, List<int[,]> occupiedPoints, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, bool rotated) {
 
@@ -233,5 +234,6 @@
 
       int epIndex = 0;
-      while (epIndex < extremePoints.Count &&
+      while (epIndex < extremePoints.Count &&       
+        //(!IsPositionFeasible(binMeasures, item, extremePoints.ElementAt(epIndex), occupiedPoints)))
         (!BottomLeftFunctions.IsPositionFeasible(binMeasures, extremePoints.ElementAt(epIndex).AssignedBin, item, extremePoints.ElementAt(epIndex), itemPositions, itemMeasures))) 
       { epIndex++; }
@@ -244,5 +246,5 @@
       return null;
     }
-    private static List<int[,]> IncreaseBinCountForOccupiedPoints(List<int[,]> occupiedPoints, RectangularPackingBin binMeasures) {
+    public static List<int[,]> IncreaseBinCountForOccupiedPoints(List<int[,]> occupiedPoints, RectangularPackingBin binMeasures) {
       occupiedPoints.Add(new int[binMeasures.Width, binMeasures.Height]);
       int lastIndex = occupiedPoints.Count - 1;
@@ -254,5 +256,5 @@
       return occupiedPoints;
     }
-    private static List<int[,]>  OccupyPointsForNewItem(List<int[,]> occupiedPoints, RectangularPackingItem newItem, TwoDimensionalPacking position, int itemIndex) {
+    public static List<int[,]>  OccupyPointsForNewItem(List<int[,]> occupiedPoints, RectangularPackingItem newItem, TwoDimensionalPacking position, int itemIndex) {
       int width = position.Rotated ? newItem.Height : newItem.Width; 
       int height = position.Rotated ? newItem.Width : newItem.Height;
@@ -264,5 +266,5 @@
       return occupiedPoints;
     }
-    private static HashSet<TwoDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<TwoDimensionalPacking> extremePoints, List<int[,]> occupiedPoints, 
+    public static HashSet<TwoDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<TwoDimensionalPacking> extremePoints, List<int[,]> occupiedPoints, 
         RectangularPackingItem newItem, TwoDimensionalPacking position, RectangularPackingBin binMeasures) {
       int currentBin = position.AssignedBin;
@@ -321,4 +323,6 @@
       return shortestSide;
     }
+
+    
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/TwoDimensionalPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/TwoDimensionalPackingFunctions.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/TwoDimensionalPackingFunctions.cs	(revision 9593)
@@ -0,0 +1,196 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
+using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
+using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+using HeuristicLab.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+
+namespace HeuristicLab.Problems.BinPacking.Decoders {
+  public static class TwoDimensionalPackingFunctions {
+    
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
+      MultiComponentVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
+      
+      ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result = 
+        new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+
+      var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+      Dictionary<int, bool> rotated = SequentialPackingFunctions.GenerateRotationArray(solution);
+          
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        result.Add(SequentialPackingFunctions.BottomLeftPacking(ref remainingIDs, binMeasures, itemMeasures, rotated));
+      }
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in result) {  
+          var position = bp.FindPositionBySliding(itemMeasures[id], rotated[id]);
+          if (position != null) {
+            bp.PackItem(id, itemMeasures[id], position);
+            remainingIDs.Remove(id);
+          }
+        }
+      }
+
+      //Put still remaining items in new bins
+      while (remainingIDs.Count > 0) {
+        result.Add(SequentialPackingFunctions.BottomLeftPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      return result;
+    }         
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
+      GroupingVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
+      
+      ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result = 
+        new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+
+      var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+          
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        result.Add(SequentialPackingFunctions.BottomLeftPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in result) {
+          var position = bp.FindPositionBySliding(itemMeasures[id], false);
+          if (position != null) {
+            bp.PackItem(id, itemMeasures[id], position);
+            remainingIDs.Remove(id);
+            break;
+          }
+        }
+      }
+
+      //Put still remaining items in new bins
+      while (remainingIDs.Count > 0) {
+        result.Add(SequentialPackingFunctions.BottomLeftPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      return result;
+    }
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
+      PackingSequenceEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
+
+      ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result = 
+        new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+
+      List<int> remainingIDs = new List<int>(solution.PackingSequence);
+      while (remainingIDs.Count > 0) {
+        result.Add(SequentialPackingFunctions.BottomLeftPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      return result;
+    }
+
+
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(MultiComponentVectorEncoding solution,
+        ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
+
+      ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result =
+        new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+
+      var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+      Dictionary<int, bool> rotated = SequentialPackingFunctions.GenerateRotationArray(solution);
+
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, rotated));
+      }
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in result) {
+          var position = bp.FindExtremePointForItem(itemMeasures[id], rotated[id], false);
+          if (position != null) {
+            bp.PackItem(id, itemMeasures[id], position);
+            remainingIDs.Remove(id);
+          }
+        }
+      }
+
+      //Put still remaining items in new bins
+      while (remainingIDs.Count > 0) {
+        result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      return result;
+    }
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(GroupingVectorEncoding solution,
+        ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
+
+      ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result =
+        new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+
+      var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in result) {
+          var position = bp.FindExtremePointForItem(itemMeasures[id], false, false);
+          if (position != null) {
+            bp.PackItem(id, itemMeasures[id], position);
+            remainingIDs.Remove(id);
+            break;
+          }
+        }
+      }
+
+      //Put still remaining items in new bins
+      while (remainingIDs.Count > 0) {
+        result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures));
+      }
+
+      return result;
+    }         
+
+    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(PackingSequenceEncoding solution,
+        ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {  
+
+     ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> result = 
+       new ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>>();
+                                 
+
+     List<int> remainingIDs = new List<int>(solution.PackingSequence);
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures));
+     }    
+ 
+     return result;
+   }
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftFunctions.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftFunctions.cs	(revision 9593)
@@ -7,4 +7,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;
@@ -18,5 +19,5 @@
   public static class DeepestBottomLeftFunctions {
 
-    public static ObservableDictionary<int, ThreeDimensionalPacking> DeepestLeftBottomPacking(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
       int nrOfBins = solution.NrOfBins;
 
@@ -28,5 +29,5 @@
       }
 
-      ObservableDictionary<int, ThreeDimensionalPacking> packingPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
+      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
       var remainingItems = new List<PackingInformation>();
 
@@ -40,8 +41,8 @@
           ThreeDimensionalPacking position = null;
 
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures, unpackedItems[i].Rotated);
-
-          if (position == null) {
-            position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures, !unpackedItems[i].Rotated);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
+
+          if (position == null) {
+            position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures, !unpackedItems[i].Rotated);
           }
           if (position == null) {
@@ -49,5 +50,5 @@
             solution.PackingInformations[binNr].Remove(unpackedItems[i]);
           } else {
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
             solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
           }
@@ -65,11 +66,11 @@
 
           //Look for space in current bin
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures, unpackedItems[i].Rotated);
-
-          if (position == null) {
-            position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures, !unpackedItems[i].Rotated);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
+
+          if (position == null) {
+            position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures, !unpackedItems[i].Rotated);
           }
           if (position != null) {
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
             remainingItems.Remove(unpackedItems[i]);
             solution.PackingInformations[binNr].Add(unpackedItems[i]);
@@ -83,8 +84,8 @@
       }
 
-      return packingPositions;
-    }
-
-    public static ObservableDictionary<int, ThreeDimensionalPacking> DeepestLeftBottomPacking(GroupingVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(GroupingVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
       int nrOfBins = solution.GroupingVector.Max() + 1;
 
@@ -100,5 +101,5 @@
       }
 
-      ObservableDictionary<int, ThreeDimensionalPacking> packingPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
+      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
       var remainingItems = new List<int>();
 
@@ -112,10 +113,10 @@
           ThreeDimensionalPacking position = null;
 
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
 
           if (position == null) {
             remainingItems.Add(itemIndex);
           } else
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
         }
       }
@@ -131,8 +132,8 @@
 
           //Look for space in current bin
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
 
           if (position != null) {
-            packingPositions[itemIndex] = position;
+            itemPositions[itemIndex] = position;
             remainingItems.Remove(itemIndex);
             //solution.GroupingVector[itemIndex] = binNr;
@@ -144,9 +145,9 @@
       }
 
-      return packingPositions;
-    }
-
-    public static ObservableDictionary<int, ThreeDimensionalPacking> DeepestLeftBottomPacking(PackingSequenceEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-      ObservableDictionary<int, ThreeDimensionalPacking> packingPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
+    }
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(PackingSequenceEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
       int nrOfBins = 1;
       for (int i = 0; i < solution.PackingSequence.Length; i++) {
@@ -155,5 +156,5 @@
         //Look for space in existing bins
         for (int binNr = 0; binNr < nrOfBins; binNr++) {
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, packingPositions, itemMeasures);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
           if (position != null)
             break;
@@ -162,5 +163,5 @@
         if (position == null) {
           nrOfBins++;
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, nrOfBins - 1, item, packingPositions, itemMeasures);
+          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, nrOfBins - 1, item, itemPositions, itemMeasures);
         }
 
@@ -168,8 +169,8 @@
           position = new ThreeDimensionalPacking(-1, 0, 0, 0);
 
-        packingPositions[solution.PackingSequence[i]] = position;
-      }
-
-      return packingPositions;
+        itemPositions[solution.PackingSequence[i]] = position;
+      }
+
+      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
     }
 
@@ -204,4 +205,6 @@
     }
 
+    
+
     public static bool IsPositionFeasible(CuboidPackingBin binMeasures, int binNr, CuboidPackingItem currentItem,
       ThreeDimensionalPacking currentPosition, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, ItemList<CuboidPackingItem> itemMeasures) {
@@ -233,6 +236,4 @@
     }
 
-
-  
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftGroupingVectorDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftGroupingVectorDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftGroupingVectorDecoder.cs	(revision 9593)
@@ -64,14 +64,7 @@
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
 
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(
-        binMeasures, itemMeasures);
+      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
 
-      ObservableDictionary<int, ThreeDimensionalPacking> packingPositions = DeepestBottomLeftFunctions.DeepestLeftBottomPacking(
-        solution, 
-        binMeasures, 
-        itemMeasures);
-
-
-      result.PackingItemPositions = packingPositions;
+      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftMultiComponentVectorDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftMultiComponentVectorDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftMultiComponentVectorDecoder.cs	(revision 9593)
@@ -66,7 +66,7 @@
 
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
-      
-      result.PackingItemPositions = DeepestBottomLeftFunctions.DeepestLeftBottomPacking (solution, binMeasures, itemMeasures);
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
+
+      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
 
       return result;
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftPackingSequenceDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftPackingSequenceDecoder.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftPackingSequenceDecoder.cs	(revision 9593)
@@ -65,7 +65,7 @@
 
       PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
+        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
 
-      result.PackingItemPositions = DeepestBottomLeftFunctions.DeepestLeftBottomPacking (solution, binMeasures, itemMeasures);
+      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
 
       return result;
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 9592)
+++ /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 9592)
+++ /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 9592)
+++ /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 9592)
+++ /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 9592)
+++ /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;
     }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/ThreeDimensionalPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/ThreeDimensionalPackingFunctions.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/ThreeDimensionalPackingFunctions.cs	(revision 9593)
@@ -0,0 +1,205 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
+using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
+using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+using HeuristicLab.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+
+namespace HeuristicLab.Problems.BinPacking.Decoders {
+  public static class ThreeDimensionalPackingFunctions {
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(
+     MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+
+       ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+     var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+     Dictionary<int, bool> rotated = SequentialPackingFunctions.GenerateRotationArray(solution);
+          
+     //Fill bins according to grouping vector
+     List<int> remainingIDs = new List<int>();
+     foreach (var sequence in sequenceMatrix) {
+       remainingIDs = remainingIDs.Concat(sequence).ToList();
+       result.Add(SequentialPackingFunctions.DeepestLeftBottomPacking(ref remainingIDs, binMeasures, itemMeasures, rotated));
+     }
+
+     //Try to put remaining items in existing bins
+     var temp = new List<int>(remainingIDs);
+     foreach (int id in temp) {
+       foreach (var bp in result) {
+         var position = bp.FindPositionBySliding(itemMeasures[id], rotated[id]);
+         if (position != null) {
+           bp.PackItem(id, itemMeasures[id], position);
+           remainingIDs.Remove(id);
+         }
+       }
+     }
+
+     //Put still remaining items in new bins
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.DeepestLeftBottomPacking(ref remainingIDs, binMeasures, itemMeasures));
+     }
+
+     return result;
+   }
+
+    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(
+     GroupingVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+
+       ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+     var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+          
+     //Fill bins according to grouping vector
+     List<int> remainingIDs = new List<int>();
+     foreach (var sequence in sequenceMatrix) {
+       remainingIDs = remainingIDs.Concat(sequence).ToList();
+       result.Add(SequentialPackingFunctions.DeepestLeftBottomPacking(ref remainingIDs, binMeasures, itemMeasures));
+     }
+
+     //Try to put remaining items in existing bins
+     var temp = new List<int>(remainingIDs);
+     foreach (int id in temp) {
+       foreach (var bp in result) {
+         var position = bp.FindPositionBySliding(itemMeasures[id], false);
+         if (position != null) {
+           bp.PackItem(id, itemMeasures[id], position);
+           remainingIDs.Remove(id);
+         }
+       }
+     }
+
+     //Put still remaining items in new bins
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.DeepestLeftBottomPacking(ref remainingIDs, binMeasures, itemMeasures));
+     }
+
+     return result;
+   }
+
+   public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(
+     PackingSequenceEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+
+       ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+     List<int> remainingIDs = new List<int>(solution.PackingSequence);
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.DeepestLeftBottomPacking(ref remainingIDs, binMeasures, itemMeasures));
+     }
+
+     return result;
+   }
+
+
+
+
+   public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(
+     MultiComponentVectorEncoding solution, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
+
+     ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+     var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+     Dictionary<int, bool> rotated = SequentialPackingFunctions.GenerateRotationArray(solution);
+
+     //Fill bins according to grouping vector
+     List<int> remainingIDs = new List<int>();
+     foreach (var sequence in sequenceMatrix) {
+       remainingIDs = remainingIDs.Concat(sequence).ToList();
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, stackingConstraints, rotated));
+     }
+
+     result = new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(x => x.PackingDensity));
+
+     //Try to put remaining items in existing bins
+     var temp = new List<int>(remainingIDs);
+     foreach (int id in temp) {
+       foreach (var bp in result) {
+         var position = bp.FindExtremePointForItem(itemMeasures[id], rotated[id], stackingConstraints);
+         if (position != null) {
+           bp.PackItem(id, itemMeasures[id], position);
+           remainingIDs.Remove(id);
+         }
+       }
+     }
+
+     //Put still remaining items in new bins
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, stackingConstraints));
+     }
+            
+      result.RemoveAll(x => x.ItemPositions.Count == 0);
+      return new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(x => x.PackingDensity));
+   }
+
+   public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(
+     GroupingVectorEncoding solution, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
+
+     ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+     var sequenceMatrix = SequentialPackingFunctions.GenerateSequenceMatrix(solution);
+
+     //Fill bins according to grouping vector
+     List<int> remainingIDs = new List<int>();
+     foreach (var sequence in sequenceMatrix) {
+       remainingIDs = remainingIDs.Concat(sequence).ToList();
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, stackingConstraints));
+     }
+
+     result = new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(x => x.PackingDensity));
+
+     //Try to put remaining items in existing bins
+     var temp = new List<int>(remainingIDs);
+     foreach (int id in temp) {
+       foreach (var bp in result) {
+         var position = bp.FindExtremePointForItem(itemMeasures[id], false, stackingConstraints);
+         if (position != null) {
+           bp.PackItem(id, itemMeasures[id], position);
+           remainingIDs.Remove(id);
+           break;
+         }
+       }
+     }
+
+     //Put still remaining items in new bins
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, stackingConstraints));
+     }
+
+     result.RemoveAll(x => x.ItemPositions.Count == 0);
+     return new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(x => x.PackingDensity));
+   }
+
+   public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(
+     PackingSequenceEncoding solution, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
+
+     ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> result =
+       new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>();
+
+
+     List<int> remainingIDs = new List<int>(solution.PackingSequence);
+     while (remainingIDs.Count > 0) {
+       result.Add(SequentialPackingFunctions.ExtremePointBasedPacking(ref remainingIDs, binMeasures, itemMeasures, stackingConstraints));
+     }
+
+     result.RemoveAll(x => x.ItemPositions.Count == 0);
+     return new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(x => x.PackingDensity));
+   }
+
+    
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/SequentialPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/SequentialPackingFunctions.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/SequentialPackingFunctions.cs	(revision 9593)
@@ -0,0 +1,564 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
+using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
+using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+using HeuristicLab.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+
+namespace HeuristicLab.Problems.BinPacking.Decoders {
+  public static class SequentialPackingFunctions {     
+
+
+
+    public static List<List<int>> GenerateSequenceMatrix(GroupingVectorEncoding gv) {
+      List<List<int>> result = new List<List<int>> ();
+      int nrOfBins = gv.GroupingVector.Max() + 1;
+      for (int i = 0; i < nrOfBins; i++)
+        result.Add (new List<int>());
+      for (int i = 0; i < gv.GroupingVector.Length; i++ ) {
+        result[gv.GroupingVector[i]].Add(i);
+      }
+      return result;
+    }
+    public static List<List<int>> GenerateSequenceMatrix(MultiComponentVectorEncoding mcv) {
+      List<List<int>> result = new List<List<int>>();
+      foreach (var bi in mcv.PackingInformations){
+        var temp = new List<int>();
+        foreach (var piEntry in bi.Value) {
+          temp.Add(piEntry.ItemID);
+        }
+        result.Add(temp);
+      }
+      return result;
+    }
+    public static Dictionary<int, bool> GenerateRotationArray(MultiComponentVectorEncoding solution) {
+      Dictionary<int, bool> result = new Dictionary<int, bool>();
+      foreach (var bi in solution.PackingInformations)
+        foreach (var pi in bi.Value)
+          result[pi.ItemID] = pi.Rotated;
+      return result;
+    }
+
+
+
+
+
+    public static BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> BottomLeftPacking(
+      ref List<int> sequence,  RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
+      BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = new BinPacking2D(binMeasures);
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        TwoDimensionalPacking position = result.FindPositionBySliding(item, false);
+        if (position != null) {
+          result.PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+      return result;
+    }
+    public static BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> BottomLeftPacking(
+      ref List<int> sequence, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures, Dictionary<int,bool> rotationArray) {
+      BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = new BinPacking2D(binMeasures);
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        TwoDimensionalPacking position = result.FindPositionBySliding(item, rotationArray[temp[i]]);
+        if (position != null) {
+          result.PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+      return result;
+    }
+
+    public static BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> DeepestLeftBottomPacking(
+      ref List<int> sequence, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
+      BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new BinPacking3D(binMeasures);
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        ThreeDimensionalPacking position = result.FindPositionBySliding(item, false);
+        
+        if (position != null) {
+          result.PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+      return result;
+    }
+    public static BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> DeepestLeftBottomPacking(
+      ref List<int> sequence, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, Dictionary<int, bool> rotationArray) {
+      BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new BinPacking3D(binMeasures);
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        ThreeDimensionalPacking position = result.FindPositionBySliding(item, rotationArray[i]);
+
+        if (position != null) {
+          result.PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+      return result;
+    }
+        
+    public static BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> ExtremePointBasedPacking(
+      ref List<int> sequence, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {  
+      BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = new BinPacking2D(binMeasures);
+      
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = result.FindExtremePointForItem(item, false, false);
+        if (positionFound != null) {
+          result.PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        } 
+      }
+
+      return result;
+    }
+    public static BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> ExtremePointBasedPacking(
+      ref List<int> sequence, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures, Dictionary<int, bool> rotationArray) {
+      BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = new BinPacking2D(binMeasures);
+
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = result.FindExtremePointForItem(item, rotationArray[itemID], false);
+        if (positionFound != null) {
+          result.PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+
+      return result;
+    }
+
+    public static BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> ExtremePointBasedPacking(
+      ref List<int> sequence, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints) {
+      BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new BinPacking3D(binMeasures);
+
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = result.FindExtremePointForItem(item, false, stackingConstraints);
+        if (positionFound != null) {
+          result.PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+
+      return result;
+    }
+    public static BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> ExtremePointBasedPacking(
+      ref List<int> sequence, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints, Dictionary<int, bool> rotationArray) {
+      BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new BinPacking3D(binMeasures);
+
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = result.FindExtremePointForItem(item, rotationArray[itemID], stackingConstraints);
+        if (positionFound != null) {
+          result.PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+
+      return result;
+    }
+
+
+
+
+
+
+         
+             /*
+
+    public static TwoDimensionalPacking BottomLeftPosition(RectangularPackingBin binMeasures, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures, bool rotated) {
+      TwoDimensionalPacking currentPosition = new TwoDimensionalPacking(0,
+        binMeasures.Width - (rotated ? currentItem.Height : currentItem.Width),
+        binMeasures.Height - (rotated ? currentItem.Width : currentItem.Height), rotated);
+      //Slide the item as far as possible to the left
+      while (IsPositionFeasible(binMeasures, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
+        || IsPositionFeasible(binMeasures, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)) {
+        //Slide the item as far as possible to the bottom
+        while (IsPositionFeasible(binMeasures, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)) {
+          currentPosition = MoveDown(currentPosition);
+        }
+        if (IsPositionFeasible(binMeasures, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures))
+          currentPosition = MoveLeft(currentPosition);
+      }
+
+      return IsPositionFeasible(binMeasures, currentItem, currentPosition, itemPositions, itemMeasures) ? currentPosition : null;
+    }
+    private static TwoDimensionalPacking MoveLeft(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Rotated);
+    }
+    private static TwoDimensionalPacking MoveDown(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Rotated);
+    }
+   
+
+    private static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures,
+        HashSet<TwoDimensionalPacking> extremePoints, int[,] occupiedPoints, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, bool rotated) {
+
+      var itemFromList = itemMeasures[itemIndex];
+      RectangularPackingItem item = new RectangularPackingItem(
+        rotated ? itemFromList.Height : itemFromList.Width,
+        rotated ? itemFromList.Width : itemFromList.Height,
+        itemFromList.TargetBin);
+
+      int epIndex = 0;
+      while (epIndex < extremePoints.Count &&
+        (!IsPositionFeasible(binMeasures, item, extremePoints.ElementAt(epIndex), occupiedPoints)))
+        //(!BottomLeftFunctions.IsPositionFeasible(binMeasures, extremePoints.ElementAt(epIndex).AssignedBin, item, extremePoints.ElementAt(epIndex), itemPositions, itemMeasures))) 
+        { epIndex++; }
+
+      if (epIndex < extremePoints.Count) {
+        var result = extremePoints.ElementAt(epIndex);
+        result.Rotated = rotated;
+        return result;
+      }
+      return null;
+    }
+    private static HashSet<TwoDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<TwoDimensionalPacking> extremePoints, int[,] occupiedPoints,
+        RectangularPackingItem newItem, TwoDimensionalPacking position, RectangularPackingBin binMeasures) {
+
+      int newWidth = position.Rotated ? newItem.Height : newItem.Width;
+      int newHeight = position.Rotated ? newItem.Width : newItem.Height;
+
+      //Find ExtremePoints beginning from sourcepointX
+      var sourcePointX = new TwoDimensionalPacking(0, position.X + newWidth, position.Y);
+      if (sourcePointX.X < binMeasures.Width && sourcePointX.Y < binMeasures.Height) {
+        //Traversing down the y-axis                                                                            
+        int currentYValue = sourcePointX.Y;
+        while (currentYValue > 0 && occupiedPoints[sourcePointX.X, currentYValue] == -1) {
+          currentYValue--;
+        }
+        extremePoints.Add(new TwoDimensionalPacking(0, sourcePointX.X, currentYValue));
+      }
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointY
+      var sourcePointY = new TwoDimensionalPacking(0, position.X, position.Y + newItem.Height);
+      if (sourcePointY.X < binMeasures.Width && sourcePointY.Y < binMeasures.Height) {
+        //Traversing down the x-axis  
+        int currentXValue = sourcePointY.X;
+        while (currentXValue > 0 && occupiedPoints[currentXValue - 1, sourcePointY.Y] == -1) {
+          currentXValue--;
+        }
+        extremePoints.Add(new TwoDimensionalPacking(0, currentXValue, sourcePointY.Y));
+      }
+
+
+      return extremePoints;
+    }
+    private static HashSet<TwoDimensionalPacking> OrderExtremePoints(HashSet<TwoDimensionalPacking> hashSet, int[,] occupiedPoints, RectangularPackingBin binMeasures) {
+      return new HashSet<TwoDimensionalPacking>(hashSet.OrderBy(ep => ep.AssignedBin).ThenBy(ep => ep.X).ThenBy(ep => ep.Y).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));
+    }
+    private static int ShortestPossibleSideFromEP(TwoDimensionalPacking ep, int[,] occupiedPoints, RectangularPackingBin binMeasures) {
+      int shortestSide = int.MaxValue;
+
+      if (ep.X >= binMeasures.Width || ep.Y >= binMeasures.Height)
+        return shortestSide;
+
+      int currentX = ep.X;
+      while (currentX < binMeasures.Width && occupiedPoints[currentX, ep.Y] == -1) { currentX++; }
+      if (currentX - ep.X < shortestSide)
+        shortestSide = currentX - ep.X;
+
+      int currentY = ep.Y;
+      while (currentY < binMeasures.Height && occupiedPoints[ep.X, currentY] == -1) { currentY++; }
+      if (currentY - ep.Y < shortestSide)
+        shortestSide = currentY - ep.Y;
+
+      return shortestSide;
+    }
+    private static int[,] OccupyPointsForNewItem(int[,] occupiedPoints, RectangularPackingItem newItem, TwoDimensionalPacking position, int itemIndex) {
+      int width = position.Rotated ? newItem.Height : newItem.Width;
+      int height = position.Rotated ? newItem.Width : newItem.Height;
+      for (int w = position.X; w < position.X + width; w++) {
+        for (int h = position.Y; h < position.Y + height; h++) {
+          occupiedPoints[w, h] = itemIndex;
+        }
+      }
+      return occupiedPoints;
+    }
+    private static int[,] GetOccupiedPoints(RectangularPackingBin binMeasures) {
+      var result = new int[binMeasures.Width, binMeasures.Height];
+      for (int w = 0; w < binMeasures.Width; w++) {
+        for (int h = 0; h < binMeasures.Height; h++) {
+            result[w, h] = -1;
+        }
+      }
+      return result;
+    }
+    private static bool IsPositionFeasible(RectangularPackingBin binMeasures, RectangularPackingItem currentItem,
+     TwoDimensionalPacking position, int[,] occupiedPoints) {
+      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
+      if (!binMeasures.Encloses(position, currentItem))
+        return false;
+
+      for (int w = position.X; w < position.X + currentItem.Width; w++) {
+        for (int h = position.Y; h < position.Y + currentItem.Height; h++) {
+          if (occupiedPoints[w, h] != -1)
+            return false;
+        }
+      }
+
+      return true;
+    }
+    private static bool IsPositionFeasible(RectangularPackingBin binMeasures, RectangularPackingItem currentItem,
+      TwoDimensionalPacking currentPosition, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures) {
+      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
+      if (!binMeasures.Encloses(currentPosition, currentItem))
+        return false;
+
+      foreach (var ipEntry in itemPositions) {
+        if (itemMeasures[ipEntry.Key].Overlaps(ipEntry.Value, currentPosition, currentItem))
+          return false;
+      }
+
+      return true;
+    }
+
+                          */
+
+
+
+
+
+
+
+
+     
+
+               /*
+    public static ThreeDimensionalPacking DeepestLeftBottomPosition(CuboidPackingBin binMeasures, CuboidPackingItem currentItem, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, ItemList<CuboidPackingItem> itemMeasures, bool rotated) {
+      //Starting-position at upper right corner (=left bottom point of item-rectangle is at position item.width,item.height)
+      ThreeDimensionalPacking currentPosition = new ThreeDimensionalPacking(0,
+        binMeasures.Width - (rotated ? currentItem.Depth : currentItem.Width),
+        binMeasures.Height - currentItem.Height,
+        binMeasures.Depth - (rotated ? currentItem.Width : currentItem.Depth), rotated);
+      //Slide the item as far as possible to the bottom
+      while (IsPositionFeasible(binMeasures, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)
+        || IsPositionFeasible(binMeasures, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
+        || IsPositionFeasible(binMeasures, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
+        //Slide the item as far as possible to the left
+        while (IsPositionFeasible(binMeasures, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
+        || IsPositionFeasible(binMeasures, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
+          //Slide the item as far as possible to the back
+          while (IsPositionFeasible(binMeasures, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
+            currentPosition = MoveBack(currentPosition);
+          }
+          if (IsPositionFeasible(binMeasures, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures))
+            currentPosition = MoveLeft(currentPosition);
+        }
+        if (IsPositionFeasible(binMeasures, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures))
+          currentPosition = MoveDown(currentPosition);
+      }
+
+      return IsPositionFeasible(binMeasures, currentItem, currentPosition, itemPositions, itemMeasures) ? currentPosition : null;
+    }
+    private static ThreeDimensionalPacking MoveLeft(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Z, original.Rotated);
+    }
+    private static ThreeDimensionalPacking MoveDown(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Z, original.Rotated);
+    }
+    private static ThreeDimensionalPacking MoveBack(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z - 1, original.Rotated);
+    }
+  
+    private static ThreeDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures,
+        HashSet<ThreeDimensionalPacking> extremePoints, 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 && !ExtremePointsFunctions3D.IsStaticStable(occupiedPoints, item, extremePoints.ElementAt(epIndex))) 
+        )){ epIndex++; }
+
+      if (epIndex < extremePoints.Count) {
+        var result = extremePoints.ElementAt(epIndex);
+        result.Rotated = rotated;
+        return result;
+      }
+      return null;
+    }
+    private static HashSet<ThreeDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<ThreeDimensionalPacking> extremePoints, int[, ,] occupiedPoints,
+        CuboidPackingItem newItem, ThreeDimensionalPacking position, CuboidPackingBin binMeasures) {
+
+      int newWidth = position.Rotated ? newItem.Depth : newItem.Width;
+      int newDepth = position.Rotated ? newItem.Width : newItem.Depth;
+
+      //Find ExtremePoints beginning from sourcepointX
+      var sourcePointX = new ThreeDimensionalPacking(0, position.X + newWidth, position.Y, position.Z);
+      if (sourcePointX.X < binMeasures.Width && sourcePointX.Y < binMeasures.Height && sourcePointX.Z < binMeasures.Depth) {
+        //Traversing down the y-axis                                                                            
+        int currentYValue = sourcePointX.Y;
+        while (currentYValue > 0 && occupiedPoints[sourcePointX.X, currentYValue, sourcePointX.Z] == -1) {
+          currentYValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, sourcePointX.X, currentYValue, sourcePointX.Z));
+
+        //Traversing down the z-axis
+        int currentZValue = sourcePointX.Z;
+        while (currentZValue > 0 && occupiedPoints[sourcePointX.X, sourcePointX.Y, currentZValue - 1] == -1) {
+          currentZValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, sourcePointX.X, sourcePointX.Y, currentZValue));
+      }
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointY
+      var sourcePointY = new ThreeDimensionalPacking(0, position.X, position.Y + newItem.Height, position.Z);
+      if (sourcePointY.X < binMeasures.Width && sourcePointY.Y < binMeasures.Height && sourcePointY.Z < binMeasures.Depth) {
+        //Traversing down the x-axis  
+        int currentXValue = sourcePointY.X;
+        while (currentXValue > 0 && occupiedPoints[currentXValue - 1, sourcePointY.Y, sourcePointY.Z] == -1) {
+          currentXValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, currentXValue, sourcePointY.Y, sourcePointY.Z));
+
+        //Traversing down the z-axis
+        int currentZValue = sourcePointY.Z;
+        while (currentZValue > 0 && occupiedPoints[sourcePointY.X, sourcePointY.Y, currentZValue - 1] == -1) {
+          currentZValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, sourcePointY.X, sourcePointY.Y, currentZValue));
+      }
+
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointZ
+      var sourcePointZ = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z + newDepth);
+      if (sourcePointZ.X < binMeasures.Width && sourcePointZ.Y < binMeasures.Height && sourcePointZ.Z < binMeasures.Depth) {
+        //Traversing down the x-axis  
+        int currentXValue = sourcePointZ.X;
+        while (currentXValue > 0 && occupiedPoints[currentXValue - 1, sourcePointZ.Y, sourcePointZ.Z] == -1) {
+          currentXValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, currentXValue, sourcePointZ.Y, sourcePointZ.Z));
+
+        //Traversing down the y-axis                                                                            
+        int currentYValue = sourcePointZ.Y;
+        while (currentYValue > 0 && occupiedPoints[sourcePointZ.X, currentYValue, sourcePointZ.Z] == -1) {
+          currentYValue--;
+        }
+        extremePoints.Add(new ThreeDimensionalPacking(0, sourcePointZ.X, currentYValue, sourcePointZ.Z));
+      }
+
+
+      return extremePoints;
+    }
+    private static HashSet<ThreeDimensionalPacking> OrderExtremePoints(HashSet<ThreeDimensionalPacking> hashSet, int[, ,] occupiedPoints, CuboidPackingBin binMeasures) {
+      return new HashSet<ThreeDimensionalPacking>(hashSet.OrderBy(ep => ep.AssignedBin).ThenBy(ep => ep.Z).ThenBy(ep => ep.X).ThenBy(ep => ep.Y).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));
+    }
+    private static int ShortestPossibleSideFromEP(ThreeDimensionalPacking ep, int[, ,] occupiedPoints, CuboidPackingBin binMeasures) {
+      int shortestSide = int.MaxValue;
+
+      if (ep.X >= binMeasures.Width || ep.Y >= binMeasures.Height || ep.Z >= binMeasures.Depth)
+        return shortestSide;
+
+      int currentX = ep.X;
+      while (currentX < binMeasures.Width && occupiedPoints[currentX, ep.Y, ep.Z] == -1) { currentX++; }
+      if (currentX - ep.X < shortestSide)
+        shortestSide = currentX - ep.X;
+
+      int currentY = ep.Y;
+      while (currentY < binMeasures.Height && occupiedPoints[ep.X, currentY, ep.Z] == -1) { currentY++; }
+      if (currentY - ep.Y < shortestSide)
+        shortestSide = currentY - ep.Y;
+
+      int currentZ = ep.Z;
+      while (currentZ < binMeasures.Depth && occupiedPoints[ep.X, ep.Y, currentZ] == -1) { currentZ++; }
+      if (currentZ - ep.Z < shortestSide)
+        shortestSide = currentZ - ep.Z;
+
+      return shortestSide;
+    }
+    private static int[, ,] OccupyPointsForNewItem(int[, ,] occupiedPoints, CuboidPackingItem newItem, ThreeDimensionalPacking position, int itemIndex) {
+      int width = position.Rotated ? newItem.Depth : newItem.Width;
+      int depth = position.Rotated ? newItem.Width : newItem.Depth;
+      for (int w = position.X; w < position.X + width; w++) {
+        for (int h = position.Y; h < position.Y + newItem.Height; h++) {
+          for (int d = position.Z; d < position.Z + depth; d++) {
+            occupiedPoints[w, h, d] = itemIndex;
+          }
+        }
+      }
+      return occupiedPoints;
+    }
+    private static int[,,] GetOccupiedPoints(CuboidPackingBin binMeasures) {
+      var result = new int[binMeasures.Width, binMeasures.Height, binMeasures.Depth];
+      for (int w = 0; w < binMeasures.Width; w++) {
+        for (int h = 0; h < binMeasures.Height; h++) {
+          for (int d = 0; d < binMeasures.Depth; d++) {
+            result[w, h, d] = -1;
+          }
+        }
+      }
+      return result;
+    }
+    private static bool IsPositionFeasible(CuboidPackingBin binMeasures, CuboidPackingItem currentItem,
+      ThreeDimensionalPacking position, int[, ,] occupiedPoints) {
+      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
+      if (!binMeasures.Encloses(position, currentItem))
+        return false;
+
+      for (int w = position.X; w < position.X + currentItem.Width; w++) {
+        for (int h = position.Y; h < position.Y + currentItem.Height; h++) {
+          for (int d = position.Z; d < position.Z + currentItem.Depth; d++) {
+            if (occupiedPoints[w, h, d] != -1)
+              return false;
+          }
+        }
+      }
+
+      return true;
+    }
+    private static bool IsPositionFeasible(CuboidPackingBin binMeasures, CuboidPackingItem currentItem,
+      ThreeDimensionalPacking currentPosition, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, ItemList<CuboidPackingItem> itemMeasures) {
+      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
+      if (!binMeasures.Encloses(currentPosition, currentItem))
+        return false;
+
+      foreach (var ipEntry in itemPositions) {
+        if (itemMeasures[ipEntry.Key].Overlaps(ipEntry.Value, currentPosition, currentItem))
+          return false;
+      }
+
+      return true;
+    }
+                */
+    
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints.cs	(revision 9593)
@@ -0,0 +1,55 @@
+﻿#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 System.Text;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.BinPacking.Shapes;
+
+namespace HeuristicLab.Problems.BinPacking.Dimensions {
+  [Item("Occupated Points", "A datastructure holding all currently occupied points of a packing-bin.")]
+  [StorableClass]
+  public abstract class OccupiedPoints<D, I> : Item
+    where D : class, IPackingDimensions
+    where I : PackingShape<D>, IPackingItem {
+
+    public OccupiedPoints() : base() { }
+    [StorableConstructor]
+    protected OccupiedPoints(bool deserializing) : base(deserializing) { }
+    protected OccupiedPoints(OccupiedPoints<D,I> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+
+    public abstract bool IsPositionFeasible(I measures, D position);
+    public abstract void OccupyPoints(I measures, D position, int itemID);
+    public abstract bool IsPointOccupied(D point);
+    public abstract int ShortestPossibleSideFromEP(D ep);
+    public abstract bool IsStaticStable(I item, D ep);
+    public abstract bool WeightIsSupported(I item, D ep, ItemList<I> items);
+  
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs	(revision 9593)
@@ -0,0 +1,114 @@
+﻿#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 System.Text;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.BinPacking.Shapes;
+using HeuristicLab.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+
+namespace HeuristicLab.Problems.BinPacking.Dimensions {
+  [Item("Occupated Points 2D", "A datastructure holding all currently occupied points of a 2D packing-bin.")]
+  [StorableClass]
+  public class OccupiedPoints2D : OccupiedPoints<TwoDimensionalPacking, RectangularPackingItem> {
+                   
+    [Storable]
+    private int[,] occupiedPoints { get; set; }
+
+    public OccupiedPoints2D(RectangularPackingBin binMeasures) : base() {
+      occupiedPoints = new int[binMeasures.Width, binMeasures.Height];
+      for (int w = 0; w < binMeasures.Width; w++) {
+        for (int h = 0; h < binMeasures.Height; h++) {
+          occupiedPoints[w, h] = -1;
+        }
+      }
+    }
+    [StorableConstructor]
+    protected OccupiedPoints2D(bool deserializing) : base(deserializing) { }
+    protected OccupiedPoints2D(OccupiedPoints2D original, Cloner cloner)
+      : base(original, cloner) {
+      this.occupiedPoints = (int[,])original.occupiedPoints.Clone();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OccupiedPoints2D(this, cloner);
+    }
+
+    public override bool IsPositionFeasible(RectangularPackingItem measures, TwoDimensionalPacking position) {
+      for (int w = position.X; w < position.X + measures.Width; w++) {
+        for (int h = position.Y; h < position.Y + measures.Height; h++) {
+          if (occupiedPoints[w, h] != -1)
+            return false;
+        }
+      }
+      return true;
+    }
+
+    public override void OccupyPoints(RectangularPackingItem measures, TwoDimensionalPacking position, int itemID) {
+      int width = position.Rotated ? measures.Height : measures.Width;
+      int height = position.Rotated ? measures.Width : measures.Height;
+      for (int w = position.X; w < position.X + width; w++) {
+        for (int h = position.Y; h < position.Y + height; h++) {
+          occupiedPoints[w, h] = itemID;
+        }
+      }
+    }
+
+    public override bool IsPointOccupied(TwoDimensionalPacking point) {
+      return occupiedPoints[point.X, point.Y] != -1;
+    }
+
+    public override int ShortestPossibleSideFromEP(TwoDimensionalPacking ep) {
+      int shortestSide = int.MaxValue;
+      int width = occupiedPoints.GetLength(0);
+      int height = occupiedPoints.GetLength(1);
+
+      if (ep.X >= width || ep.Y >= height)
+        return shortestSide;
+
+      int currentX = ep.X;
+      while (currentX < width && occupiedPoints[currentX, ep.Y] == -1) { currentX++; }
+      if (currentX - ep.X < shortestSide)
+        shortestSide = currentX - ep.X;
+
+      int currentY = ep.Y;
+      while (currentY < height && occupiedPoints[ep.X, currentY] == -1) { currentY++; }
+      if (currentY - ep.Y < shortestSide)
+        shortestSide = currentY - ep.Y;
+
+      return shortestSide;
+    }
+
+    public override bool IsStaticStable(RectangularPackingItem item, TwoDimensionalPacking ep) {
+      //For the current implementation there was no need for stacking-constraints in the 2D-case. 
+      //But it could be interesting for shelf-packing applications!
+      return true;
+    }
+    public override bool WeightIsSupported(RectangularPackingItem item, TwoDimensionalPacking ep, ItemList<RectangularPackingItem> items) {
+      return true;
+    }
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs	(revision 9593)
@@ -0,0 +1,168 @@
+﻿#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 System.Text;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.BinPacking.Shapes;
+using HeuristicLab.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+
+namespace HeuristicLab.Problems.BinPacking.Dimensions {
+  [Item("Occupied Points 3D", "A datastructure holding all currently occupied points of a 3D packing-bin.")]
+  [StorableClass]
+  public class OccupiedPoints3D : OccupiedPoints<ThreeDimensionalPacking, CuboidPackingItem> {
+
+    [Storable]
+    private int[, ,] occupiedPoints { get; set; }
+
+    public OccupiedPoints3D(CuboidPackingBin binMeasures) {
+      occupiedPoints = new int[binMeasures.Width, binMeasures.Height, binMeasures.Depth];
+      for (int w = 0; w < binMeasures.Width; w++) {
+        for (int h = 0; h < binMeasures.Height; h++) {
+          for (int d = 0; d < binMeasures.Depth; d++) {
+            occupiedPoints[w, h, d] = -1;
+          }
+        }
+      }
+    }
+    [StorableConstructor]
+    protected OccupiedPoints3D(bool deserializing) : base(deserializing) { }
+    protected OccupiedPoints3D(OccupiedPoints3D original, Cloner cloner)
+      : base(original, cloner) {
+        this.occupiedPoints = (int[,,])original.occupiedPoints.Clone();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OccupiedPoints3D(this, cloner);
+    }
+
+    public override bool IsPositionFeasible(CuboidPackingItem measures, ThreeDimensionalPacking position) {
+      for (int w = position.X; w < position.X + measures.Width; w++) {
+        for (int h = position.Y; h < position.Y + measures.Height; h++) {
+          for (int d = position.Z; d < position.Z + measures.Depth; d++) {
+            if (occupiedPoints[w, h, d] != -1)
+              return false;
+          }
+        }
+      }
+      return true;
+    }
+
+    public override void OccupyPoints(CuboidPackingItem measures, ThreeDimensionalPacking position, int itemID) {
+      int width = position.Rotated ? measures.Depth : measures.Width;
+      int depth = position.Rotated ? measures.Width : measures.Depth;
+      for (int w = position.X; w < position.X + width; w++) {
+        for (int h = position.Y; h < position.Y + measures.Height; h++) {
+          for (int d = position.Z; d < position.Z + depth; d++) {
+            occupiedPoints[w, h, d] = itemID;
+          }
+        }
+      }
+    }
+
+    public override bool IsPointOccupied(ThreeDimensionalPacking point) {
+      return occupiedPoints[point.X, point.Y, point.Z] != -1;
+    }
+
+    public override int ShortestPossibleSideFromEP(ThreeDimensionalPacking ep) {
+      int shortestSide = int.MaxValue;
+      int width = occupiedPoints.GetLength(0);
+      int height = occupiedPoints.GetLength(1);
+      int depth = occupiedPoints.GetLength(2);
+
+      if (ep.X >= width || ep.Y >= height || ep.Z >= depth)
+        return shortestSide;
+
+      int currentX = ep.X;
+      while (currentX < width && occupiedPoints[currentX, ep.Y, ep.Z] == -1) { currentX++; }
+      if (currentX - ep.X < shortestSide)
+        shortestSide = currentX - ep.X;
+
+      int currentY = ep.Y;
+      while (currentY < height && occupiedPoints[ep.X, currentY, ep.Z] == -1) { currentY++; }
+      if (currentY - ep.Y < shortestSide)
+        shortestSide = currentY - ep.Y;
+
+      int currentZ = ep.Z;
+      while (currentZ < depth && occupiedPoints[ep.X, ep.Y, currentZ] == -1) { currentZ++; }
+      if (currentZ - ep.Z < shortestSide)
+        shortestSide = currentZ - ep.Z;
+
+      return shortestSide;
+    }
+
+
+    public override bool IsStaticStable(CuboidPackingItem item, ThreeDimensionalPacking ep) {
+      //Static stability is given, if item is placed on the ground
+      if (ep.Y == 0)
+        return true;
+
+      if (occupiedPoints[ep.X, ep.Y - 1, ep.Z] != -1
+        && occupiedPoints[ep.X + item.Width - 1, ep.Y - 1, ep.Z] != -1
+        && occupiedPoints[ep.X, ep.Y - 1, ep.Z + item.Depth - 1] != -1
+        && occupiedPoints[ep.X + item.Width - 1, ep.Y - 1, ep.Z + item.Depth - 1] != -1)
+        return true;
+
+      //int groundCount = 0;
+      //for (int x = ep.X; x < ep.X + item.Width - 1; x++) {
+      //  for (int z = ep.Z; z < ep.Z + item.Depth - 1; z++) {
+      //    if (occupiedPoints[x,ep.Y-1, z] != -1)                                                     
+      //      groundCount++;
+      //  }
+      //}
+      //double stableGround = (double)(groundCount) / (double)(item.Width * item.Depth);
+      //if (stableGround > 0.75)
+      //  return true;
+
+      return false;
+    }
+    public override bool WeightIsSupported(CuboidPackingItem item, ThreeDimensionalPacking ep, ItemList<CuboidPackingItem> items) {
+      //Static stability is given, if item is placed on the ground
+      if (ep.Y == 0)
+        return true;
+
+      if (items[occupiedPoints[ep.X, ep.Y - 1, ep.Z]].SupportsStacking(item)
+        && items[occupiedPoints[ep.X + item.Width - 1, ep.Y - 1, ep.Z]].SupportsStacking(item)
+        && items[occupiedPoints[ep.X, ep.Y - 1, ep.Z + item.Depth - 1]].SupportsStacking(item)
+        && items[occupiedPoints[ep.X + item.Width - 1, ep.Y - 1, ep.Z + item.Depth - 1]].SupportsStacking(item))
+        return true;
+
+      //int groundCount = 0;
+      //for (int x = ep.X; x < ep.X + item.Width - 1; x++) {
+      //  for (int z = ep.Z; z < ep.Z + item.Depth - 1; z++) {
+      //    if (occupiedPoints[x,ep.Y-1, z] != -1)                                                     
+      //      groundCount++;
+      //  }
+      //}
+      //double stableGround = (double)(groundCount) / (double)(item.Width * item.Depth);
+      //if (stableGround > 0.75)
+      //  return true;
+
+      return false;
+    }
+  
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorRandomCreator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorRandomCreator.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorRandomCreator.cs	(revision 9593)
@@ -64,5 +64,5 @@
 		public static GroupingVectorEncoding Apply(int items, int lowerBound, IRandom random) {
 			var solution = new GroupingVectorEncoding();
-			solution.GroupingVector = new IntegerVector(items, random, 0, lowerBound + 1);
+      solution.GroupingVector = new IntegerVector(items, random, 0, lowerBound + 1);
 			return solution;
 		}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/Triple/Moves/MCVTripleMove.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/Triple/Moves/MCVTripleMove.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/Triple/Moves/MCVTripleMove.cs	(revision 9593)
@@ -102,5 +102,5 @@
             return true;
         } else {
-          if ((Index == actualAttribute.Index && TargetIndex == actualAttribute.TargetIndex)
+          if ((Index == actualAttribute.Index || TargetIndex == actualAttribute.TargetIndex)
                   && MultiComponentVector.PackingInformations[OldGroup][Index].ItemID == actualAttribute.ItemID
                   //&& Rotation == actualAttribute.Rotation
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorRandomCreator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorRandomCreator.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorRandomCreator.cs	(revision 9593)
@@ -70,7 +70,7 @@
 			var solution = new MultiComponentVectorEncoding();
 			if (sortedSequence)
-				solution.PackingInformations = PackingInformation.CreateDictionaryRandomlyWithSortedSequence(items, lowerBound, random);
+				solution.PackingInformations = PackingInformation.CreateDictionaryRandomlyWithSortedSequence(items, /*lowerBound*/ 1, random);
 			else
-				solution.PackingInformations = PackingInformation.CreateDictionaryRandomly(items, lowerBound, random);
+        solution.PackingInformations = PackingInformation.CreateDictionaryRandomly(items, /*lowerBound*/ 1, random);
 			return solution;
 		}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/SequenceBasedMultiComponentVectorCrossover.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/SequenceBasedMultiComponentVectorCrossover.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/SequenceBasedMultiComponentVectorCrossover.cs	(revision 9593)
@@ -44,5 +44,31 @@
     public override MultiComponentVectorEncoding Cross(IRandom random, MultiComponentVectorEncoding parent1, MultiComponentVectorEncoding parent2) {
       MultiComponentVectorEncoding child = new MultiComponentVectorEncoding ();
-      
+
+      int nrOfItems = parent1.NrOfItems;
+      bool[] itemAlreadyAssigned = new bool[nrOfItems];
+      int nrOfBins = parent1.NrOfBins > parent2.NrOfBins ? parent2.NrOfBins : parent1.NrOfBins;
+      int swappedBin = random.Next(nrOfBins);
+
+      for (int binNr = 0; binNr < nrOfBins; binNr++) {
+
+        var newBin = new ItemList<PackingInformation>();
+        var currentParent = binNr == swappedBin ? parent1 : parent2;
+
+        int nrOfItemsInBin = currentParent.PackingInformations[binNr].Count;
+        for (int i = 0; i < nrOfItemsInBin; i++) {
+          PackingInformation pi = new PackingInformation(currentParent.PackingInformations[binNr][i]);
+          if (!itemAlreadyAssigned[pi.ItemID]) {
+            itemAlreadyAssigned[pi.ItemID] = true;
+            newBin.Add(new PackingInformation(pi));
+          }
+        }
+
+        child.PackingInformations[binNr] = newBin;
+      }
+
+      for (int itemID = 0; itemID < nrOfItems; itemID++) {
+        if (!itemAlreadyAssigned[itemID])
+          child.PackingInformations[0].Add(new PackingInformation(itemID, random.Next(2) == 0 ? true : false));
+      }
 
 
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs	(revision 9593)
@@ -33,4 +33,6 @@
 using HeuristicLab.Data;
 using HeuristicLab.Collections;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.PackingBin;
 
 namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
@@ -45,6 +47,6 @@
     public int NrOfBins {
       get {
-        if (PackingItemPositions != null)
-          return PackingItemPositions.Select(p => p.Value.AssignedBin).Max() + 1;
+        if (BinPackings != null)
+          return BinPackings.Count;
         else return 0;
       }
@@ -52,13 +54,6 @@
 
     [Storable]
-    public ObservableDictionary<int, D> PackingItemPositions { get; set; }
-    [Storable]
-    public ObservableDictionary<int, B> PackingBinMeasures { get; set; }
-
-    [Storable]
-    public ItemList<I> PackingItemMeasures {
-      get;
-      set;
-    }
+    public ObservableList<BinPacking<D, B, I>> BinPackings { get; set; }
+
     [Storable]
     private DoubleValue quality;
@@ -76,14 +71,11 @@
     #endregion
 
-    public PackingPlan(B binMeasures, ItemList<I> itemMeasures)
+    public PackingPlan(B binMeasures)
+      : this(){
+      //this.BinPackings.Add(new BinPacking<D,B,I> ());
+    }
+    public PackingPlan()
       : base() {
-      this.PackingItemMeasures = new ItemList<I> (itemMeasures);
-      this.PackingBinMeasures = new ObservableDictionary<int, B>();
-      this.PackingBinMeasures[0] = binMeasures;
-    }
-    public PackingPlan(ObservableDictionary<int, B> binMeasures, ItemList<I> itemMeasures)
-      : base() {
-      this.PackingItemMeasures = itemMeasures;
-      this.PackingBinMeasures = binMeasures;
+      this.BinPackings = new ObservableList<BinPacking<D, B,I>>();
     }
 
@@ -92,19 +84,10 @@
     protected PackingPlan(PackingPlan<D,B,I> original, Cloner cloner)
       : base(original, cloner) {
-      PackingItemPositions = new ObservableDictionary<int, D>(original.PackingItemPositions);
-      PackingBinMeasures = new ObservableDictionary<int, B>(original.PackingBinMeasures);
-      PackingItemMeasures = original.PackingItemMeasures;
+        this.BinPackings = new ObservableList<BinPacking<D, B, I>>(original.BinPackings);
     }
     public override IDeepCloneable Clone(Cloner cloner) {
       return new PackingPlan<D,B,I>(this, cloner);
     }
-
-    public B GetPackingBinMeasuresForBinNr(int binNr) {
-      if (PackingBinMeasures.ContainsKey(binNr))
-        return PackingBinMeasures[binNr];
-      else
-        return PackingBinMeasures[0];
-    }
-
+         
 
     #region Events
@@ -125,20 +108,350 @@
     }
 
-    public event EventHandler PackingItemPositionChanged;
-    private void OnPackingItemPositionChanged() {
-      var changed = PackingItemPositionChanged;
+    public event EventHandler BinPackingsChanged;
+    private void OnBinPackingsChanged() {
+      var changed = BinPackingsChanged;
       if (changed != null)
         changed(this, EventArgs.Empty);
     }
-    private void RegisterPackingItemPositionEvents() {
-      PackingItemPositions.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(PackingItemPosition_PropertyChanged);
-    }
-    private void DeregisterPackingItemPositionEvents() {
-      PackingItemPositions.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(PackingItemPosition_PropertyChanged);
-    }
-    private void PackingItemPosition_PropertyChanged(object sender, EventArgs e) {
-      OnPackingItemPositionChanged();
+    private void RegisterBinPackingsEvents() {
+      BinPackings.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(BinPackings_PropertyChanged);
+    }
+    private void DeregisterBinPackingsEvents() {
+      BinPackings.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(BinPackings_PropertyChanged);
+    }
+    private void BinPackings_PropertyChanged(object sender, EventArgs e) {
+      OnBinPackingsChanged();
     }
     #endregion
   }
+
+  [Item("BinPacking", "Represents a single-bin packing for a bin-packing problem.")]
+  [StorableClass]
+  public abstract class BinPacking<D,B,I>  : Item
+    where D : class, IPackingDimensions
+    where B : PackingShape<D>, IPackingBin
+    where I : PackingShape<D>, IPackingItem {
+  
+    [Storable]
+    public ObservableDictionary<int, D> ItemPositions { get; private set; }
+
+    [Storable]
+    public B BinMeasures { get; private set; }
+
+    [Storable]
+    public ObservableDictionary<int, I> ItemMeasures { get; private set; }
+
+    [Storable]
+    public HashSet<D> ExtremePoints { get; protected set; }
+
+    [Storable]
+    public OccupiedPoints<D, I> OccupiedPoints { get; protected set; }
+
+    public BinPacking(B binMeasures) : base() {   
+      ItemPositions = new ObservableDictionary<int, D>();
+      ItemMeasures = new ObservableDictionary<int, I>();
+      BinMeasures = (B)binMeasures.Clone();
+      ExtremePoints = new HashSet<D>();
+      ExtremePoints.Add(binMeasures.Origin);
+    }
+
+    [StorableConstructor]
+    protected BinPacking(bool deserializing) : base(deserializing) { }
+    protected BinPacking(BinPacking<D,B,I> original, Cloner cloner)
+      : base(original, cloner) {
+      this.ItemPositions = new ObservableDictionary<int, D>(original.ItemPositions);
+      this.ItemMeasures = new ObservableDictionary<int, I>(original.ItemMeasures);
+        this.BinMeasures = (B)original.BinMeasures.Clone(cloner);
+    }
+   
+
+    protected abstract void GenerateNewExtremePointsForNewItem(I measures, D position);
+    public abstract D FindExtremePointForItem(I measures, bool rotated, bool stackingConstraint);
+    public abstract D FindPositionBySliding(I measures, bool rotated);
+    public void PackItem(int itemID, I measures, D position) {
+      ItemMeasures[itemID] = measures;
+      ItemPositions[itemID] = position;
+      ExtremePoints.Remove(position);
+      GenerateNewExtremePointsForNewItem(measures, position);
+      OccupiedPoints.OccupyPoints(measures, position, itemID);
+    }
+
+
+    public double PackingDensity { 
+      get {
+        double result = 0;
+        foreach (var entry in ItemMeasures)
+          result += entry.Value.MultipliedMeasures;
+        result /= BinMeasures.MultipliedMeasures;
+        return result;
+      }
+    }
+
+    public bool IsPositionFeasible1(I currentItem, D currentPosition) {
+      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
+      if (!BinMeasures.Encloses(currentPosition, currentItem))
+        return false;
+
+      foreach (var ipEntry in ItemPositions) {
+        if (ItemMeasures[ipEntry.Key].Overlaps(ipEntry.Value, currentPosition, currentItem))
+          return false;
+      }
+
+      return true;
+    }
+    public bool IsPositionFeasible(I currentItem, D position) {
+      if (!BinMeasures.Encloses(position, currentItem))
+        return false;
+
+      return OccupiedPoints.IsPositionFeasible (currentItem, position);
+    }
+  }
+
+
+
+
+
+  [Item("BinPacking2D", "Represents a single-bin packing for a 2D bin-packing problem.")]
+  [StorableClass]
+  public class BinPacking2D : BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> {
+
+    public BinPacking2D(RectangularPackingBin binMeasures) : base(binMeasures) {
+      OccupiedPoints = new OccupiedPoints2D(binMeasures);
+    }
+    [StorableConstructor]
+    protected BinPacking2D(bool deserializing) : base(deserializing) { }
+    protected BinPacking2D(BinPacking2D original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BinPacking2D(this, cloner);
+    }
+                      
+    protected override void GenerateNewExtremePointsForNewItem(RectangularPackingItem newItem, TwoDimensionalPacking position) {
+
+      int newWidth = position.Rotated ? newItem.Height : newItem.Width;
+      int newHeight = position.Rotated ? newItem.Width : newItem.Height;
+
+      //Find ExtremePoints beginning from sourcepointX
+      var sourcePointX = new TwoDimensionalPacking(0, position.X + newWidth, position.Y);
+      if (sourcePointX.X < BinMeasures.Width && sourcePointX.Y < BinMeasures.Height) {
+        //Traversing down the y-axis        
+        while (sourcePointX.Y > 0 && !OccupiedPoints.IsPointOccupied(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1))) {
+          sourcePointX.Y--;
+        }
+        ExtremePoints.Add(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y));
+      }
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointY
+      var sourcePointY = new TwoDimensionalPacking(0, position.X, position.Y + newItem.Height);
+      if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height) {
+        //Traversing down the x-axis  
+        while (sourcePointY.X > 0 && !OccupiedPoints.IsPointOccupied(new TwoDimensionalPacking (0,sourcePointY.X - 1, sourcePointY.Y))) {
+          sourcePointY.X--;
+        }
+        ExtremePoints.Add(new TwoDimensionalPacking(0, sourcePointY.X, sourcePointY.Y));
+      }
+
+      ExtremePoints = new HashSet<TwoDimensionalPacking>(ExtremePoints.
+        OrderBy(ep => ep.AssignedBin).
+        ThenBy(ep => ep.X).
+        ThenBy(ep => ep.Y).
+        ThenBy(ep => OccupiedPoints.ShortestPossibleSideFromEP(ep)));
+    }
+
+    public override TwoDimensionalPacking FindExtremePointForItem(RectangularPackingItem measures, bool rotated, bool stackingConstraint) {
+      RectangularPackingItem item = new RectangularPackingItem(
+        rotated ? measures.Height : measures.Width,
+        rotated ? measures.Width : measures.Height,
+        measures.TargetBin);
+
+      int epIndex = 0;
+      while (epIndex < ExtremePoints.Count && (!IsPositionFeasible(item, ExtremePoints.ElementAt(epIndex)))) { epIndex++; }
+
+      if (epIndex < ExtremePoints.Count) {
+        var result = ExtremePoints.ElementAt(epIndex);
+        result.Rotated = rotated;
+        return result;
+      }
+      return null;
+    }
+    public override TwoDimensionalPacking FindPositionBySliding(RectangularPackingItem measures, bool rotated) {
+      TwoDimensionalPacking currentPosition = new TwoDimensionalPacking(0,
+        BinMeasures.Width - (rotated ? measures.Height : measures.Width),
+        BinMeasures.Height - (rotated ? measures.Width : measures.Height), rotated);
+      //Slide the item as far as possible to the left
+      while (IsPositionFeasible(measures, MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, MoveDown(currentPosition))) {
+        //Slide the item as far as possible to the bottom
+        while (IsPositionFeasible(measures, MoveDown(currentPosition))) {
+          currentPosition = MoveDown(currentPosition);
+        }
+        if (IsPositionFeasible(measures, MoveLeft(currentPosition)))
+          currentPosition = MoveLeft(currentPosition);
+      }
+
+      return IsPositionFeasible(measures, currentPosition) ? currentPosition : null;
+    }
+    private static TwoDimensionalPacking MoveLeft(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Rotated);
+    }
+    private static TwoDimensionalPacking MoveDown(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Rotated);
+    }
+  }
+
+
+
+  [Item("BinPacking3D", "Represents a single-bin packing for a 3D bin-packing problem.")]
+  [StorableClass]
+  public class BinPacking3D : BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> {
+
+    
+    public BinPacking3D(CuboidPackingBin binMeasures) : base(binMeasures) {
+      OccupiedPoints = new OccupiedPoints3D(binMeasures);
+    }
+    [StorableConstructor]
+    protected BinPacking3D(bool deserializing) : base(deserializing) { }
+    protected BinPacking3D(BinPacking3D original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BinPacking3D(this, cloner);
+    }
+                                       
+    protected override void GenerateNewExtremePointsForNewItem(CuboidPackingItem newItem, ThreeDimensionalPacking position) {
+      int newWidth = position.Rotated ? newItem.Depth : newItem.Width;
+      int newDepth = position.Rotated ? newItem.Width : newItem.Depth;
+
+      //Find ExtremePoints beginning from sourcepointX
+      var sourcePointX = new ThreeDimensionalPacking(0, position.X + newWidth, position.Y, position.Z);
+      if (sourcePointX.X < BinMeasures.Width && sourcePointX.Y < BinMeasures.Height && sourcePointX.Z < BinMeasures.Depth) {
+        //Traversing down the y-axis                                                                            
+        int currentYValue = sourcePointX.Y;
+        while (currentYValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, sourcePointX.X, currentYValue, sourcePointX.Z))) {
+          currentYValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, sourcePointX.X, currentYValue, sourcePointX.Z));
+
+        //Traversing down the z-axis
+        int currentZValue = sourcePointX.Z;
+        while (currentZValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, sourcePointX.X, sourcePointX.Y, currentZValue - 1))) {
+          currentZValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, sourcePointX.X, sourcePointX.Y, currentZValue));
+      }
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointY
+      var sourcePointY = new ThreeDimensionalPacking(0, position.X, position.Y + newItem.Height, position.Z);
+      if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height && sourcePointY.Z < BinMeasures.Depth) {
+        //Traversing down the x-axis  
+        int currentXValue = sourcePointY.X;
+        while (currentXValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, currentXValue - 1, sourcePointY.Y, sourcePointY.Z))) {
+          currentXValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, currentXValue, sourcePointY.Y, sourcePointY.Z));
+
+        //Traversing down the z-axis
+        int currentZValue = sourcePointY.Z;
+        while (currentZValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, sourcePointY.X, sourcePointY.Y, currentZValue - 1))) {
+          currentZValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, sourcePointY.X, sourcePointY.Y, currentZValue));
+      }
+
+
+
+
+
+      //Find ExtremePoints beginning from sourcepointZ
+      var sourcePointZ = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z + newDepth);
+      if (sourcePointZ.X < BinMeasures.Width && sourcePointZ.Y < BinMeasures.Height && sourcePointZ.Z < BinMeasures.Depth) {
+        //Traversing down the x-axis  
+        int currentXValue = sourcePointZ.X;
+        while (currentXValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, currentXValue - 1, sourcePointZ.Y, sourcePointZ.Z))) {
+          currentXValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, currentXValue, sourcePointZ.Y, sourcePointZ.Z));
+
+        //Traversing down the y-axis                                                                            
+        int currentYValue = sourcePointZ.Y;
+        while (currentYValue > 0 && !OccupiedPoints.IsPointOccupied(new ThreeDimensionalPacking (0, sourcePointZ.X, currentYValue, sourcePointZ.Z))) {
+          currentYValue--;
+        }
+        ExtremePoints.Add(new ThreeDimensionalPacking(0, sourcePointZ.X, currentYValue, sourcePointZ.Z));
+      }
+
+      ExtremePoints = new HashSet<ThreeDimensionalPacking>(ExtremePoints.
+        OrderBy(ep => ep.AssignedBin).
+        ThenBy(ep => ep.Z).
+        ThenBy(ep => ep.X).
+        ThenBy(ep => ep.Y).
+        ThenBy(ep => OccupiedPoints.ShortestPossibleSideFromEP(ep)));
+    }
+
+    public override ThreeDimensionalPacking FindExtremePointForItem(CuboidPackingItem measures, bool rotated, bool stackingConstraint) {
+
+      CuboidPackingItem item = new CuboidPackingItem(
+        rotated ? measures.Depth : measures.Width,
+        measures.Height,
+        rotated ? measures.Width : measures.Depth,
+        measures.TargetBin);
+
+      int epIndex = 0;
+      while (epIndex < ExtremePoints.Count && (
+        !IsPositionFeasible(item, ExtremePoints.ElementAt(epIndex)) || (stackingConstraint && !OccupiedPoints.IsStaticStable(item, ExtremePoints.ElementAt(epIndex)))
+      )) { epIndex++; }
+
+      if (epIndex < ExtremePoints.Count) {
+        var result = ExtremePoints.ElementAt(epIndex);
+        result.Rotated = rotated;
+        return result;
+      }
+      return null;
+    }
+    public override ThreeDimensionalPacking FindPositionBySliding(CuboidPackingItem measures, bool rotated) {
+      //Starting-position at upper right corner (=left bottom point of item-rectangle is at position item.width,item.height)
+      ThreeDimensionalPacking currentPosition = new ThreeDimensionalPacking(0,
+        BinMeasures.Width - (rotated ? measures.Depth : measures.Width),
+        BinMeasures.Height - measures.Height,
+        BinMeasures.Depth - (rotated ? measures.Width : measures.Depth), rotated);
+      //Slide the item as far as possible to the bottom
+      while (IsPositionFeasible(measures, MoveDown(currentPosition))
+        || IsPositionFeasible(measures, MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, MoveBack(currentPosition))) {
+        //Slide the item as far as possible to the left
+        while (IsPositionFeasible(measures, MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, MoveBack(currentPosition))) {
+          //Slide the item as far as possible to the back
+          while (IsPositionFeasible(measures, MoveBack(currentPosition))) {
+            currentPosition = MoveBack(currentPosition);
+          }
+          if (IsPositionFeasible(measures, MoveLeft(currentPosition)))
+            currentPosition = MoveLeft(currentPosition);
+        }
+        if (IsPositionFeasible(measures, MoveDown(currentPosition)))
+          currentPosition = MoveDown(currentPosition);
+      }
+
+      return IsPositionFeasible(measures, currentPosition) ? currentPosition : null;
+    }
+    private static ThreeDimensionalPacking MoveLeft(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Z, original.Rotated);
+    }
+    private static ThreeDimensionalPacking MoveDown(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Z, original.Rotated);
+    }
+    private static ThreeDimensionalPacking MoveBack(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z - 1, original.Rotated);
+    }
+  }
+
+
+
 }
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInsertionManipulator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInsertionManipulator.cs	(revision 9592)
+++ 	(revision )
@@ -1,48 +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 System;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.BinPacking.Interfaces;
-
-namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence {
-  [Item("PackingSequence Insertion Manipulator", "An operator which manipulates a PackingSequence representation.")]
-  [StorableClass]
-  public class PackingSequenceInsertionManipulator : PackingSequenceManipulator, IPackingSequenceOperator {
-    [StorableConstructor]
-    protected PackingSequenceInsertionManipulator(bool deserializing) : base(deserializing) { }
-    protected PackingSequenceInsertionManipulator(PackingSequenceManipulator original, Cloner cloner) : base(original, cloner) { }
-    public PackingSequenceInsertionManipulator()
-      : base() {
-        EncodedSolutionParameter.ActualName = "PackingSequence";
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PackingSequenceInsertionManipulator(this, cloner);
-    }
-
-    protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) {
-      Swap2Manipulator.Apply(random, individual.PackingSequence);
-    }   
-  }
-}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInversionManipulator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInversionManipulator.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInversionManipulator.cs	(revision 9593)
@@ -0,0 +1,48 @@
+﻿#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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+
+namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence {
+  [Item("PackingSequence Inversion Manipulator", "An operator which manipulates a PackingSequence representation.")]
+  [StorableClass]
+  public class PackingSequenceInversionManipulator : PackingSequenceManipulator, IPackingSequenceOperator {
+    [StorableConstructor]
+    protected PackingSequenceInversionManipulator(bool deserializing) : base(deserializing) { }
+    protected PackingSequenceInversionManipulator(PackingSequenceManipulator original, Cloner cloner) : base(original, cloner) { }
+    public PackingSequenceInversionManipulator()
+      : base() {
+        EncodedSolutionParameter.ActualName = "PackingSequence";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PackingSequenceInversionManipulator(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) {
+      InversionManipulator.Apply(random, individual.PackingSequence);
+    }   
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceOrderCrossover.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceOrderCrossover.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceOrderCrossover.cs	(revision 9593)
@@ -43,5 +43,5 @@
     public override PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2)  {
       PackingSequenceEncoding result = new PackingSequenceEncoding();
-      result.PackingSequence = OrderCrossover2.Apply(random, parent1.PackingSequence, parent2.PackingSequence);
+      result.PackingSequence = OrderCrossover.Apply(random, parent1.PackingSequence, parent2.PackingSequence);
       return result;
     }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceScrambleManipulator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceScrambleManipulator.cs	(revision 9593)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceScrambleManipulator.cs	(revision 9593)
@@ -0,0 +1,48 @@
+﻿#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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.BinPacking.Interfaces;
+
+namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence {
+  [Item("PackingSequence Scramble Manipulator", "An operator which manipulates a PackingSequence representation.")]
+  [StorableClass]
+  public class PackingSequenceScrambleManipulator : PackingSequenceManipulator, IPackingSequenceOperator {
+    [StorableConstructor]
+    protected PackingSequenceScrambleManipulator(bool deserializing) : base(deserializing) { }
+    protected PackingSequenceScrambleManipulator(PackingSequenceManipulator original, Cloner cloner) : base(original, cloner) { }
+    public PackingSequenceScrambleManipulator()
+      : base() {
+        EncodedSolutionParameter.ActualName = "PackingSequence";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PackingSequenceScrambleManipulator(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) {
+      ScrambleManipulator.Apply(random, individual.PackingSequence);
+    }    
+  }
+}
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceSwap2Manipulator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceSwap2Manipulator.cs	(revision 9592)
+++ 	(revision )
@@ -1,48 +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 System;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.BinPacking.Interfaces;
-
-namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence {
-  [Item("PackingSequence Swap2 Manipulator", "An operator which manipulates a PackingSequence representation.")]
-  [StorableClass]
-  public class PackingSequenceSwap2Manipulator : PackingSequenceManipulator, IPackingSequenceOperator {
-    [StorableConstructor]
-    protected PackingSequenceSwap2Manipulator(bool deserializing) : base(deserializing) { }
-    protected PackingSequenceSwap2Manipulator(PackingSequenceManipulator original, Cloner cloner) : base(original, cloner) { }
-    public PackingSequenceSwap2Manipulator()
-      : base() {
-        EncodedSolutionParameter.ActualName = "PackingSequence";
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PackingSequenceSwap2Manipulator(this, cloner);
-    }
-
-    protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) {
-      Swap2Manipulator.Apply(random, individual.PackingSequence);
-    }    
-  }
-}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/BinUtilizationRegularIdenticalBinEvaluator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/BinUtilizationRegularIdenticalBinEvaluator.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/BinUtilizationRegularIdenticalBinEvaluator.cs	(revision 9593)
@@ -90,11 +90,12 @@
 
       for (int i = 0; i < nrOfBins; i++) {
-        double usableSpace = plan.GetPackingBinMeasuresForBinNr(i).MultipliedMeasures;
-        var indexes = plan.PackingItemPositions.Select((Value, Index) => new { Value, Index }).Where(s => s.Value.Value.AssignedBin == i).Select(s => s.Index);
-        var packedItemsInThisBin = plan.PackingItemMeasures.Select((Value, Index) => new { Value, Index }).Where(s => indexes.Contains(s.Index));
-        double usedSpaceInThisBin = packedItemsInThisBin.Select(s => s.Value.MultipliedMeasures).Sum();
+        double usableSpace = plan.BinPackings[i].BinMeasures.MultipliedMeasures;
+        //var indexes = plan.PackingItemPositions.Select((Value, Index) => new { Value, Index }).Where(s => s.Value.Value.AssignedBin == i).Select(s => s.Index);
+        //var packedItemsInThisBin = plan.PackingItemMeasures.Select((Value, Index) => new { Value, Index }).Where(s => indexes.Contains(s.Index));
+        //double usedSpaceInThisBin = packedItemsInThisBin.Select(s => s.Value.MultipliedMeasures).Sum();
         //result += (usedSpaceInThisBin / usableSpace);
         totalUsableSpace += usableSpace;
-        totalUsedSpace += usedSpaceInThisBin;
+        //totalUsedSpace += usedSpaceInThisBin;
+        totalUsedSpace += plan.BinPackings[i].PackingDensity * usableSpace;
       }
 
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/PackingRatioRegularIdenticalBinEvaluator.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/PackingRatioRegularIdenticalBinEvaluator.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/PackingRatioRegularIdenticalBinEvaluator.cs	(revision 9593)
@@ -89,11 +89,13 @@
       for (int i = 0; i < nrOfBins; i++) {
         //C
-        double usableSpace = plan.GetPackingBinMeasuresForBinNr(0).MultipliedMeasures;//plan.GetPackingBinMeasuresForBinNr(i).MultipliedMeasures;
-        var indexes = plan.PackingItemPositions.Select((Value, Index) => new { Value, Index }).Where(s => s.Value.Value.AssignedBin == i).Select(s => s.Index);
-        var packedItemsInThisBin = plan.PackingItemMeasures.Select((Value, Index) => new { Value, Index }).Where(s => indexes.Contains(s.Index));
+        //double usableSpace = plan.GetPackingBinMeasuresForBinNr(0).MultipliedMeasures;//plan.GetPackingBinMeasuresForBinNr(i).MultipliedMeasures;
+        //var indexes = plan.PackingItemPositions.Select((Value, Index) => new { Value, Index }).Where(s => s.Value.Value.AssignedBin == i).Select(s => s.Index);
+        //var packedItemsInThisBin = plan.PackingItemMeasures.Select((Value, Index) => new { Value, Index }).Where(s => indexes.Contains(s.Index));
         //Fi
-        double usedSpaceInThisBin = packedItemsInThisBin.Select(s => s.Value.MultipliedMeasures).Sum();
+        //double usedSpaceInThisBin = packedItemsInThisBin.Select(s => s.Value.MultipliedMeasures).Sum();
         //k = 2 --> (Fi/C)*(Fi/C)
-        result += (((usedSpaceInThisBin) / (usableSpace)) * ((usedSpaceInThisBin) / (usableSpace))) / (i*i + 1);
+        //result += (((usedSpaceInThisBin) / (usableSpace)) * ((usedSpaceInThisBin) / (usableSpace))) / (i*i + 1);
+        var PD = plan.BinPackings[i].PackingDensity;
+        result += (PD * PD) / (i + 1);
       }
 
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj	(revision 9593)
@@ -166,15 +166,13 @@
     <Compile Include="Analyzers\BinPackingAnalyzer.cs" />
     <Compile Include="Decoders\2D\BL\BottomLeftMultiComponentVectorDecoder.cs" />
-    <Compile Include="Decoders\2D\BL\BottomLeftFunctions.cs" />
+    <Compile Include="Decoders\2D\TwoDimensionalPackingFunctions.cs" />
     <Compile Include="Decoders\2D\EP\ExtremePointGroupingVectorDecoder2D.cs" />
     <Compile Include="Decoders\2D\EP\ExtremePointMultiComponentVectorDecoder2D.cs" />
     <Compile Include="Decoders\2D\EP\ExtremePointPackingSequenceDecoder2D.cs" />
-    <Compile Include="Decoders\2D\EP\ExtremePointsFunctions2D.cs" />
+    <Compile Include="Decoders\3D\ThreeDimensionalPackingFunctions.cs" />
     <Compile Include="Decoders\3D\EP\ExtremePointMultiComponentVectorDecoder3D.cs" />
     <Compile Include="Decoders\3D\EP\ExtremePointGroupingVectorDecoder3D.cs" />
     <Compile Include="Decoders\3D\EP\ExtremePointPackingSequenceDecoder3D.cs" />
     <Compile Include="Decoders\3D\DBL\DeepestBottomLeftMultiComponentVectorDecoder.cs" />
-    <Compile Include="Decoders\3D\DBL\DeepestBottomLeftFunctions.cs" />
-    <Compile Include="Decoders\3D\EP\ExtremePointsFunctions3D.cs" />
     <Compile Include="Decoders\3D\DBL\DeepestBottomLeftGroupingVectorDecoder.cs" />
     <Compile Include="Decoders\2D\BL\BottomLeftGroupingVectorDecoder.cs" />
@@ -182,5 +180,11 @@
     <Compile Include="Decoders\2D\BL\BottomLeftPackingSequenceDecoder.cs" />
     <Compile Include="Decoders\3D\EP\ISOContainerMultiComponentVectorDecoder3D.cs" />
+    <Compile Include="Decoders\SequentialPackingFunctions.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Decoders\PackingSolutionDecoder.cs" />
+    <Compile Include="Dimensions\OccupiedPoints3D.cs" />
+    <Compile Include="Dimensions\OccupiedPoints2D.cs" />
+    <Compile Include="Dimensions\OccupiedPoints.cs" />
     <Compile Include="Encodings\GroupingVector\GroupingVectorSwap2Manipulator.cs" />
     <Compile Include="Encodings\GroupingVector\GroupingVectorSinglePointCrossover.cs" />
@@ -243,6 +247,5 @@
     <Compile Include="Encodings\PackingSequence\Moves\Insertion\InsertionMoveAttribute.cs" />
     <Compile Include="Encodings\PackingSequence\Moves\Insertion\InsertionMoveGenerator.cs" />
-    <Compile Include="Encodings\PackingSequence\PackingSequenceInsertionManipulator.cs" />
-    <Compile Include="Encodings\PackingSequence\PackingSequenceSwap2Manipulator.cs" />
+    <Compile Include="Encodings\PackingSequence\PackingSequenceInversionManipulator.cs" />
     <Compile Include="Encodings\PackingSequence\PackingSequencePartiallyMatchedCrossover.cs" />
     <Compile Include="Encodings\PackingSequence\PackingSequenceOrderCrossover.cs" />
@@ -268,4 +271,5 @@
     </Compile>
     <Compile Include="Encodings\PackingSequence\PackingSequenceRandomCreator.cs" />
+    <Compile Include="Encodings\PackingSequence\PackingSequenceScrambleManipulator.cs" />
     <Compile Include="Encodings\PackingSolutionCreator.cs" />
     <Compile Include="Encodings\PackingSolutionCrossover.cs" />
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs	(revision 9593)
@@ -26,5 +26,5 @@
   /// Plugin class for HeuristicLab.Problems.BinPacking plugin.
   /// </summary>
-  [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9495")]
+  [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9563")]
   [PluginFile("HeuristicLab.Problems.BinPacking-3.3.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Common", "3.3")]
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs	(revision 9593)
@@ -53,5 +53,6 @@
 
     #region Helpers
-    public int MultipliedMeasures { get { return Width * Height * Depth; } }
+    public override ThreeDimensionalPacking Origin { get { return new ThreeDimensionalPacking(0, 0, 0, 0); } }
+    public override int MultipliedMeasures { get { return Width * Height * Depth; } }
    
     public override bool Encloses(ThreeDimensionalPacking checkedPosition, PackingShape<ThreeDimensionalPacking> checkedShape) {
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs	(revision 9593)
@@ -43,4 +43,6 @@
     public abstract void InitializeFromMeasures(int[] measures);
     public abstract int[] ToArray();
+    public abstract int MultipliedMeasures { get; }
+    public abstract D Origin { get; }
 
     public PackingShape(int[] measures) {
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs	(revision 9592)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs	(revision 9593)
@@ -48,5 +48,6 @@
 
     #region Helpers
-    public int MultipliedMeasures { get { return Height * Width; } }
+    public override TwoDimensionalPacking Origin { get { return new TwoDimensionalPacking(0, 0, 0); } }
+    public override int MultipliedMeasures { get { return Height * Width; } }
 
     public override bool Encloses(TwoDimensionalPacking checkedPosition, PackingShape<TwoDimensionalPacking> checkedShape) {
