Index: /branches/HeuristicLab.BinPacking/HeuristicLab.BinPacking.sln
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.BinPacking.sln	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.BinPacking.sln	(revision 9596)
@@ -1,5 +1,5 @@
 ﻿
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.BinPacking-3.3", "HeuristicLab.Problems.BinPacking\3.3\HeuristicLab.Problems.BinPacking-3.3.csproj", "{F8A55094-3CD5-4034-B0CA-5BD7FFB016D4}"
 EndProject
@@ -7,4 +7,5 @@
 	ProjectSection(SolutionItems) = preProject
 		..\Build.cmd = ..\Build.cmd
+		Performance1.psess = Performance1.psess
 		..\PreBuildEvent.cmd = ..\PreBuildEvent.cmd
 	EndProjectSection
@@ -60,3 +61,6 @@
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(Performance) = preSolution
+		HasPerformanceSessions = true
+	EndGlobalSection
 EndGlobal
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs	(revision 9596)
@@ -26,5 +26,5 @@
   /// Plugin class for HeuristicLab.Problems.BinPacking.Views plugin.
   /// </summary>
-  [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9495")]
+  [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9593")]
   [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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Properties/AssemblyInfo.cs	(revision 9596)
@@ -54,3 +54,3 @@
 // by using the '*' as shown below:
 [assembly: AssemblyVersion("3.3.0.0")]
-[assembly: AssemblyFileVersion("3.3.7.9495")]
+[assembly: AssemblyFileVersion("3.3.7.9593")]
Index: anches/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 9595)
+++ 	(revision )
@@ -1,233 +1,0 @@
-﻿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 BottomLeftFunctions {
-
-    /*
-    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> BottomLeftPacking(
-      MultiComponentVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-      int nrOfBins = solution.NrOfBins;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      Dictionary<int, List<PackingInformation>> unpackedItemIndexesPerBin = new Dictionary<int, List<PackingInformation>>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = new List<PackingInformation>(solution.PackingInformations[i]);
-      }
-
-      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-      var remainingItems = new List<PackingInformation>();
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-          TwoDimensionalPacking position = null;
-
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
-
-          if (position == null) {
-            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 {
-            itemPositions[itemIndex] = position;
-            solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
-          }
-        }
-      }
-
-      //Packing of remaining items
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<PackingInformation>(remainingItems);
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-          TwoDimensionalPacking position = null;
-
-          //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, unpackedItems[i].Rotated);
-
-          if (position == null) {
-            position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures, !unpackedItems[i].Rotated);
-          }
-          if (position != null) {
-            itemPositions[itemIndex] = position;
-            remainingItems.Remove(unpackedItems[i]);
-            solution.PackingInformations[binNr].Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          solution.PackingInformations[nrOfBins] = new ItemList<PackingInformation>();
-          nrOfBins++;
-        }
-      }
-
-      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) {
-
-      int nrOfBins = solution.GroupingVector.Max() + 1;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      //It is assumed, that at this point the item-indexes are sorted according to their item-size!
-      Dictionary<int, List<int>> unpackedItemIndexesPerBin = new Dictionary<int, List<int>>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = solution.GroupingVector
-          .Select((Value, Index) => new { Value, Index })
-          .Where(temp => temp.Value == i)
-          .Select(temp => temp.Index).ToList();
-      }
-
-      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-      var remainingItems = new List<int>();
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-          TwoDimensionalPacking position = null;
-
-          //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-
-          //Did not find enough space in current bin
-          if (position == null) {
-            remainingItems.Add(itemIndex);
-          } else
-            itemPositions[itemIndex] = position;
-        }
-      }
-
-      //Packing of remaining items
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<int>(remainingItems);
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-          TwoDimensionalPacking position = null;
-
-          //Look for space in current bin
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-
-          if (position != null) {
-            itemPositions[itemIndex] = position;
-            remainingItems.Remove(itemIndex);
-            solution.GroupingVector[itemIndex] = binNr;
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          nrOfBins++;
-        }
-      }
-
-      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> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-      int nrOfBins = 1;
-      for (int i = 0; i < solution.PackingSequence.Length; i++) {
-        var item = itemMeasures[solution.PackingSequence[i]];
-        TwoDimensionalPacking position = null;
-        //Look for space in existing bins
-        for (int binNr = 0; binNr < nrOfBins; binNr++) {
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-          if (position != null)
-            break;
-        }
-        //Did not find enough space in any of the existing bins => create new bin
-        if (position == null) {
-          nrOfBins++;
-          position = BottomLeftFunctions.BottomLeftPosition(binMeasures, nrOfBins - 1, item, itemPositions, itemMeasures);
-        }
-
-        if (position == null)
-          position = new TwoDimensionalPacking(-1, 0, 0);
-
-        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);
-    }
-    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), 
-        binMeasures.Height - (rotated ? currentItem.Width : currentItem.Height), rotated);
-      //Slide the item as far as possible to the left
-      while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
-        || IsPositionFeasible(binMeasures, binNr, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)) {
-        //Slide the item as far as possible to the bottom
-          while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)) {
-          currentPosition = MoveDown(currentPosition);
-        }
-          if (IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures))
-          currentPosition = MoveLeft(currentPosition);
-      }
-
-      return IsPositionFeasible(binMeasures, binNr, currentItem, currentPosition, itemPositions, itemMeasures) ? currentPosition : null;
-    }
-
-    public static bool IsPositionFeasible(RectangularPackingBin binMeasures, int binNr, 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;
-      var itemsWithPositions = itemMeasures.
-        Select((Value, Index) => new { Value, Index }).
-        Where(s => itemPositions.ContainsKey(s.Index)).
-        Select((s) => new { Measures = itemMeasures[s.Index], Position = itemPositions[s.Index] });
-
-      foreach (var itemWithPosition in itemsWithPositions) {
-        if (itemWithPosition.Position.AssignedBin == binNr && itemWithPosition.Measures.Overlaps(itemWithPosition.Position, currentPosition, currentItem))
-          return false;
-      }
-
-      return true;
-    }
-
-    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);
-    }
-
-  }
-}
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftGroupingVectorDecoder.cs	(revision 9596)
@@ -41,13 +41,6 @@
   [Item("Identical bin two dimensional grouping vector decoder", "<Description missing...>")]
   [StorableClass]
-  public class BottomLeftGroupingVectorDecoder : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DGVDecoder {
-
-    public BottomLeftGroupingVectorDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+  public class BottomLeftGroupingVectorDecoder : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin,RectangularPackingItem>, I2DGVDecoder {
+    public BottomLeftGroupingVectorDecoder() : base() {}
     [StorableConstructor]
     protected BottomLeftGroupingVectorDecoder(bool deserializing) : base(deserializing) { }
@@ -59,14 +52,9 @@
     }
 
-
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-
       var solution = encodedSolution as GroupingVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
-
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
+      PackingPlan2D result = new PackingPlan2D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftMultiComponentVectorDecoder.cs	(revision 9596)
@@ -41,13 +41,6 @@
   [Item("Identical bin two dimensional multi component vector decoder", "<Description missing...>")]
   [StorableClass]
-  public class BottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DMCVDecoder {
-
-    public BottomLeftMultiComponentVectorDecoder()
-      : base() {
-      //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+  public class BottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<TwoDimensionalPacking,RectangularPackingBin, RectangularPackingItem>, I2DMCVDecoder {
+    public BottomLeftMultiComponentVectorDecoder() : base() {}
     [StorableConstructor]
     protected BottomLeftMultiComponentVectorDecoder(bool deserializing) : base(deserializing) { }
@@ -59,15 +52,9 @@
     }
 
-
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-
       var solution = encodedSolution as MultiComponentVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponent Vector");
-
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
-
+      PackingPlan2D result = new PackingPlan2D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftPackingSequenceDecoder.cs	(revision 9596)
@@ -40,13 +40,7 @@
   [Item("Identical bin, two dimensional, direct permutation decoder", "<Description missing...>")]
   [StorableClass]
-  public class BottomLeftPackingSequenceDecoder : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DPSDecoder {
+  public class BottomLeftPackingSequenceDecoder : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DPSDecoder {
 
-    public BottomLeftPackingSequenceDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+    public BottomLeftPackingSequenceDecoder(): base() { }
     [StorableConstructor]
     protected BottomLeftPackingSequenceDecoder(bool deserializing) : base(deserializing) { }
@@ -58,15 +52,9 @@
     }
 
-
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-
       var solution = encodedSolution as PackingSequenceEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
-
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
-
+      PackingPlan2D result = new PackingPlan2D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointGroupingVectorDecoder2D.cs	(revision 9596)
@@ -41,12 +41,6 @@
   [Item("Identical bin, two dimensional, extreme points based decoder for the GroupingVector encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointGroupingVectorDecoder2D : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DGVDecoder {
-
-    public ExtremePointGroupingVectorDecoder2D ()
-      : base() {
-    }
+  public class ExtremePointGroupingVectorDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DGVDecoder {
+    public ExtremePointGroupingVectorDecoder2D () : base() {}
     [StorableConstructor]
     protected ExtremePointGroupingVectorDecoder2D (bool deserializing) : base(deserializing) { }
@@ -59,17 +53,12 @@
 
     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);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
-
+      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
+      result.Pack(solution, itemMeasures);
       return result;
     }
 
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-                      
       var solution = encodedSolution as GroupingVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
-
       return Decode(solution, binMeasures, itemMeasures);
     }
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs	(revision 9596)
@@ -42,12 +42,6 @@
   [Item("Identical bin, two dimensional, extreme points based decoder for the MultiComponentVector encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointMultiComponentVectorDecoder2D : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DMCVDecoder {
-
-    public ExtremePointMultiComponentVectorDecoder2D ()
-      : base() {
-    }
+  public class ExtremePointMultiComponentVectorDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking,RectangularPackingBin, RectangularPackingItem>, I2DMCVDecoder {
+    public ExtremePointMultiComponentVectorDecoder2D () : base() {}
     [StorableConstructor]
     protected ExtremePointMultiComponentVectorDecoder2D (bool deserializing) : base(deserializing) { }
@@ -60,17 +54,12 @@
 
     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);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
-
+      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
+      result.Pack(solution, itemMeasures);
       return result;
     }
 
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-
       var solution = encodedSolution as MultiComponentVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
-
       return Decode(solution, binMeasures, itemMeasures);
     }
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointPackingSequenceDecoder2D.cs	(revision 9596)
@@ -40,12 +40,6 @@
   [Item("Identical bin, two dimensional, extreme points based decoder for the PackingSequence encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointPackingSequenceDecoder2D : PackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem>, I2DPSDecoder {
-
-    public ExtremePointPackingSequenceDecoder2D ()
-      : base() {
-    }
+  public class ExtremePointPackingSequenceDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DPSDecoder {
+    public ExtremePointPackingSequenceDecoder2D () : base() {}
     [StorableConstructor]
     protected ExtremePointPackingSequenceDecoder2D (bool deserializing) : base(deserializing) { }
@@ -59,13 +53,8 @@
 
     public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
-
       var solution = encodedSolution as PackingSequenceEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
-
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result = 
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
-
-      result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
-
+      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
+      result.Pack(solution, itemMeasures);
       return result;
     }
Index: anches/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 9595)
+++ 	(revision )
@@ -1,328 +1,0 @@
-﻿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 ExtremPointsFunctions2D {
-
-
-
-
-    public static ObservableList<BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> ExtremePointBasedPacking(MultiComponentVectorEncoding solution, 
-        ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures) {
-
-      #region Preperations
-          int nrOfBins = solution.NrOfBins;
-
-      //Get all indexes of items for every bin according to grouping-vector                      
-      Dictionary<int, List<PackingInformation>> unpackedItemIndexesPerBin = new Dictionary<int, List<PackingInformation>>();
-      Dictionary<int, HashSet<TwoDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<TwoDimensionalPacking>>();
-      var occupiedPoints = new List<int[,]>();
-
-      for (int i = 0; i < nrOfBins; i++) {        
-        unpackedItemIndexesPerBin[i] = new List<PackingInformation> (solution.PackingInformations[i]);
-
-        extremePointsForBin[i] = new HashSet<TwoDimensionalPacking>();
-        extremePointsForBin[i].Add(new TwoDimensionalPacking(i, 0, 0, false));
-        occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-      }
-
-      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-      var remainingItems = new List<PackingInformation>();
-
-      #endregion Preperations
-
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);
-          } else {
-            remainingItems.Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
-          }
-        }
-      }
-
-
-      //Packing of remaining items    
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<PackingInformation>(remainingItems);
-        //Iterate over all the remaining items
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);
-            remainingItems.Remove(unpackedItems[i]);
-            solution.PackingInformations[binNr].Add(unpackedItems[i]);
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          extremePointsForBin[nrOfBins] = new HashSet<TwoDimensionalPacking>();
-          extremePointsForBin[nrOfBins].Add(new TwoDimensionalPacking(nrOfBins, 0, 0, false));
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          solution.PackingInformations[nrOfBins] = new ItemList<PackingInformation>();
-          nrOfBins++;
-        }
-      }
-
-      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) {
-
-      #region Preperations
-      int nrOfBins = solution.GroupingVector.Max() + 1;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      Dictionary<int, List<int>> unpackedItemIndexesPerBin = new Dictionary<int, List<int>>();   
-      Dictionary<int, HashSet<TwoDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<TwoDimensionalPacking>>(); 
-      var occupiedPoints = new List<int[,]>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = solution.GroupingVector
-          .Select((Value, Index) => new { Value, Index })
-          .Where(temp => temp.Value == i)
-          .Select(temp => temp.Index).ToList();
-
-        extremePointsForBin[i] = new HashSet<TwoDimensionalPacking>();
-        extremePointsForBin[i].Add(new TwoDimensionalPacking(i, 0, 0, false));    
-        occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-      }
-
-      ObservableDictionary<int, TwoDimensionalPacking> itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-      var remainingItems = new List<int>();
-
-      #endregion Preperations
-
-              
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);
-          } else 
-            remainingItems.Add(itemIndex);
-        }
-      }
-
-
-
-      //Packing of remaining items    
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<int>(remainingItems);
-        //Iterate over all the remaining items
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);        
-            remainingItems.Remove(itemIndex);
-          } 
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          extremePointsForBin[nrOfBins] = new HashSet<TwoDimensionalPacking>();
-          extremePointsForBin[nrOfBins].Add(new TwoDimensionalPacking(nrOfBins, 0, 0, false));
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          nrOfBins++;
-        }
-      }
-
-      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) {
-
-      #region Preperations 
-      var itemPositions = new ObservableDictionary<int, TwoDimensionalPacking>();  
-      int nrOfBins = 1;
-
-      var occupiedPoints = new List<int[,]>();
-      occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-
-      HashSet<TwoDimensionalPacking> extremePoints = new HashSet<TwoDimensionalPacking>();
-      extremePoints.Add(new TwoDimensionalPacking(0, 0, 0, false));
-      #endregion
-
-      foreach (int itemIndex in solution.PackingSequence) {
-        var item = itemMeasures[itemIndex];
-        extremePoints = OrderExtremePoints(extremePoints, occupiedPoints, binMeasures);
-        var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions);
-        if (positionFound != null) {
-          extremePoints.Remove(positionFound); 
-        }
-        else {
-          positionFound = new TwoDimensionalPacking(nrOfBins, 0, 0);
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          nrOfBins++;
-        }
-        itemPositions[itemIndex] = positionFound;
-        occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-        extremePoints = GenerateNewExtremePointsForNewItem(extremePoints, occupiedPoints, item, positionFound, 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);
-    }
-    public static TwoDimensionalPacking FindExtremePointForItem(int itemIndex, ItemList<RectangularPackingItem> itemMeasures, RectangularPackingBin binMeasures, 
-        HashSet<TwoDimensionalPacking> extremePoints, List<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;
-    }
-    public static List<int[,]> IncreaseBinCountForOccupiedPoints(List<int[,]> occupiedPoints, RectangularPackingBin binMeasures) {
-      occupiedPoints.Add(new int[binMeasures.Width, binMeasures.Height]);
-      int lastIndex = occupiedPoints.Count - 1;
-      for (int w = 0; w < binMeasures.Width; w++) {
-        for (int h = 0; h < binMeasures.Height; h++) {
-            occupiedPoints[lastIndex][w, h] = -1;
-        }
-      }
-      return occupiedPoints;
-    }
-    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;
-      for (int w = position.X; w < position.X + width; w++) {
-        for (int h = position.Y; h < position.Y + height; h++) {
-            occupiedPoints[position.AssignedBin][w,h] = itemIndex;
-        }
-      }
-      return occupiedPoints;
-    }
-    public static HashSet<TwoDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<TwoDimensionalPacking> extremePoints, List<int[,]> occupiedPoints, 
-        RectangularPackingItem newItem, TwoDimensionalPacking position, RectangularPackingBin binMeasures) {
-      int currentBin = position.AssignedBin;
-
-      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(currentBin, 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[currentBin][sourcePointX.X, currentYValue] == -1) {
-          currentYValue--;
-        }
-        extremePoints.Add(new TwoDimensionalPacking(currentBin, sourcePointX.X, currentYValue));
-      }
-
-
-
-
-      //Find ExtremePoints beginning from sourcepointY
-      var sourcePointY = new TwoDimensionalPacking(currentBin, 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[currentBin][currentXValue - 1, sourcePointY.Y] == -1) {
-          currentXValue--;
-        }
-        extremePoints.Add(new TwoDimensionalPacking(currentBin, currentXValue, sourcePointY.Y));
-      }
-
-
-      return extremePoints;
-    }
-
-    public static HashSet<TwoDimensionalPacking> OrderExtremePoints(HashSet<TwoDimensionalPacking> hashSet, List<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, List<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[ep.AssignedBin][currentX, ep.Y] == -1) { currentX++; }   
-      if (currentX - ep.X < shortestSide)
-        shortestSide = currentX - ep.X;
-
-      int currentY = ep.Y;
-      while (currentY < binMeasures.Height && occupiedPoints[ep.AssignedBin][ep.X, currentY] == -1) { currentY++;  }
-      if (currentY - ep.Y < shortestSide)
-        shortestSide = currentY - ep.Y;
-
-      return shortestSide;
-    }
-
-    
-  }
-}
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/TwoDimensionalPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/TwoDimensionalPackingFunctions.cs	(revision 9595)
+++ 	(revision )
@@ -1,196 +1,0 @@
-﻿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: anches/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 9595)
+++ 	(revision )
@@ -1,239 +1,0 @@
-﻿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 DeepestBottomLeftFunctions {
-
-    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> DeepestLeftBottomPacking(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-      int nrOfBins = solution.NrOfBins;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      Dictionary<int, List<PackingInformation>> unpackedItemIndexesPerBin = new Dictionary<int, List<PackingInformation>>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = new List<PackingInformation>(solution.PackingInformations[i]);
-      }
-
-      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
-      var remainingItems = new List<PackingInformation>();
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-          ThreeDimensionalPacking position = null;
-
-          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) {
-            remainingItems.Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
-          } else {
-            itemPositions[itemIndex] = position;
-            solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
-          }
-        }
-      }
-
-      //Packing of remaining items
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<PackingInformation>(remainingItems);
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-          ThreeDimensionalPacking position = null;
-
-          //Look for space in current bin
-          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) {
-            itemPositions[itemIndex] = position;
-            remainingItems.Remove(unpackedItems[i]);
-            solution.PackingInformations[binNr].Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Find(pi => pi.ItemID == itemIndex).Rotated = position.Rotated;
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          solution.PackingInformations[nrOfBins] = new ItemList<PackingInformation>();
-          nrOfBins++;
-        }
-      }
-
-      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;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      //It is assumed, that at this point the item-indexes are sorted according to their item-size!
-      Dictionary<int, List<int>> unpackedItemIndexesPerBin = new Dictionary<int, List<int>>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = solution.GroupingVector
-          .Select((Value, Index) => new { Value, Index })
-          .Where(temp => temp.Value == i)
-          .Select(temp => temp.Index).ToList();
-      }
-
-      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
-      var remainingItems = new List<int>();
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-          ThreeDimensionalPacking position = null;
-
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-
-          if (position == null) {
-            remainingItems.Add(itemIndex);
-          } else
-            itemPositions[itemIndex] = position;
-        }
-      }
-
-      //Packing of remaining items
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<int>(remainingItems);
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-          ThreeDimensionalPacking position = null;
-
-          //Look for space in current bin
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-
-          if (position != null) {
-            itemPositions[itemIndex] = position;
-            remainingItems.Remove(itemIndex);
-            //solution.GroupingVector[itemIndex] = binNr;
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          nrOfBins++;
-        }
-      }
-
-      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++) {
-        var item = itemMeasures[solution.PackingSequence[i]];
-        ThreeDimensionalPacking position = null;
-        //Look for space in existing bins
-        for (int binNr = 0; binNr < nrOfBins; binNr++) {
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, binNr, item, itemPositions, itemMeasures);
-          if (position != null)
-            break;
-        }
-        //Did not find enough space in any of the existing bins => create new bin
-        if (position == null) {
-          nrOfBins++;
-          position = DeepestBottomLeftFunctions.DeepestLeftBottomPosition(binMeasures, nrOfBins - 1, item, itemPositions, itemMeasures);
-        }
-
-        if (position == null)
-          position = new ThreeDimensionalPacking(-1, 0, 0, 0);
-
-        itemPositions[solution.PackingSequence[i]] = position;
-      }
-
-      return BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, binMeasures, itemMeasures, nrOfBins);
-    }
-
-    public static ThreeDimensionalPacking DeepestLeftBottomPosition(CuboidPackingBin binMeasures, int binNr, CuboidPackingItem currentItem, ObservableDictionary<int, ThreeDimensionalPacking> itemPositions, ItemList<CuboidPackingItem> itemMeasures) {
-      return DeepestLeftBottomPosition(binMeasures, binNr, currentItem, itemPositions, itemMeasures, false);
-    }
-    public static ThreeDimensionalPacking DeepestLeftBottomPosition(CuboidPackingBin binMeasures, int binNr, 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(binNr, 
-        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, binNr, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)
-        || IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
-        || IsPositionFeasible(binMeasures, binNr, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
-        //Slide the item as far as possible to the left
-          while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)
-          || IsPositionFeasible(binMeasures, binNr, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
-          //Slide the item as far as possible to the back
-            while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveBack(currentPosition), itemPositions, itemMeasures)) {
-            currentPosition = MoveBack(currentPosition);
-          }
-            if (IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures))
-            currentPosition = MoveLeft(currentPosition);
-        }
-          if (IsPositionFeasible(binMeasures, binNr, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures))
-          currentPosition = MoveDown(currentPosition);
-      }
-
-      return IsPositionFeasible(binMeasures, binNr, currentItem, currentPosition, itemPositions, itemMeasures) ? currentPosition : null;
-    }
-
-    
-
-    public static bool IsPositionFeasible(CuboidPackingBin binMeasures, int binNr, 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;
-
-      var itemsWithPositions = itemMeasures.
-        Select((Value, Index) => new { Value, Index }).
-        Where(s => itemPositions.ContainsKey(s.Index)).
-        Select((s) => new { Measures = itemMeasures[s.Index], Position = itemPositions[s.Index] });
-
-      foreach (var itemWithPosition in itemsWithPositions) {
-        if (itemWithPosition.Position.AssignedBin == binNr && itemWithPosition.Measures.Overlaps(itemWithPosition.Position, currentPosition, currentItem))
-          return false;
-      }
-
-      return true;
-    }
-
-    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: /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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftGroupingVectorDecoder.cs	(revision 9596)
@@ -38,15 +38,8 @@
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
-  [Item("Identical bin three dimensional direct grouping vector decoder", "<Description missing...>")]
+  [Item("Identical bin, three dimensional, GroupingVector-decoder", "<Description missing...>")]
   [StorableClass]
-  public class DeepestBottomLeftGroupingVectorDecoder : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      CuboidPackingItem>, I3DGVDecoder {
-
-    public DeepestBottomLeftGroupingVectorDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+  public class DeepestBottomLeftGroupingVectorDecoder : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DGVDecoder {
+    public DeepestBottomLeftGroupingVectorDecoder() : base() {}
     [StorableConstructor]
     protected DeepestBottomLeftGroupingVectorDecoder(bool deserializing) : base(deserializing) { }
@@ -58,14 +51,9 @@
     }
 
-
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as GroupingVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
-
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftMultiComponentVectorDecoder.cs	(revision 9596)
@@ -39,15 +39,8 @@
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
-  [Item("Identical bin three dimensional multi component vector decoder", "<Description missing...>")]
+  [Item("Identical bin, three dimensional, MultiComponentVector-decoder", "<Description missing...>")]
   [StorableClass]
-  public class DeepestBottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      CuboidPackingItem>, I3DMCVDecoder {
-
-    public DeepestBottomLeftMultiComponentVectorDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+  public class DeepestBottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DMCVDecoder {
+    public DeepestBottomLeftMultiComponentVectorDecoder() : base() { }
     [StorableConstructor]
     protected DeepestBottomLeftMultiComponentVectorDecoder(bool deserializing) : base(deserializing) { }
@@ -59,15 +52,9 @@
     }
 
-
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as MultiComponentVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponent Vector");
-
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/DBL/DeepestBottomLeftPackingSequenceDecoder.cs	(revision 9596)
@@ -38,15 +38,8 @@
 
 namespace HeuristicLab.Problems.BinPacking.Decoders {
-  [Item("Identical bin, three dimensional, direct permutation decoder", "<Description missing...>")]
+  [Item("Identical bin, three dimensional, PackingSequence-decoder", "<Description missing...>")]
   [StorableClass]
-  public class DeepestBottomLeftPackingSequenceDecoder : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      CuboidPackingItem>, I3DPSDecoder {
-
-    public DeepestBottomLeftPackingSequenceDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
+  public class DeepestBottomLeftPackingSequenceDecoder : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DPSDecoder {
+    public DeepestBottomLeftPackingSequenceDecoder(): base() {}
     [StorableConstructor]
     protected DeepestBottomLeftPackingSequenceDecoder(bool deserializing) : base(deserializing) { }
@@ -58,15 +51,9 @@
     }
 
-
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as PackingSequenceEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
-
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.DeepestLeftBottomPacking(solution, binMeasures, itemMeasures);
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures);
+      result.Pack(solution, 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointGroupingVectorDecoder3D.cs	(revision 9596)
@@ -42,17 +42,6 @@
   [Item("Identical bin, three dimensional, extreme points based decoder for the GroupingVector encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointGroupingVectorDecoder3D : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      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."));
-    }
+  public class ExtremePointGroupingVectorDecoder3D : PackingSolutionDecoder< ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DGVDecoder {
+    public ExtremePointGroupingVectorDecoder3D () : base() { }
     [StorableConstructor]
     protected ExtremePointGroupingVectorDecoder3D (bool deserializing) : base(deserializing) { }
@@ -65,17 +54,12 @@
 
     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);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, stackingConstraints);
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures, true, stackingConstraints);
+      result.Pack(solution, itemMeasures);
       return result;
     }
 
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-                      
       var solution = encodedSolution as GroupingVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
-
       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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointMultiComponentVectorDecoder3D.cs	(revision 9596)
@@ -43,17 +43,6 @@
   [Item("Identical bin, three dimensional, extreme points based decoder for the MultiComponentVector encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointMultiComponentVectorDecoder3D : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      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."));
-    }
+  public class ExtremePointMultiComponentVectorDecoder3D : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DMCVDecoder {
+    public ExtremePointMultiComponentVectorDecoder3D () : base() { }
     [StorableConstructor]
     protected ExtremePointMultiComponentVectorDecoder3D (bool deserializing) : base(deserializing) { }
@@ -66,17 +55,12 @@
 
     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);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, stackingConstraints);
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures, true, stackingConstraints);
+      result.Pack(solution, itemMeasures);
       return result;
     }
 
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as MultiComponentVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
-
       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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointPackingSequenceDecoder3D.cs	(revision 9596)
@@ -41,17 +41,6 @@
   [Item("Identical bin, three dimensional, extreme points based decoder for the PackingSequence encoding.", "<Description missing...>")]
   [StorableClass]
-  public class ExtremePointPackingSequenceDecoder3D : PackingSolutionDecoder<
-      ThreeDimensionalPacking,
-      CuboidPackingBin,
-      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."));
-    }
+  public class ExtremePointPackingSequenceDecoder3D : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DPSDecoder {
+    public ExtremePointPackingSequenceDecoder3D () : base() {}
     [StorableConstructor]
     protected ExtremePointPackingSequenceDecoder3D (bool deserializing) : base(deserializing) { }
@@ -65,13 +54,8 @@
 
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as PackingSequenceEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
-
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
-
-      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, StackingConstraintsParameter.Value.Value); 
-
+      PackingPlan3D result = new PackingPlan3D(binMeasures, true, StackingConstraintsParameter.Value.Value);
+      result.Pack(solution, itemMeasures); 
       return result;
     }
Index: anches/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 9595)
+++ 	(revision )
@@ -1,451 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Collections;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.IntegerVectorEncoding;
-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 ExtremePointsFunctions3D {
-
-
-    public static ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>> ExtremePointBasedPacking(ref MultiComponentVectorEncoding solution, 
-        ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures, bool stackingConstraints) {
-
-      #region Preperations
-      int nrOfBins = solution.NrOfBins;
-
-      //Get all indexes of items for every bin according to grouping-vector                      
-      Dictionary<int, List<PackingInformation>> unpackedItemIndexesPerBin = new Dictionary<int, List<PackingInformation>>();
-      Dictionary<int, HashSet<ThreeDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<ThreeDimensionalPacking>>();
-      var occupiedPoints = new List<int[, ,]>();
-
-      for (int i = 0; i < nrOfBins; i++) {        
-        unpackedItemIndexesPerBin[i] = new List<PackingInformation> (solution.PackingInformations[i]);
-
-        extremePointsForBin[i] = new HashSet<ThreeDimensionalPacking>();
-        extremePointsForBin[i].Add(new ThreeDimensionalPacking(i, 0, 0, 0, false));
-        occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-      }
-
-      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
-      var remainingItems = new List<PackingInformation>();
-
-      #endregion Preperations
-
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);
-          } else {
-            remainingItems.Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
-          }
-        }
-      }
-
-
-      //Packing of remaining items    
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<PackingInformation>(remainingItems);
-        //Iterate over all the remaining items
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);      
-            remainingItems.Remove(unpackedItems[i]);
-            solution.PackingInformations[binNr].Add(unpackedItems[i]);
-          }
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          extremePointsForBin[nrOfBins] = new HashSet<ThreeDimensionalPacking>();
-          extremePointsForBin[nrOfBins].Add(new ThreeDimensionalPacking(nrOfBins, 0, 0, 0, false));
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          solution.PackingInformations[nrOfBins] = new ItemList<PackingInformation>();
-          nrOfBins++;
-        }
-      }
-
-      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
-      int nrOfBins = solution.GroupingVector.Max() + 1;
-
-      //Get all indexes of items for every bin according to grouping-vector
-      Dictionary<int, List<int>> unpackedItemIndexesPerBin = new Dictionary<int, List<int>>();   
-      Dictionary<int, HashSet<ThreeDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<ThreeDimensionalPacking>>(); 
-      var occupiedPoints = new List<int[, ,]>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = solution.GroupingVector
-          .Select((Value, Index) => new { Value, Index })
-          .Where(temp => temp.Value == i)
-          .Select(temp => temp.Index).ToList();
-
-        extremePointsForBin[i] = new HashSet<ThreeDimensionalPacking>();
-        extremePointsForBin[i].Add(new ThreeDimensionalPacking(i, 0, 0, 0, false));    
-        occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-      }
-
-      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
-      var remainingItems = new List<int>();
-
-      #endregion Preperations
-
-              
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, stackingConstraints);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);
-          } else 
-            remainingItems.Add(itemIndex);
-        }
-      }
-
-
-
-      //Packing of remaining items    
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<int>(remainingItems);
-        //Iterate over all the remaining items
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i];
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures);
-          var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, stackingConstraints);
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures);        
-            remainingItems.Remove(itemIndex);
-          } 
-        }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          extremePointsForBin[nrOfBins] = new HashSet<ThreeDimensionalPacking>();
-          extremePointsForBin[nrOfBins].Add(new ThreeDimensionalPacking(nrOfBins, 0, 0, 0, false));
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          nrOfBins++;
-        }
-      }
-
-      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 
-      var itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();  
-      int nrOfBins = 1;
-
-      var occupiedPoints = new List<int[, ,]>();
-      occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-
-      HashSet<ThreeDimensionalPacking> extremePoints = new HashSet<ThreeDimensionalPacking>();
-      extremePoints.Add(new ThreeDimensionalPacking(0, 0, 0, 0, false));
-      #endregion
-
-      foreach (int itemIndex in solution.PackingSequence) {
-        var item = itemMeasures[itemIndex];
-        extremePoints = OrderExtremePoints(extremePoints, occupiedPoints, binMeasures);
-        var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions, stackingConstraints);
-        if (positionFound != null) {
-          extremePoints.Remove(positionFound); 
-        }
-        else {
-          positionFound = new ThreeDimensionalPacking(nrOfBins, 0, 0, 0);
-          occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          nrOfBins++;
-        }
-        itemPositions[itemIndex] = positionFound;
-        occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-        extremePoints = GenerateNewExtremePointsForNewItem(extremePoints, occupiedPoints, item, positionFound, binMeasures);
-      }
-
-      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, 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) {
-
-      var itemFromList = itemMeasures[itemIndex];
-      CuboidPackingItem item = new CuboidPackingItem(
-        rotated ? itemFromList.Depth : itemFromList.Width,
-        itemFromList.Height,
-        rotated ? itemFromList.Width : itemFromList.Depth,
-        itemFromList.TargetBin, itemFromList.Weight, itemFromList.Material);
-
-      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)) ||
-        !WeightIsSupported(occupiedPoints[extremePoints.ElementAt(epIndex).AssignedBin], item, extremePoints.ElementAt(epIndex), itemMeasures))) { epIndex++; }
-
-      if (epIndex < extremePoints.Count) {
-        var result = extremePoints.ElementAt(epIndex);
-        result.Rotated = rotated;
-        return result;
-      }
-      return null;
-    }
-    public static List<int[, ,]> IncreaseBinCountForOccupiedPoints(List<int[, ,]> occupiedPoints, CuboidPackingBin binMeasures) {
-      occupiedPoints.Add(new int[binMeasures.Width, binMeasures.Height, binMeasures.Depth]);
-      int lastIndex = occupiedPoints.Count - 1;
-      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[lastIndex][w, h, d] = -1;
-          }
-        }
-      }
-      return occupiedPoints;
-    }
-    public static bool IsStaticStable(int[, ,] occupiedPoints, 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 static bool WeightIsSupported(int[, ,] occupiedPoints, 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;
-    }
-    public static List<int[, ,]>  OccupyPointsForNewItem(List<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[position.AssignedBin][w,h,d] = itemIndex;
-          }
-        }
-      }
-      return occupiedPoints;
-    }
-    public static HashSet<ThreeDimensionalPacking> GenerateNewExtremePointsForNewItem(HashSet<ThreeDimensionalPacking> extremePoints, List<int[, ,]> occupiedPoints, 
-        CuboidPackingItem newItem, ThreeDimensionalPacking position, CuboidPackingBin binMeasures) {
-      int currentBin = position.AssignedBin;
-
-      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(currentBin, 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[currentBin][sourcePointX.X, currentYValue, sourcePointX.Z] == -1) {
-          currentYValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, sourcePointX.X, currentYValue, sourcePointX.Z));
-
-        //Traversing down the z-axis
-        int currentZValue = sourcePointX.Z;
-        while (currentZValue > 0 && occupiedPoints[currentBin][sourcePointX.X, sourcePointX.Y, currentZValue - 1] == -1) {
-          currentZValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, sourcePointX.X, sourcePointX.Y, currentZValue));
-      }
-
-
-
-
-      //Find ExtremePoints beginning from sourcepointY
-      var sourcePointY = new ThreeDimensionalPacking(currentBin, 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[currentBin][currentXValue - 1, sourcePointY.Y, sourcePointY.Z] == -1) {
-          currentXValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, currentXValue, sourcePointY.Y, sourcePointY.Z));
-
-        //Traversing down the z-axis
-        int currentZValue = sourcePointY.Z;
-        while (currentZValue > 0 && occupiedPoints[currentBin][sourcePointY.X, sourcePointY.Y, currentZValue - 1] == -1) {
-          currentZValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, sourcePointY.X, sourcePointY.Y, currentZValue));
-      }
-
-
-
-
-
-      //Find ExtremePoints beginning from sourcepointZ
-      var sourcePointZ = new ThreeDimensionalPacking(currentBin, 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[currentBin][currentXValue - 1, sourcePointZ.Y, sourcePointZ.Z] == -1) {
-          currentXValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, currentXValue, sourcePointZ.Y, sourcePointZ.Z));
-
-        //Traversing down the y-axis                                                                            
-        int currentYValue = sourcePointZ.Y;
-        while (currentYValue > 0 && occupiedPoints[currentBin][sourcePointZ.X, currentYValue, sourcePointZ.Z] == -1) {
-          currentYValue--;
-        }
-        extremePoints.Add(new ThreeDimensionalPacking(currentBin, sourcePointZ.X, currentYValue, sourcePointZ.Z));
-      }
-
-
-      return extremePoints;
-    }
-
-
-    public static HashSet<ThreeDimensionalPacking> OrderExtremePoints(HashSet<ThreeDimensionalPacking> hashSet, List<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)));
-    }
-    public static int ShortestPossibleSideFromEP(ThreeDimensionalPacking ep, List<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[ep.AssignedBin][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.AssignedBin][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.AssignedBin][ep.X, ep.Y, currentZ] == -1) { currentZ++; }
-      if (currentZ - ep.Z < shortestSide)
-        shortestSide = currentZ - ep.Z;
-
-      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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ISOContainerMultiComponentVectorDecoder3D.cs	(revision 9596)
@@ -60,128 +60,60 @@
 
     public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-      
-      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result =
-        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>();
-                                                                   /*
-      #region Preperations
-      int nrOfBins = solution.NrOfBins;
-                      
-      Dictionary<int, List<PackingInformation>> unpackedItemIndexesPerBin = new Dictionary<int, List<PackingInformation>>();
-      Dictionary<int, HashSet<ThreeDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<ThreeDimensionalPacking>>();  
-      ObservableDictionary<int, CuboidPackingBin> resultingBinMeasures = new ObservableDictionary<int, CuboidPackingBin>();
-      var occupiedPoints = new List<int[, ,]>();
+      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> resultPlan = new PackingPlan3D(binMeasures);
+      ObservableList<BinPacking3D> result = new ObservableList<BinPacking3D>();
 
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = new List<PackingInformation>(solution.PackingInformations[i]);
+      var sequenceMatrix = solution.GenerateSequenceMatrix();
+      Dictionary<int, bool> rotated = solution.GenerateRotationArray();
 
-        extremePointsForBin[i] = new HashSet<ThreeDimensionalPacking>();
-        extremePointsForBin[i].Add(new ThreeDimensionalPacking(i, 0, 0, 0, false));
-        occupiedPoints = ExtremePointsFunctions3D.IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-        resultingBinMeasures[i] = new CuboidPackingBin(binMeasures.Width, binMeasures.Height, binMeasures.Depth);
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        var bp = new BinPacking3D(binMeasures);
+        bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, true, rotated);
+        if (remainingIDs.Count > 0) {
+          bp.DoubleDepth();
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, true, rotated);
+        }
+        result.Add(bp);
       }
+      result.RemoveAll(x => x.ItemPositions.Count == 0);
+      result = new ObservableList<BinPacking3D>(result.OrderByDescending(bp => bp.PackingDensity));
 
-      ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>();
-      var remainingItems = new List<PackingInformation>();
-
-      #endregion Preperations
-
-
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        //Iterate over the current bin-item-list and find feasible positions in the current bin for each item
-        var unpackedItems = unpackedItemIndexesPerBin[binNr];
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = ExtremePointsFunctions3D.OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, resultingBinMeasures[binNr]);
-          var positionFound = ExtremePointsFunctions3D.FindExtremePointForItemUsingMaterialAndWeightConstraint(itemIndex, itemMeasures, resultingBinMeasures[binNr], extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-
-          if (positionFound == null && resultingBinMeasures[binNr].Depth.Equals(binMeasures.Depth)) {
-            occupiedPoints = DoubleDepthForBinNr(occupiedPoints, ref resultingBinMeasures, binNr);
-            positionFound = ExtremePointsFunctions3D.FindExtremePointForItemUsingMaterialAndWeightConstraint(itemIndex, itemMeasures, resultingBinMeasures[binNr], extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          } 
-
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = ExtremePointsFunctions3D.OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = ExtremePointsFunctions3D.GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, resultingBinMeasures[binNr]);
-          } else {
-            remainingItems.Add(unpackedItems[i]);
-            solution.PackingInformations[binNr].Remove(unpackedItems[i]);
+      //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], true);
+          if (remainingIDs.Count > 0) {
+            bp.DoubleDepth();
+            position = bp.FindExtremePointForItem(itemMeasures[id], rotated[id], true);
+          }
+          if (position != null) {
+            bp.PackItem(id, itemMeasures[id], position);
+            remainingIDs.Remove(id);
           }
         }
       }
 
-
-      //Packing of remaining items    
-      //Iterate over all bin-lists
-      for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) {
-        var unpackedItems = new List<PackingInformation>(remainingItems);
-        //Iterate over all the remaining items
-        for (int i = 0; i < unpackedItems.Count; i++) {
-          var itemIndex = unpackedItems[i].ItemID;
-          var item = itemMeasures[itemIndex];
-
-          extremePointsForBin[binNr] = ExtremePointsFunctions3D.OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, resultingBinMeasures[binNr]);
-          var positionFound = ExtremePointsFunctions3D.FindExtremePointForItemUsingMaterialAndWeightConstraint(itemIndex, itemMeasures, resultingBinMeasures[binNr], extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-
-
-          if (positionFound == null && resultingBinMeasures[binNr].Depth.Equals(binMeasures.Depth)) {
-            occupiedPoints = DoubleDepthForBinNr(occupiedPoints, ref resultingBinMeasures, binNr);
-            positionFound = ExtremePointsFunctions3D.FindExtremePointForItemUsingMaterialAndWeightConstraint(itemIndex, itemMeasures, resultingBinMeasures[binNr], extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated);
-          } 
-          
-          if (positionFound != null) {
-            extremePointsForBin[binNr].Remove(positionFound);
-            itemPositions[itemIndex] = positionFound;
-            occupiedPoints = ExtremePointsFunctions3D.OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex);
-            extremePointsForBin[binNr] = ExtremePointsFunctions3D.GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, resultingBinMeasures[binNr]);
-            remainingItems.Remove(unpackedItems[i]);
-            solution.PackingInformations[binNr].Add(unpackedItems[i]);
-          }
+      //Put still remaining items in new bins
+      while (remainingIDs.Count > 0) {
+        var bp = new BinPacking3D(binMeasures);
+        bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, true, rotated);
+        if (remainingIDs.Count > 0) {
+          bp.DoubleDepth();
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, true, rotated);
         }
-        if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) {
-          extremePointsForBin[nrOfBins] = new HashSet<ThreeDimensionalPacking>();
-          extremePointsForBin[nrOfBins].Add(new ThreeDimensionalPacking(nrOfBins, 0, 0, 0, false));
-          occupiedPoints = ExtremePointsFunctions3D.IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures);
-          resultingBinMeasures[nrOfBins] = new CuboidPackingBin(binMeasures.Width, binMeasures.Height, binMeasures.Depth);
-          solution.PackingInformations[nrOfBins] = new ItemList<PackingInformation>();
-          nrOfBins++;
-        }
+        result.Add(bp);
       }
-
-      result.BinPackings = BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>.GetBinPackings(itemPositions, resultingBinMeasures, itemMeasures, nrOfBins);   */
-      return result;
-    }
-
-    private static List<int[, ,]> DoubleDepthForBinNr(List<int[, ,]> occupiedPoints, ref ObservableDictionary<int, CuboidPackingBin> binMeasures, int binNr) {
-      var oldDepth = binMeasures[binNr].Depth;
-      binMeasures[binNr].Depth = binMeasures[binNr].Depth * 2;
-      var newBinOccupation = new int[binMeasures[binNr].Width, binMeasures[binNr].Height, binMeasures[binNr].Depth];
-      for (int w = 0; w < binMeasures[binNr].Width; w++) {
-        for (int h = 0; h < binMeasures[binNr].Height; h++) {
-          for (int d = 0; d < binMeasures[binNr].Depth; d++) {
-            if (d < oldDepth)
-              newBinOccupation[w, h, d] = occupiedPoints[binNr][w, h, d];
-            else
-              newBinOccupation[w, h, d] = -1;
-          }
-        }
-      }
-
-      occupiedPoints[binNr] = newBinOccupation;
-      return occupiedPoints;
+      result.RemoveAll(x => x.ItemPositions.Count == 0); 
+      resultPlan.BinPackings = new ObservableList<BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>>(result.OrderByDescending(bp => bp.PackingDensity));
+      return resultPlan;
     }
 
 
-
-
     public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
-
       var solution = encodedSolution as MultiComponentVectorEncoding;
       if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
-
       return Decode(solution, binMeasures, itemMeasures);
     }
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/ThreeDimensionalPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/ThreeDimensionalPackingFunctions.cs	(revision 9595)
+++ 	(revision )
@@ -1,205 +1,0 @@
-﻿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: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/ExtremePointsFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/ExtremePointsFunctions.cs	(revision 9595)
+++ 	(revision )
@@ -1,51 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Collections;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.IntegerVectorEncoding;
-using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
-using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
-using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
-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 ExtremePointsFunctions<D,B,I>
-    where D : class, IPackingDimensions
-    where B : PackingShape<D>, IPackingBin, IRegularPackingShape
-      where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
-
-
-    public static ObservableDictionary<int, D> ExtremePointBasedPacking(IItem solution, B binMeasures, ItemList<I> itemMeasures) {
-      var actualSolutionMCV = solution as MultiComponentVectorEncoding;
-      var actualSolutionGV = solution as GroupingVectorEncoding;    
-      var actualSolutionPS = solution as PackingSequenceEncoding;
-      if (actualSolutionMCV != null)
-        return ExtremePointBasedPacking(actualSolutionMCV, binMeasures, itemMeasures);
-      else if (actualSolutionGV != null)
-        return ExtremePointBasedPacking(actualSolutionGV, binMeasures, itemMeasures);
-      else  if (actualSolutionPS != null)
-        return ExtremePointBasedPacking(actualSolutionPS, binMeasures, itemMeasures);
-      else
-        return new ObservableDictionary<int,D>();
-    }
-
-    public static ObservableDictionary<int, D> ExtremePointBasedPacking(MultiComponentVectorEncoding solution, B binMeasures, ItemList<I> itemMeasures) {
-
-    }
-
-    public static ObservableDictionary<int, D> ExtremePointBasedPacking(GroupingVectorEncoding solution, B binMeasures, ItemList<I> itemMeasures) {
-
-    }
-
-    public static ObservableDictionary<int, D> ExtremePointBasedPacking(PackingSequenceEncoding solution, B binMeasures, ItemList<I> itemMeasures) {
-
-    }
-    
-  }
-}
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/IB2DLowestGapFillGroupingVectorDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/IB2DLowestGapFillGroupingVectorDecoder.cs	(revision 9595)
+++ 	(revision )
@@ -1,160 +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 System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Core;
-using HeuristicLab.Problems.BinPacking.Dimensions;
-using HeuristicLab.Problems.BinPacking.PackingBin;
-using HeuristicLab.Problems.BinPacking.PackingItem;
-using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Common;
-using HeuristicLab.Data;
-using HeuristicLab.Collections;
-using HeuristicLab.Problems.BinPacking.Interfaces;
-using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
-using HeuristicLab.Encodings.IntegerVectorEncoding;
-
-namespace HeuristicLab.Problems.BinPacking.Decoders {
-  [Item("Lowest Gap Fill Grouping-Vector Decoder", "<Description missing...>")]
-  [StorableClass]
-  public class IB2DLowestGapFillGroupingVectorDecoder : IdenticalBinPackingSolutionDecoder<
-      TwoDimensionalPacking,
-      RectangularPackingBin,
-      RectangularPackingItem,
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>> {
-
-    public IB2DLowestGapFillGroupingVectorDecoder()
-      : base() {
-        //EncodedSolutionParameter.ActualName = "EncodedSolution";
-    }
-    [StorableConstructor]
-    protected IB2DLowestGapFillGroupingVectorDecoder(bool deserializing) : base(deserializing) { }
-    protected IB2DLowestGapFillGroupingVectorDecoder(IB2DLowestGapFillGroupingVectorDecoder original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new IB2DLowestGapFillGroupingVectorDecoder(this, cloner);
-    }
-
-
-    protected override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IPackingSolutionEncoding encodedSolution) {
-
-      var solution = encodedSolution as IntegerVector;
-      if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
-
-      var binMeasures = PackingBinMeasuresParameter.ActualValue;
-      var itemMeasures = PackingItemMeasuresParameter.ActualValue;
-
-      ObservableDictionary<int, TwoDimensionalPacking> packingPositions = new ObservableDictionary<int, TwoDimensionalPacking>();
-
-      int nrOfBins = solution.Max();
-
-      //Get all indexes of items for every bin according to grouping-vector
-      //It is assumed, that at this point the item-indexes are sorted according to their item-size!
-      Dictionary<int, List<int>> unpackedItemIndexesPerBin              = new Dictionary<int, List<int>>();
-
-      for (int i = 0; i < nrOfBins; i++) {
-        unpackedItemIndexesPerBin[i] = solution
-          .Select((Value, Index) => new { Value, Index })
-          .Where (temp => temp.Value == i)
-          .Select (temp => temp.Index).ToList();  
-      }
-
-
-
-      //Steps 1-6
-      //2
-      int currentBin = 0;    
-      
-      //3
-      //Take the first position from the first bin
-      TwoDimensionalPacking currentPoint = new TwoDimensionalPacking(currentBin, 0, 0);
-   
-      //4
-      //Assuming that Height is always the shorter edge due to normalizing..
-      int currentGap = binMeasures.Height;
-
-      //5
-      //Take the first (and largest) item for the first bin
-      int currentItemIndex = unpackedItemIndexesPerBin[currentBin][0];
-      RectangularPackingItem currentItem = itemMeasures[currentItemIndex];
-      packingPositions[currentItemIndex] = currentPoint;
-      //6
-      unpackedItemIndexesPerBin[currentBin].RemoveAt(0);
-
-
-      //Steps 7-13          
-
-      //TODO: the first parameter (bin-list) is not finished yet.. it should resemble the used bins in the packing plan..
-      PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
-        new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(
-          binMeasures, 
-          itemMeasures);
-
-      result.PackingItemPositions = packingPositions;
-      return result;
-    }
-
-    //protected override TwoDimensionalPacking FindFeasiblePositionForItem(RectangularPackingBin binMeasures, int binNr, RectangularPackingItem currentItem, ObservableDictionary<int, TwoDimensionalPacking> itemPositions, ItemList<RectangularPackingItem> itemMeasures) {
-    //  //Starting-position at upper right corner (=left bottom point of item-rectangle is at position item.width,item.height)
-    //  TwoDimensionalPacking currentPosition = new TwoDimensionalPacking(binNr, binMeasures.Width - currentItem.Width, binMeasures.Height - currentItem.Height);           
-    //  //Slide the item as far as possible to the bottom
-    //  while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveDown(currentPosition), itemPositions, itemMeasures)) {
-    //    currentPosition = MoveDown(currentPosition);
-    //  }
-    //  //Slide the item as far as possible to the left
-    //  while (IsPositionFeasible(binMeasures, binNr, currentItem, MoveLeft(currentPosition), itemPositions, itemMeasures)) {
-    //    currentPosition = MoveLeft(currentPosition);
-    //  }
-
-    //  return IsPositionFeasible(binMeasures, binNr, currentItem, currentPosition, itemPositions, itemMeasures) ? currentPosition : null;
-    //}
-
-    //private bool IsPositionFeasible(RectangularPackingBin binMeasures, int binNr, 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;
-    //  var itemsWithPositions = itemMeasures.
-    //    Select((Value, Index) => new { Value, Index }).
-    //    Where(s => itemPositions.ContainsKey(s.Index)).
-    //    Select((s) => new { Measures = itemMeasures[s.Index], Position = itemPositions[s.Index]});
-
-    //  foreach (var itemWithPosition in itemsWithPositions) {
-    //    if (itemWithPosition.Position.AssignedBin == binNr && itemWithPosition.Measures.Overlaps(itemWithPosition.Position, currentPosition, currentItem))
-    //      return false;
-    //  }
-    //  return true;
-    //}
-
-    //private TwoDimensionalPacking MoveLeft(TwoDimensionalPacking original) {
-    //  return new TwoDimensionalPacking(original.AssignedBin, original.X - 1, original.Y);
-    //}
-    //private TwoDimensionalPacking MoveDown(TwoDimensionalPacking original) {
-    //  return new TwoDimensionalPacking(original.AssignedBin, original.X, original.Y - 1);
-    //}
-  }
-}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/PackingSolutionDecoder.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/PackingSolutionDecoder.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/PackingSolutionDecoder.cs	(revision 9596)
@@ -59,4 +59,7 @@
       get { return (ILookupParameter<PackingPlan<D, B, I>>)Parameters["PackingPlan"]; }
     }
+    public ValueParameter<BoolValue> StackingConstraintsParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; }
+    }
 
 
@@ -67,4 +70,5 @@
       Parameters.Add(new LookupParameter<ItemList<I>>("PackingItemMeasures", "Packing-item data taken from the bin-packing problem-instance."));
       Parameters.Add(new LookupParameter<B>("PackingBinMeasures", "Packing-bin data taken from the bin-packing problem-instance."));
+      Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not."));
     }
 
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/SequentialPackingFunctions.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/SequentialPackingFunctions.cs	(revision 9595)
+++ 	(revision )
@@ -1,564 +1,0 @@
-﻿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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints.cs	(revision 9596)
@@ -33,12 +33,13 @@
   [Item("Occupated Points", "A datastructure holding all currently occupied points of a packing-bin.")]
   [StorableClass]
-  public abstract class OccupiedPoints<D, I> : Item
+  public abstract class OccupiedPoints<D, B, I> : Item
     where D : class, IPackingDimensions
+    where B : PackingShape<D>, IPackingBin
     where I : PackingShape<D>, IPackingItem {
 
-    public OccupiedPoints() : base() { }
+    public OccupiedPoints(B binMeasures) : base() { }
     [StorableConstructor]
     protected OccupiedPoints(bool deserializing) : base(deserializing) { }
-    protected OccupiedPoints(OccupiedPoints<D,I> original, Cloner cloner)
+    protected OccupiedPoints(OccupiedPoints<D,B,I> original, Cloner cloner)
       : base(original, cloner) {
     }
@@ -51,5 +52,5 @@
     public abstract bool IsStaticStable(I item, D ep);
     public abstract bool WeightIsSupported(I item, D ep, ItemList<I> items);
-  
+    public abstract void ChangeBinMeasures(B binMeasures);
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints2D.cs	(revision 9596)
@@ -35,10 +35,10 @@
   [Item("Occupated Points 2D", "A datastructure holding all currently occupied points of a 2D packing-bin.")]
   [StorableClass]
-  public class OccupiedPoints2D : OccupiedPoints<TwoDimensionalPacking, RectangularPackingItem> {
+  public class OccupiedPoints2D : OccupiedPoints<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> {
                    
     [Storable]
     private int[,] occupiedPoints { get; set; }
 
-    public OccupiedPoints2D(RectangularPackingBin binMeasures) : base() {
+    public OccupiedPoints2D(RectangularPackingBin binMeasures) : base(binMeasures) {
       occupiedPoints = new int[binMeasures.Width, binMeasures.Height];
       for (int w = 0; w < binMeasures.Width; w++) {
@@ -67,5 +67,4 @@
       return true;
     }
-
     public override void OccupyPoints(RectangularPackingItem measures, TwoDimensionalPacking position, int itemID) {
       int width = position.Rotated ? measures.Height : measures.Width;
@@ -77,9 +76,7 @@
       }
     }
-
     public override bool IsPointOccupied(TwoDimensionalPacking point) {
       return occupiedPoints[point.X, point.Y] != -1;
     }
-
     public override int ShortestPossibleSideFromEP(TwoDimensionalPacking ep) {
       int shortestSide = int.MaxValue;
@@ -102,13 +99,15 @@
       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;
+      throw new NotImplementedException();
     }
     public override bool WeightIsSupported(RectangularPackingItem item, TwoDimensionalPacking ep, ItemList<RectangularPackingItem> items) {
       return true;
     }
+    public override void ChangeBinMeasures(RectangularPackingBin binMeasures) {
+      throw new NotImplementedException();
+    }
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/OccupiedPoints3D.cs	(revision 9596)
@@ -35,10 +35,10 @@
   [Item("Occupied Points 3D", "A datastructure holding all currently occupied points of a 3D packing-bin.")]
   [StorableClass]
-  public class OccupiedPoints3D : OccupiedPoints<ThreeDimensionalPacking, CuboidPackingItem> {
+  public class OccupiedPoints3D : OccupiedPoints<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> {
 
     [Storable]
     private int[, ,] occupiedPoints { get; set; }
 
-    public OccupiedPoints3D(CuboidPackingBin binMeasures) {
+    public OccupiedPoints3D(CuboidPackingBin binMeasures) : base(binMeasures) {
       occupiedPoints = new int[binMeasures.Width, binMeasures.Height, binMeasures.Depth];
       for (int w = 0; w < binMeasures.Width; w++) {
@@ -71,5 +71,4 @@
       return true;
     }
-
     public override void OccupyPoints(CuboidPackingItem measures, ThreeDimensionalPacking position, int itemID) {
       int width = position.Rotated ? measures.Depth : measures.Width;
@@ -83,9 +82,7 @@
       }
     }
-
     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;
@@ -114,6 +111,4 @@
       return shortestSide;
     }
-
-
     public override bool IsStaticStable(CuboidPackingItem item, ThreeDimensionalPacking ep) {
       //Static stability is given, if item is placed on the ground
@@ -164,5 +159,19 @@
       return false;
     }
-  
+    public override void ChangeBinMeasures(CuboidPackingBin binMeasures) {
+      int oldDepth = occupiedPoints.GetLength(2);
+      var newBinOccupation = 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++) {
+            if (d < oldDepth)
+              newBinOccupation[w, h, d] = occupiedPoints[w, h, d];
+            else
+              newBinOccupation[w, h, d] = -1;
+          }
+        }
+      }
+      occupiedPoints = newBinOccupation;
+    }
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/ThreeDimensionalPacking.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/ThreeDimensionalPacking.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/ThreeDimensionalPacking.cs	(revision 9596)
@@ -81,4 +81,24 @@
       return base.GetHashCode() + 13 * X + 17 * Y + 23 * Z;
     }
+
+    public static ThreeDimensionalPacking MoveLeft(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Z, original.Rotated);
+    }
+    public static ThreeDimensionalPacking MoveDown(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Z, original.Rotated);
+    }
+    public static ThreeDimensionalPacking MoveBack(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z - 1, original.Rotated);
+    }
+
+    public static ThreeDimensionalPacking MoveRight(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X + 1, original.Y, original.Z, original.Rotated);
+    }
+    public static ThreeDimensionalPacking MoveUp(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y + 1, original.Z, original.Rotated);
+    }
+    public static ThreeDimensionalPacking MoveFront(ThreeDimensionalPacking original) {
+      return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z + 1, original.Rotated);
+    }
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/TwoDimensionalPacking.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/TwoDimensionalPacking.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/TwoDimensionalPacking.cs	(revision 9596)
@@ -77,4 +77,19 @@
       return base.GetHashCode() + 13 * X + 17 * Y;
     }
+
+    public static TwoDimensionalPacking MoveLeft(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Rotated);
+    }
+    public static TwoDimensionalPacking MoveDown(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Rotated);
+    }
+
+    public static TwoDimensionalPacking MoveRight(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X + 1, original.Y, original.Rotated);
+    }
+    public static TwoDimensionalPacking MoveUp(TwoDimensionalPacking original) {
+      return new TwoDimensionalPacking(original.AssignedBin, original.X, original.Y + 1, original.Rotated);
+    }
+
   }
 }
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorEncoding.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorEncoding.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorEncoding.cs	(revision 9596)
@@ -20,4 +20,6 @@
 #endregion
 
+using System.Collections.Generic;
+using System.Linq;
 using System.Text;
 using HeuristicLab.Common;
@@ -50,4 +52,17 @@
         GroupingVector = new IntegerVector();
     }
+
+    public List<List<int>> GenerateSequenceMatrix() {
+      List<List<int>> result = new List<List<int>>();
+      int nrOfBins = GroupingVector.Max() + 1;
+      for (int i = 0; i < nrOfBins; i++)
+        result.Add(new List<int>());
+      for (int i = 0; i < GroupingVector.Length; i++) {
+        result[GroupingVector[i]].Add(i);
+      }
+      return result;
+    }
+    
+
 
     public override string ToString() {
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/BinBasedMultiComponentVectorCrossover.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/BinBasedMultiComponentVectorCrossover.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/BinBasedMultiComponentVectorCrossover.cs	(revision 9596)
@@ -33,36 +33,40 @@
   public class BinBasedMultiComponentVectorCrossover :  MultiComponentVectorCrossover {
     [StorableConstructor]
-    protected BinBasedMultiComponentVectorCrossover (bool deserializing) : base(deserializing) { }
-    protected BinBasedMultiComponentVectorCrossover (BinBasedMultiComponentVectorCrossover  original, Cloner cloner) : base(original, cloner) { }
-    public BinBasedMultiComponentVectorCrossover ()
+    protected BinBasedMultiComponentVectorCrossover(bool deserializing) : base(deserializing) { }
+    protected BinBasedMultiComponentVectorCrossover(BinBasedMultiComponentVectorCrossover original, Cloner cloner) : base(original, cloner) { }
+    public BinBasedMultiComponentVectorCrossover()
       : base() {
     }
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new BinBasedMultiComponentVectorCrossover (this, cloner);
+      return new BinBasedMultiComponentVectorCrossover(this, cloner);
     }
 
     public override MultiComponentVectorEncoding Cross(IRandom random, MultiComponentVectorEncoding parent1, MultiComponentVectorEncoding parent2) {
-      MultiComponentVectorEncoding child = new MultiComponentVectorEncoding();
+      MultiComponentVectorEncoding child = new MultiComponentVectorEncoding ();
+
       int nrOfItems = parent1.NrOfItems;
       bool[] itemAlreadyAssigned = new bool[nrOfItems];
-
-      bool useParent2 = false;
       int nrOfBins = parent1.NrOfBins > parent2.NrOfBins ? parent2.NrOfBins : parent1.NrOfBins;
 
+      //Add one bin from parent1
+      int swappedBinNr = random.Next(nrOfBins);
+      var swappedBin = new ItemList<PackingInformation>();
+      for (int i = 0; i < parent1.PackingInformations[swappedBinNr].Count; i++) {
+        PackingInformation pi = new PackingInformation(parent1.PackingInformations[swappedBinNr][i]);
+        if (!itemAlreadyAssigned[pi.ItemID]) {
+          itemAlreadyAssigned[pi.ItemID] = true;
+          swappedBin.Add(new PackingInformation(pi));
+        }
+      }
+      child.PackingInformations[swappedBinNr] = swappedBin;
 
+      //Get the remaining bins from parent2
       for (int binNr = 0; binNr < nrOfBins; binNr++) {
-        MultiComponentVectorEncoding currentParent1 = useParent2 ? parent2 : parent1;
-        MultiComponentVectorEncoding currentParent2 = useParent2 ? parent1 : parent2;
-
-
-        var newBin = new ItemList<PackingInformation>();
-        double crossPointPercent = 0;
-
-        int nrOfItems1 = currentParent1.PackingInformations[binNr].Count;
-        if (nrOfItems1 > 0) {
-          double crossPoint1 = random.Next(nrOfItems1);
-          crossPointPercent = crossPoint1 / nrOfItems1;
-          for (int i = 0; i < crossPoint1; i++) {
-            PackingInformation pi = new PackingInformation(currentParent1.PackingInformations[binNr][i]);
+        if (binNr != swappedBinNr) {
+          var newBin = new ItemList<PackingInformation>();
+          var currentParent = 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;
@@ -70,22 +74,9 @@
             }
           }
+          child.PackingInformations[binNr] = newBin;
         }
-
-        int nrOfItems2 = currentParent2.PackingInformations[binNr].Count;
-        if (nrOfItems2 > 0) {
-          int crossPoint2 = Convert.ToInt32(nrOfItems2 * crossPointPercent);
-          for (int i = crossPoint2; i < nrOfItems2; i++) {
-            PackingInformation pi = new PackingInformation(currentParent2.PackingInformations[binNr][i]);
-            if (!itemAlreadyAssigned[pi.ItemID]) {
-              itemAlreadyAssigned[pi.ItemID] = true;
-              newBin.Add(new PackingInformation(pi));
-            }
-          }
-        }
-
-        child.PackingInformations[binNr] = newBin;
-        useParent2 = !useParent2;
       }
 
+      //Pack still remaining items in bin#0
       for (int itemID = 0; itemID < nrOfItems; itemID++) {
         if (!itemAlreadyAssigned[itemID])
@@ -93,5 +84,5 @@
       }
 
-      
+
       return child;
     }       
Index: anches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/ExperimentalMultiComponentVectorCrossover.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/ExperimentalMultiComponentVectorCrossover.cs	(revision 9595)
+++ 	(revision )
@@ -1,96 +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.Collections;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.BinPacking.Interfaces;
-
-namespace HeuristicLab.Encodings.PackingEncoding.MultiComponentVector {
-  [Item("Experimental Multi Component Vector Crossover", "An operator which crosses two MultiComponentVector representations.")]
-  [StorableClass]
-  public class ExperimentalMultiComponentVectorCrossover  :  MultiComponentVectorCrossover {
-    [StorableConstructor]
-    protected ExperimentalMultiComponentVectorCrossover (bool deserializing) : base(deserializing) { }
-    protected ExperimentalMultiComponentVectorCrossover (ExperimentalMultiComponentVectorCrossover  original, Cloner cloner) : base(original, cloner) { }
-    public ExperimentalMultiComponentVectorCrossover ()
-      : base() {
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new ExperimentalMultiComponentVectorCrossover (this, cloner);
-    }
-
-    public override MultiComponentVectorEncoding Cross(IRandom random, MultiComponentVectorEncoding parent1, MultiComponentVectorEncoding parent2) {
-      MultiComponentVectorEncoding child = new MultiComponentVectorEncoding ();
-      int nrOfItems = parent1.NrOfItems;
-      bool[] itemAlreadyAssigned = new bool[nrOfItems];
-
-      bool useParent2 = false;
-      int nrOfBins = parent1.NrOfBins > parent2.NrOfBins ? parent2.NrOfBins : parent1.NrOfBins;
-      for (int binNr = 0; binNr < nrOfBins; binNr++) { 
-        MultiComponentVectorEncoding currentParent1 = useParent2 ? parent2 : parent1;
-        MultiComponentVectorEncoding currentParent2 = useParent2 ? parent1 : parent2;
-
-                  
-        var newBin = new ItemList<PackingInformation>();
-        double crossPointPercent = 0;
-
-        int nrOfItems1 = currentParent1.PackingInformations[binNr].Count;
-        if (nrOfItems1 > 0) {
-          double crossPoint1 = random.Next(nrOfItems1);
-          crossPointPercent = crossPoint1 / nrOfItems1; 
-          for (int i = 0; i < crossPoint1; i++) {
-            PackingInformation pi = new PackingInformation(currentParent1.PackingInformations[binNr][i]);
-            if (!itemAlreadyAssigned[pi.ItemID]) {
-              itemAlreadyAssigned[pi.ItemID] = true;
-              newBin.Add(new PackingInformation(pi));
-            }
-          }
-        }
-
-        int nrOfItems2 = currentParent2.PackingInformations[binNr].Count;
-        if (nrOfItems2 > 0) {
-          int crossPoint2 = Convert.ToInt32(nrOfItems2 * crossPointPercent);
-          for (int i = crossPoint2; i < nrOfItems2; i++) {
-            PackingInformation pi = new PackingInformation(currentParent2.PackingInformations[binNr][i]);
-            if (!itemAlreadyAssigned[pi.ItemID]) {
-              itemAlreadyAssigned[pi.ItemID] = true;
-              newBin.Add(new PackingInformation(pi));
-            }
-          }
-        }
-
-        child.PackingInformations[binNr] = newBin;    
-        useParent2 = !useParent2;
-      }
-
-      for (int itemID = 0; itemID < nrOfItems; itemID++) {
-        if (!itemAlreadyAssigned[itemID])
-          child.PackingInformations[random.Next(nrOfBins)].Add(new PackingInformation(itemID, random.Next(2) == 0 ? true : false));
-      }
-
-      return child;
-    }       
-  }
-}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs	(revision 9596)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Text;
 using HeuristicLab.Collections;
@@ -64,5 +65,26 @@
       : base() {
         PackingInformations = new ObservableDictionary<int, ItemList<PackingInformation>>();
-    }       
+    }
+
+    public List<List<int>> GenerateSequenceMatrix() {
+      List<List<int>> result = new List<List<int>>();
+      foreach (var bi in PackingInformations) {
+        var temp = new List<int>();
+        foreach (var piEntry in bi.Value) {
+          temp.Add(piEntry.ItemID);
+        }
+        result.Add(temp);
+      }
+      return result;
+    }
+    public Dictionary<int, bool> GenerateRotationArray() {
+      Dictionary<int, bool> result = new Dictionary<int, bool>();
+      foreach (var bi in PackingInformations)
+        foreach (var pi in bi.Value)
+          result[pi.ItemID] = pi.Rotated;
+      return result;
+    }
+
+
 
     public override string ToString() {
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/SequenceBasedMultiComponentVectorCrossover.cs	(revision 9596)
@@ -33,36 +33,57 @@
   public class SequenceBasedMultiComponentVectorCrossover :  MultiComponentVectorCrossover {
     [StorableConstructor]
-    protected SequenceBasedMultiComponentVectorCrossover(bool deserializing) : base(deserializing) { }
-    protected SequenceBasedMultiComponentVectorCrossover(SequenceBasedMultiComponentVectorCrossover original, Cloner cloner) : base(original, cloner) { }
-    public SequenceBasedMultiComponentVectorCrossover()
+    protected SequenceBasedMultiComponentVectorCrossover (bool deserializing) : base(deserializing) { }
+    protected SequenceBasedMultiComponentVectorCrossover (SequenceBasedMultiComponentVectorCrossover  original, Cloner cloner) : base(original, cloner) { }
+    public SequenceBasedMultiComponentVectorCrossover ()
       : base() {
     }
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new SequenceBasedMultiComponentVectorCrossover(this, cloner);
+      return new SequenceBasedMultiComponentVectorCrossover (this, cloner);
     }
 
     public override MultiComponentVectorEncoding Cross(IRandom random, MultiComponentVectorEncoding parent1, MultiComponentVectorEncoding parent2) {
-      MultiComponentVectorEncoding child = new MultiComponentVectorEncoding ();
-
+      MultiComponentVectorEncoding child = new MultiComponentVectorEncoding();
       int nrOfItems = parent1.NrOfItems;
       bool[] itemAlreadyAssigned = new bool[nrOfItems];
+
+      bool useParent2 = false;
       int nrOfBins = parent1.NrOfBins > parent2.NrOfBins ? parent2.NrOfBins : parent1.NrOfBins;
-      int swappedBin = random.Next(nrOfBins);
+
 
       for (int binNr = 0; binNr < nrOfBins; binNr++) {
+        MultiComponentVectorEncoding currentParent1 = useParent2 ? parent2 : parent1;
+        MultiComponentVectorEncoding currentParent2 = useParent2 ? parent1 : parent2;
+
 
         var newBin = new ItemList<PackingInformation>();
-        var currentParent = binNr == swappedBin ? parent1 : parent2;
+        double crossPointPercent = 0;
 
-        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));
+        int nrOfItems1 = currentParent1.PackingInformations[binNr].Count;
+        if (nrOfItems1 > 0) {
+          double crossPoint1 = random.Next(nrOfItems1);
+          crossPointPercent = crossPoint1 / nrOfItems1;
+          for (int i = 0; i < crossPoint1; i++) {
+            PackingInformation pi = new PackingInformation(currentParent1.PackingInformations[binNr][i]);
+            if (!itemAlreadyAssigned[pi.ItemID]) {
+              itemAlreadyAssigned[pi.ItemID] = true;
+              newBin.Add(new PackingInformation(pi));
+            }
+          }
+        }
+
+        int nrOfItems2 = currentParent2.PackingInformations[binNr].Count;
+        if (nrOfItems2 > 0) {
+          int crossPoint2 = Convert.ToInt32(nrOfItems2 * crossPointPercent);
+          for (int i = crossPoint2; i < nrOfItems2; i++) {
+            PackingInformation pi = new PackingInformation(currentParent2.PackingInformations[binNr][i]);
+            if (!itemAlreadyAssigned[pi.ItemID]) {
+              itemAlreadyAssigned[pi.ItemID] = true;
+              newBin.Add(new PackingInformation(pi));
+            }
           }
         }
 
         child.PackingInformations[binNr] = newBin;
+        useParent2 = !useParent2;
       }
 
@@ -72,5 +93,5 @@
       }
 
-
+      
       return child;
     }       
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking.cs	(revision 9596)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking.cs	(revision 9596)
@@ -0,0 +1,137 @@
+﻿#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.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Parameters;
+using HeuristicLab.Data;
+using HeuristicLab.Collections;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+
+namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
+  [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 {
+    #region Properties
+    [Storable]
+    public ObservableDictionary<int, D> ItemPositions { get; private set; } 
+
+    [Storable]
+    public ObservableDictionary<int, I> ItemMeasures { get; private set; }
+
+    [Storable]
+    public B BinMeasures { get; private set; }
+
+    [Storable]
+    public HashSet<D> ExtremePoints { get; protected set; }
+
+    //[Storable]
+    //public OccupiedPoints<D, B, I> OccupiedPoints { get; protected set; }
+    #endregion Properties
+
+    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 stackingConstraints);
+    public abstract D FindPositionBySliding(I measures, bool rotated);
+
+    public abstract void SlidingBasedPacking(ref List<int> sequence, ItemList<I> itemMeasures);
+    public abstract void SlidingBasedPacking(ref List<int> sequence, ItemList<I> itemMeasures, Dictionary<int, bool> rotationArray);
+    public abstract void ExtremePointBasedPacking(ref List<int> sequence, ItemList<I> itemMeasures, bool stackingConstraints);
+    public abstract void ExtremePointBasedPacking(ref List<int> sequence, ItemList<I> itemMeasures, bool stackingConstraints, Dictionary<int, bool> rotationArray);
+
+    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 IsPointOccupied(D position) {
+      foreach (var ipEntry in ItemPositions) {
+        if (ItemMeasures[ipEntry.Key].EnclosesPoint(ipEntry.Value, position))
+          return true;
+      }
+
+      return false;
+    }
+    public bool IsPositionFeasible(I currentItem, D position) {
+      //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;
+
+      foreach (var ipEntry in ItemPositions) {
+        if (ItemMeasures[ipEntry.Key].Overlaps(ipEntry.Value, position, currentItem))
+          return false;
+      }
+
+      return true;
+    }
+    public abstract int ShortestPossibleSideFromPoint (D position);
+    public abstract bool IsStaticStable (I item, D position);
+    
+    //public bool IsPositionFeasible1(I currentItem, D position) {
+    //  if (!BinMeasures.Encloses(position, currentItem))
+    //    return false;
+
+    //  return OccupiedPoints.IsPositionFeasible (currentItem, position);
+    //}
+  }   
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking2D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking2D.cs	(revision 9596)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking2D.cs	(revision 9596)
@@ -0,0 +1,194 @@
+﻿#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.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Parameters;
+using HeuristicLab.Data;
+using HeuristicLab.Collections;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+
+namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
+  [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 && !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 && !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.X).
+        ThenBy(ep => ep.Y).
+        ThenBy(ep => ShortestPossibleSideFromPoint(ep)));
+    }
+
+    public override TwoDimensionalPacking FindExtremePointForItem(RectangularPackingItem measures, bool rotated, bool stackingConstraints) {
+      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, TwoDimensionalPacking.MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, TwoDimensionalPacking.MoveDown(currentPosition))) {
+        //Slide the item as far as possible to the bottom
+          while (IsPositionFeasible(measures, TwoDimensionalPacking.MoveDown(currentPosition))) {
+            currentPosition = TwoDimensionalPacking.MoveDown(currentPosition);
+        }
+          if (IsPositionFeasible(measures, TwoDimensionalPacking.MoveLeft(currentPosition)))
+          currentPosition = TwoDimensionalPacking.MoveLeft(currentPosition);
+      }
+
+      return IsPositionFeasible(measures, currentPosition) ? currentPosition : null;
+    }
+    
+    public override void SlidingBasedPacking(ref List<int> sequence, ItemList<RectangularPackingItem> itemMeasures) {
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        var position = FindPositionBySliding(item, false);
+        if (position != null) {
+          PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+    }
+    public override void SlidingBasedPacking(ref List<int> sequence, ItemList<RectangularPackingItem> itemMeasures, Dictionary<int, bool> rotationArray) {
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        var position = FindPositionBySliding(item, rotationArray[temp[i]]);
+        if (position != null) {
+          PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+    }
+    public override void ExtremePointBasedPacking(ref List<int> sequence, ItemList<RectangularPackingItem> itemMeasures, bool stackingConstraints) {
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = FindExtremePointForItem(item, false, false);
+        if (positionFound != null) {
+          PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+    }
+    public override void ExtremePointBasedPacking(ref List<int> sequence, ItemList<RectangularPackingItem> itemMeasures, bool stackingConstraints, Dictionary<int, bool> rotationArray) {
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = FindExtremePointForItem(item, rotationArray[itemID], false);
+        if (positionFound != null) {
+          PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+    }
+
+
+    public override int ShortestPossibleSideFromPoint(TwoDimensionalPacking position) {
+      int shortestSide = int.MaxValue;
+      int width = BinMeasures.Width;
+      int height = BinMeasures.Height;
+
+      if (position.X >= width || position.Y >= height)
+        return shortestSide;
+
+      TwoDimensionalPacking current = new TwoDimensionalPacking(0, position.X, position.Y);
+      while (current.X < width && IsPointOccupied(current)) { current = TwoDimensionalPacking.MoveRight(current); }
+      if (current.X - position.X < shortestSide)
+        shortestSide = current.X - position.X;
+
+
+      current = new TwoDimensionalPacking(0, position.X, position.Y);
+      while (current.Y < height && IsPointOccupied(current)) { current = TwoDimensionalPacking.MoveUp(current); }
+      if (current.Y - position.Y < shortestSide)
+        shortestSide = current.Y - position.Y;
+
+      return shortestSide;
+    }
+    public override bool IsStaticStable(RectangularPackingItem item, TwoDimensionalPacking position) {
+      throw new NotImplementedException();
+    }
+  }
+}
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking3D.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking3D.cs	(revision 9596)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking3D.cs	(revision 9596)
@@ -0,0 +1,293 @@
+﻿#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.Problems.BinPacking.PackingItem;
+using HeuristicLab.Problems.BinPacking.Shapes;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+using HeuristicLab.Parameters;
+using HeuristicLab.Data;
+using HeuristicLab.Collections;
+using HeuristicLab.Problems.BinPacking.Dimensions;
+using HeuristicLab.Problems.BinPacking.PackingBin;
+
+namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
+  [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) {
+        this.depthWasDoubled = original.depthWasDoubled;
+    }
+    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 && !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 && !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 && !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 && !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 && !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 && !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.Z).
+        ThenBy(ep => ep.X).
+        ThenBy(ep => ep.Y).
+        ThenBy(ep => ShortestPossibleSideFromPoint(ep)));
+    }
+
+    public override ThreeDimensionalPacking FindExtremePointForItem(CuboidPackingItem measures, bool rotated, bool stackingConstraints) {
+
+      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)) || (stackingConstraints && !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, ThreeDimensionalPacking.MoveDown(currentPosition))
+        || IsPositionFeasible(measures, ThreeDimensionalPacking.MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) {
+        //Slide the item as far as possible to the left
+          while (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveLeft(currentPosition))
+        || IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) {
+          //Slide the item as far as possible to the back
+          while (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) {
+            currentPosition = ThreeDimensionalPacking.MoveBack(currentPosition);
+          }
+          if (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveLeft(currentPosition)))
+            currentPosition = ThreeDimensionalPacking.MoveLeft(currentPosition);
+        }
+          if (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveDown(currentPosition)))
+            currentPosition = ThreeDimensionalPacking.MoveDown(currentPosition);
+      }
+
+      return IsPositionFeasible(measures, currentPosition) ? currentPosition : null;
+    }
+    
+    public override void SlidingBasedPacking(ref List<int> sequence, ItemList<CuboidPackingItem> itemMeasures) {
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        var position = FindPositionBySliding(item, false);
+        if (position != null) {
+          PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+    }
+    public override void SlidingBasedPacking(ref List<int> sequence, ItemList<CuboidPackingItem> itemMeasures, Dictionary<int, bool> rotationArray) {
+      var temp = new List<int>(sequence);
+      for (int i = 0; i < temp.Count; i++) {
+        var item = itemMeasures[temp[i]];
+        var position = FindPositionBySliding(item, rotationArray[i]);
+        if (position != null) {
+          PackItem(temp[i], item, position);
+          sequence.Remove(temp[i]);
+        }
+      }
+    }
+    public override void ExtremePointBasedPacking(ref List<int> sequence, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints) {
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = FindExtremePointForItem(item, false, stackingConstraints);
+        if (positionFound != null) {
+          PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+    }
+    public override void ExtremePointBasedPacking(ref List<int> sequence, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints, Dictionary<int, bool> rotationArray) {
+      var temp = new List<int>(sequence);
+      foreach (int itemID in temp) {
+        var item = itemMeasures[itemID];
+        var positionFound = FindExtremePointForItem(item, rotationArray[itemID], stackingConstraints);
+        if (positionFound != null) {
+          PackItem(itemID, item, positionFound);
+          sequence.Remove(itemID);
+        }
+      }
+    }
+    
+
+    [Storable]
+    private bool depthWasDoubled = false;
+    public void DoubleDepth() {
+      if (!depthWasDoubled) {
+        var oldDepth = BinMeasures.Depth;
+        BinMeasures.Depth = BinMeasures.Depth * 2;
+        //OccupiedPoints.ChangeBinMeasures(BinMeasures);
+        depthWasDoubled = true;
+      }
+    }
+
+    public override int ShortestPossibleSideFromPoint(ThreeDimensionalPacking position) {
+
+      int shortestSide = int.MaxValue;
+      int width = BinMeasures.Width;
+      int height = BinMeasures.Height;
+      int depth = BinMeasures.Depth;
+
+      if (position.X >= width || position.Y >= height || position.Z >= depth)
+        return shortestSide;
+
+      ThreeDimensionalPacking current = new ThreeDimensionalPacking (0, position.X, position.Y, position.Z);
+      while (current.X < width && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveRight(current); }
+      if (current.X - position.X < shortestSide)
+        shortestSide = current.X - position.X;
+
+
+      current = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z);
+      while (current.Y < height && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveUp (current); }
+      if (current.Y - position.Y < shortestSide)
+        shortestSide = current.Y - position.Y;
+
+
+      current = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z);
+      while (current.Z < depth && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveFront(current); }
+      if (current.Z - position.Z < shortestSide)
+        shortestSide = current.Z - position.Z;
+
+      return shortestSide;
+    }
+    public override bool IsStaticStable(CuboidPackingItem item, ThreeDimensionalPacking position) {
+      //Static stability is given, if item is placed on the ground
+      if (position.Y == 0)
+        return true;
+
+      if (IsPointOccupied (new ThreeDimensionalPacking (0, position.X, position.Y - 1, position.Z))
+        && IsPointOccupied (new ThreeDimensionalPacking (0, position.X + item.Width - 1, position.Y - 1, position.Z))
+        && IsPointOccupied (new ThreeDimensionalPacking (0, position.X, position.Y - 1, position.Z + item.Depth - 1))
+        && IsPointOccupied (new ThreeDimensionalPacking (0, position.X + item.Width - 1, position.Y - 1, position.Z + item.Depth - 1)))
+        return true;
+
+
+      //if (occupiedPoints[position.X, position.Y - 1, position.Z] != -1
+      //  && occupiedPoints[position.X + item.Width - 1, position.Y - 1, position.Z] != -1
+      //  && occupiedPoints[position.X, position.Y - 1, position.Z + item.Depth - 1] != -1
+      //  && occupiedPoints[position.X + item.Width - 1, position.Y - 1, position.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;
+    }
+  }
+}
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs	(revision 9596)
@@ -35,9 +35,12 @@
 using HeuristicLab.Problems.BinPacking.Dimensions;
 using HeuristicLab.Problems.BinPacking.PackingBin;
+using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
+using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
+using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
 
 namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
   [Item("PackingPlan", "Represents a concrete solution for a bin-packing problem.")]
   [StorableClass]
-  public class PackingPlan<D, B, I> : ParameterizedNamedItem, IPackingPlan
+  public abstract class PackingPlan<D, B, I> : ParameterizedNamedItem, IPackingPlan
     where D : class, IPackingDimensions
     where B : PackingShape<D>, IPackingBin
@@ -52,4 +55,11 @@
       }
     }
+    [Storable]
+    protected bool StackingConstraints { get; set; }
+    [Storable]
+    protected bool UseExtremePoints { get; set; }
+
+    [Storable]
+    public B BinMeasures { get; private set; }
 
     [Storable]
@@ -71,11 +81,10 @@
     #endregion
 
-    public PackingPlan(B binMeasures)
-      : this(){
-      //this.BinPackings.Add(new BinPacking<D,B,I> ());
-    }
-    public PackingPlan()
-      : base() {
-      this.BinPackings = new ObservableList<BinPacking<D, B,I>>();
+    public PackingPlan(B binMeasures, bool useExtremePoints, bool stackingConstraints)
+      : base(){
+        BinMeasures = (B)binMeasures.Clone();
+        StackingConstraints = stackingConstraints;
+        UseExtremePoints = useExtremePoints;
+        BinPackings = new ObservableList<BinPacking<D, B, I>>();
     }
 
@@ -86,8 +95,104 @@
         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 abstract BinPacking<D, B, I> NewBinPacking();
+    public void UpdateBinPackings() {
+      BinPackings.RemoveAll(x => x.ItemPositions.Count == 0);
+      BinPackings = new ObservableList<BinPacking<D, B, I>>(BinPackings.OrderByDescending (bp => bp.PackingDensity));
+    }
+
+    public void Pack(MultiComponentVectorEncoding solution, ItemList<I> itemMeasures) {
+      var sequenceMatrix = solution.GenerateSequenceMatrix();
+      Dictionary<int, bool> rotated = solution.GenerateRotationArray();
+
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        var bp = NewBinPacking();
+        if (!UseExtremePoints)
+          bp.SlidingBasedPacking(ref remainingIDs, itemMeasures, rotated);
+        else
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, StackingConstraints, rotated);
+        BinPackings.Add(bp);
+      }
+      UpdateBinPackings();
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in BinPackings) {
+          var position = UseExtremePoints ? bp.FindExtremePointForItem(itemMeasures[id], rotated[id], StackingConstraints) : 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) {
+        var bp = NewBinPacking();
+        if (!UseExtremePoints)
+          bp.SlidingBasedPacking(ref remainingIDs, itemMeasures, rotated);
+        else
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, StackingConstraints, rotated);
+        BinPackings.Add(bp);
+      }
+      UpdateBinPackings();
+    }
+    public void Pack(GroupingVectorEncoding solution, ItemList<I> itemMeasures) {
+      var sequenceMatrix = solution.GenerateSequenceMatrix();
+
+      //Fill bins according to grouping vector
+      List<int> remainingIDs = new List<int>();
+      foreach (var sequence in sequenceMatrix) {
+        remainingIDs = remainingIDs.Concat(sequence).ToList();
+        var bp = NewBinPacking();
+        if (!UseExtremePoints)
+          bp.SlidingBasedPacking(ref remainingIDs, itemMeasures);
+        else
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, StackingConstraints);
+        BinPackings.Add(bp);
+      }
+      UpdateBinPackings();
+
+      //Try to put remaining items in existing bins
+      var temp = new List<int>(remainingIDs);
+      foreach (int id in temp) {
+        foreach (var bp in BinPackings) {  
+          var position = UseExtremePoints ? bp.FindExtremePointForItem (itemMeasures[id], false, StackingConstraints) : 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) {
+        var bp = NewBinPacking();
+        if (!UseExtremePoints)
+          bp.SlidingBasedPacking(ref remainingIDs, itemMeasures);
+        else
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, StackingConstraints);
+        BinPackings.Add(bp);
+      }
+      UpdateBinPackings();
+    }
+    public void Pack(PackingSequenceEncoding solution, ItemList<I> itemMeasures) {
+      List<int> remainingIDs = new List<int>(solution.PackingSequence);
+      while (remainingIDs.Count > 0) {
+        var bp = NewBinPacking();
+        if (!UseExtremePoints)
+          bp.SlidingBasedPacking(ref remainingIDs, itemMeasures);
+        else
+          bp.ExtremePointBasedPacking(ref remainingIDs, itemMeasures, StackingConstraints);
+        BinPackings.Add(bp);
+      }
+      UpdateBinPackings();
+    }
+
 
     #region Events
@@ -126,83 +231,22 @@
   }
 
-  [Item("BinPacking", "Represents a single-bin packing for a bin-packing problem.")]
+
+
+
+  [Item("PackingPlan2D", "Represents a concrete solution for a 2D 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);
-    }
-
+  public class PackingPlan2D : PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> {
+    public PackingPlan2D(RectangularPackingBin binMeasures) : this(binMeasures, false, false) { }
+    public PackingPlan2D(RectangularPackingBin binMeasures, bool useExtremePoints, bool stackingConstraints) : base(binMeasures, useExtremePoints, stackingConstraints) { } 
     [StorableConstructor]
-    protected BinPacking(bool deserializing) : base(deserializing) { }
-    protected BinPacking(BinPacking<D,B,I> original, Cloner cloner)
+    protected PackingPlan2D(bool deserializing) : base(deserializing) { }
+    protected PackingPlan2D(PackingPlan2D 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);
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PackingPlan2D(this, cloner);
+    }
+    public override BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> NewBinPacking() {
+      return new BinPacking2D(BinMeasures);
     }
   }
@@ -212,246 +256,21 @@
 
 
-  [Item("BinPacking2D", "Represents a single-bin packing for a 2D bin-packing problem.")]
+  [Item("PackingPlan3D", "Represents a concrete solution for a 3D bin-packing problem.")]
   [StorableClass]
-  public class BinPacking2D : BinPacking<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> {
-
-    public BinPacking2D(RectangularPackingBin binMeasures) : base(binMeasures) {
-      OccupiedPoints = new OccupiedPoints2D(binMeasures);
-    }
+  public class PackingPlan3D : PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> {
+    public PackingPlan3D(CuboidPackingBin binMeasures) : this(binMeasures, false, false) { }
+    public PackingPlan3D(CuboidPackingBin binMeasures, bool useExtremePoints, bool stackingConstraints) : base(binMeasures, useExtremePoints, stackingConstraints) { } 
     [StorableConstructor]
-    protected BinPacking2D(bool deserializing) : base(deserializing) { }
-    protected BinPacking2D(BinPacking2D original, Cloner cloner)
+    protected PackingPlan3D(bool deserializing) : base(deserializing) { }
+    protected PackingPlan3D(PackingPlan3D 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);
+      return new PackingPlan3D(this, cloner);
+    }
+    public override BinPacking<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> NewBinPacking() {
+      return new BinPacking3D(BinMeasures);
     }
   }
 
-
-
-  [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/PackingPlans/RegularSimpleRotationPackingPlan.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/RegularSimpleRotationPackingPlan.cs	(revision 9595)
+++ 	(revision )
@@ -1,68 +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 System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Problems.BinPacking.Interfaces;
-using HeuristicLab.Problems.BinPacking.PackingItem;
-using HeuristicLab.Problems.BinPacking.Shapes;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Core;
-using HeuristicLab.Common;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
-  //RegularPackingPlan defines that the packingItems have to be parallel to the packingBin in every moment
-  //SimpleRotation defines that the items may be rotated 
-  //  only in one dimension, 
-  //  only once and 
-  //  only by 90degree
-  //    so that parallelism to the correlating bin is ensured
-  //This definition implies that the floor of the (3D) objects never changes (what may be a wanted constraint in most cases..)
-  [Item("RegularSimpleRotationPackingPlan", "Represents a concrete solution for a bin-packing problem using simple rotation (90degrees-steps) and regular shapes (e.g. rectangle)")]
-  [StorableClass]
-  public class RegularSimpleRotationPackingPlan<D, B, I> : PackingPlan<D, B, I>
-    where D : class, IPackingDimensions
-    where B : PackingShape<D>, IRegularPackingShape, IPackingBin
-    where I : PackingShape<D>, IRegularPackingShape, IPackingItem {
-    
-    #region Properties
-    public ItemList<BoolValue> PackingItemsRotated { get; set; }
-    #endregion
-
-    public RegularSimpleRotationPackingPlan(B binMeasures, ItemList<I> itemMeasures) : base(binMeasures, itemMeasures) {
-
-    }
-
-    [StorableConstructor]
-    protected RegularSimpleRotationPackingPlan(bool deserializing) : base(deserializing) { }
-    protected RegularSimpleRotationPackingPlan(RegularSimpleRotationPackingPlan<D,B,I> original, Cloner cloner)
-      : base(original, cloner) {
-        PackingItemsRotated = cloner.Clone(original.PackingItemsRotated);
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new RegularSimpleRotationPackingPlan<D,B,I>(this, cloner);
-    }
-
-  }
-}
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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj	(revision 9596)
@@ -166,9 +166,7 @@
     <Compile Include="Analyzers\BinPackingAnalyzer.cs" />
     <Compile Include="Decoders\2D\BL\BottomLeftMultiComponentVectorDecoder.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\3D\ThreeDimensionalPackingFunctions.cs" />
     <Compile Include="Decoders\3D\EP\ExtremePointMultiComponentVectorDecoder3D.cs" />
     <Compile Include="Decoders\3D\EP\ExtremePointGroupingVectorDecoder3D.cs" />
@@ -180,11 +178,5 @@
     <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" />
@@ -211,6 +203,6 @@
     <Compile Include="Encodings\GroupingVector\GroupingVectorManipulator.cs" />
     <Compile Include="Encodings\GroupingVector\GroupingVectorRandomCreator.cs" />
+    <Compile Include="Encodings\MultiComponentVector\SequenceBasedMultiComponentVectorCrossover.cs" />
     <Compile Include="Encodings\MultiComponentVector\BinBasedMultiComponentVectorCrossover.cs" />
-    <Compile Include="Encodings\MultiComponentVector\SequenceBasedMultiComponentVectorCrossover.cs" />
     <Compile Include="Encodings\MultiComponentVector\Moves\Multi\Attributes\ChangePositionMoveAttribute.cs" />
     <Compile Include="Encodings\MultiComponentVector\Moves\Triple\Attributes\MCVTripleMoveAttribute.cs" />
@@ -241,4 +233,7 @@
     <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorRandomCreator.cs" />
     <Compile Include="Encodings\MultiComponentVector\ThreeWayMultiComponentVectorManipulator.cs" />
+    <Compile Include="Encodings\PackingPlans\BinPacking2D.cs" />
+    <Compile Include="Encodings\PackingPlans\BinPacking3D.cs" />
+    <Compile Include="Encodings\PackingPlans\BinPacking.cs" />
     <Compile Include="Encodings\PackingPlans\PackingPlan.cs" />
     <Compile Include="Encodings\PackingSequence\Moves\Insertion\ExhaustiveInsertionMoveGenerator.cs" />
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Instances/BPPORLIBParser.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Instances/BPPORLIBParser.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Instances/BPPORLIBParser.cs	(revision 9596)
@@ -90,5 +90,5 @@
 
       for (int k = 0; k < Items; k++) {
-        if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream.");
+        if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream (at line " + k + ").");
         var valLine = reader.ReadLine();
         while (String.IsNullOrWhiteSpace(valLine)) valLine = reader.ReadLine();
@@ -101,16 +101,21 @@
       }
 
-      int problemClassNr = int.Parse(problemClass[0]);
-      Name = (isThreeDimensional ? "3" : "2") + "dbpp_class_0" + problemClassNr;
-      if (!isThreeDimensional) {
-        if (problemClassNr >= 1 && problemClassNr <= 5)
-          Description = "Proposed by Berkey and Wang.";
-        else if (problemClassNr >= 6 && problemClassNr <= 10)
-          Description = "Proposed by Martello and Vigo.";
+      Int32 problemClassNr = -1;
+      if (int.TryParse(problemClass[0], out problemClassNr)) {
+        Name = (isThreeDimensional ? "3" : "2") + "dbpp_class_0" + problemClassNr;
+        if (!isThreeDimensional) {
+          if (problemClassNr >= 1 && problemClassNr <= 5)
+            Description = "Proposed by Berkey and Wang.";
+          else if (problemClassNr >= 6 && problemClassNr <= 10)
+            Description = "Proposed by Martello and Vigo.";
+        } else {
+          if (problemClassNr >= 1 && problemClassNr <= 5)
+            Description = "Proposed by Martello and Vigo.";
+          else if (problemClassNr >= 6 && problemClassNr <= 9)
+            Description = "Proposed by Berkey and Wang.";
+        }
       } else {
-        if (problemClassNr >= 1 && problemClassNr <= 5)
-          Description = "Proposed by Martello and Vigo.";
-        else if (problemClassNr >= 6 && problemClassNr <= 9)
-          Description = "Proposed by Berkey and Wang.";
+        Name = "Unknown";
+        Description = "<Missing>";
       }
       
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs	(revision 9596)
@@ -26,5 +26,5 @@
   /// Plugin class for HeuristicLab.Problems.BinPacking plugin.
   /// </summary>
-  [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9563")]
+  [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9593")]
   [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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs	(revision 9596)
@@ -55,5 +55,14 @@
     public override ThreeDimensionalPacking Origin { get { return new ThreeDimensionalPacking(0, 0, 0, 0); } }
     public override int MultipliedMeasures { get { return Width * Height * Depth; } }
-   
+
+    public override bool EnclosesPoint(ThreeDimensionalPacking myPosition, ThreeDimensionalPacking checkedPoint) {
+      var c = new CuboidDiagonal(myPosition, this);
+      return (c.x1 <= checkedPoint.X &&
+                c.x2 >= checkedPoint.X &&
+                c.y1 <= checkedPoint.Y &&
+                c.y2 >= checkedPoint.Y &&
+                c.z1 <= checkedPoint.Z &&
+                c.z2 >= checkedPoint.Z);
+    }
     public override bool Encloses(ThreeDimensionalPacking checkedPosition, PackingShape<ThreeDimensionalPacking> checkedShape) {
       return Encloses(checkedPosition, (CuboidPackingShape) 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 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs	(revision 9596)
@@ -39,4 +39,5 @@
     }
 
+    public abstract bool EnclosesPoint(D myPosition, D checkedPoint);
     public abstract bool Encloses(D checkedPosition, PackingShape<D> checkedShape);
     public abstract bool Overlaps(D myPosition, D checkedPosition, PackingShape<D> checkedShape);
Index: /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs
===================================================================
--- /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs	(revision 9595)
+++ /branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs	(revision 9596)
@@ -51,4 +51,11 @@
     public override int MultipliedMeasures { get { return Height * Width; } }
 
+    public override bool EnclosesPoint(TwoDimensionalPacking myPosition, TwoDimensionalPacking checkedPoint) {
+      var r = new RectangleDiagonal(myPosition, this);
+      return (r.x1 <= checkedPoint.X &&
+                r.x2 >= checkedPoint.X &&
+                r.y1 <= checkedPoint.Y &&
+                r.y2 >= checkedPoint.Y);
+    }
     public override bool Encloses(TwoDimensionalPacking checkedPosition, PackingShape<TwoDimensionalPacking> checkedShape) {
       return Encloses(checkedPosition, (RectangularPackingShape)checkedShape);
