Index: /branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Instances/RandomInstanceProviderWithSRand.cs
===================================================================
--- /branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Instances/RandomInstanceProviderWithSRand.cs	(revision 15422)
+++ /branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Instances/RandomInstanceProviderWithSRand.cs	(revision 15423)
@@ -26,4 +26,5 @@
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -33,18 +34,25 @@
 namespace HeuristicLab.Problems.BinPacking3D {
   // make sure that for each class we have a separate entry in the problem instance providers
+  
   public class RandomInstanceClass1ProviderWithSRand : RandomInstanceProviderWithSRand {
     public RandomInstanceClass1ProviderWithSRand() : base() { @class = 1; binWidth = binHeight = binDepth = 100; }
-  }
+    
+  }
+
   public class RandomInstanceClass2ProviderWithSRand : RandomInstanceProviderWithSRand {
     public RandomInstanceClass2ProviderWithSRand() : base() { @class = 2; binWidth = binHeight = binDepth = 100; }
+    
   }
   public class RandomInstanceClass3ProviderWithSRand : RandomInstanceProviderWithSRand {
     public RandomInstanceClass3ProviderWithSRand() : base() { @class = 3; binWidth = binHeight = binDepth = 100; }
+    
   }
   public class RandomInstanceClass4ProviderWithSRand : RandomInstanceProviderWithSRand {
     public RandomInstanceClass4ProviderWithSRand() : base() { @class = 4; binWidth = binHeight = binDepth = 100; }
+    
   }
   public class RandomInstanceClass5ProviderWithSRand : RandomInstanceProviderWithSRand {
     public RandomInstanceClass5ProviderWithSRand() : base() { @class = 5; binWidth = binHeight = binDepth = 100; }
+    
   }
 
@@ -55,7 +63,7 @@
     }
     protected override void SampleItemParameters(IRandom rand, out int w, out int h, out int d) {
-      w = rand.Next(1, 11);
-      h = rand.Next(1, 11);
-      d = rand.Next(1, 11);
+      w = rand.Next(1, 10);
+      h = rand.Next(1, 10);
+      d = rand.Next(1, 10);
     }
   }
@@ -66,7 +74,7 @@
     }
     protected override void SampleItemParameters(IRandom rand, out int w, out int h, out int d) {
-      w = rand.Next(1, 36);
-      h = rand.Next(1, 36);
-      d = rand.Next(1, 36);
+      w = rand.Next(1, 35);
+      h = rand.Next(1, 35);
+      d = rand.Next(1, 35);
     }
   }
@@ -77,7 +85,7 @@
     }
     protected override void SampleItemParameters(IRandom rand, out int w, out int h, out int d) {
-      w = rand.Next(1, 101);
-      h = rand.Next(1, 101);
-      d = rand.Next(1, 101);
+      w = rand.Next(1, 100);
+      h = rand.Next(1, 100);
+      d = rand.Next(1, 100);
     }
   }
@@ -87,4 +95,15 @@
 
   public abstract class RandomInstanceProviderWithSRand : ProblemInstanceProvider<BPPData>, IProblemInstanceProvider<BPPData> {
+
+    /// <summary>
+    /// Number of created test items. This items are used for packing them into the bin
+    /// </summary>
+    private static readonly int[] numberOfGeneratedTestItems = new int[] { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 150, 200 };    
+
+    /// <summary>
+    /// Number of instance for which should be created for each instance
+    /// </summary>
+    private static readonly int numberOfGeneratedInstances = 30;
+
     #region Random Generator srand48
     protected class SRand48 : Item, IRandom {
@@ -173,4 +192,6 @@
     protected int binWidth, binHeight, binDepth;
 
+    #region Common information for displaying it on the ui
+    
     public override string Name {
       get { return string.Format("Martello, Pisinger, Vigo (class={0})", @class); }
@@ -189,21 +210,27 @@
     }
 
+    #endregion
     public RandomInstanceProviderWithSRand() : base() { }
 
+    
+    /// <summary>
+    /// Returns a collection of data descriptors. Each descriptor contains the seed for the random generator.
+    /// </summary>
+    /// <returns></returns>
     public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
       // 10 classes
-      //var rand = new MersenneTwister(1234); // fixed seed to makes sure that instances are always the same
-      foreach (int numItems in new int[] { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 150, 200 }) {
-        // get class parameters
-        // generate 30 different instances for each class
-        foreach (int instance in Enumerable.Range(1, 30)) {
-          var rand = new SRand48((uint)(numItems + instance));
+      foreach (int numItems in numberOfGeneratedTestItems) {
+        for (int instance = 1; instance <= numberOfGeneratedInstances; instance++) {
           string name = string.Format("n={0}-id={1:00} (class={2})", numItems, instance, @class);
-          var dd = new RandomDataDescriptor(name, name, numItems, @class, seed: rand.Next());
-          yield return dd;
-        }
-      }
-    }
-
+          /* As in the test programm of Silvano Martello, David Pisinger, Daniele Vigo given, 
+           * the seed of the instance provider will be calculated by adding the number of generated items and teh instance number.
+           * This guarantees that the instances will always be the same
+           */
+          yield return new RandomDataDescriptor(name, name, numItems, @class, seed: numItems + instance);
+        }
+      }
+    }
+
+    
     public override BPPData LoadData(IDataDescriptor dd) {
       var randDd = dd as RandomDataDescriptor;
@@ -224,77 +251,82 @@
     }
 
-    // default implementation for class 1 .. 5
+    
+    /// <summary>
+    /// Generates the dimensions for a item by using the given random generator
+    /// </summary>
+    /// <param name="rand">Given random generator</param>
+    /// <param name="w">Calculated width of the item</param>
+    /// <param name="h">Calculated height of the item</param>
+    /// <param name="d">Calculated depth of the item</param>
     protected virtual void SampleItemParameters(IRandom rand, out int w, out int h, out int d) {
-      // for classes 1 - 5
       Contract.Assert(@class >= 1 && @class <= 5);
-      var weights = new double[] { 0.1, 0.1, 0.1, 0.1, 0.1 };
+      /*var weights = new double[] { 0.1, 0.1, 0.1, 0.1, 0.1 };
       weights[@class - 1] = 0.6;
       var type = Enumerable.Range(1, 5).SampleProportional(rand, 1, weights).First();
-
-      int minW, maxW;
-      int minH, maxH;
-      int minD, maxD;
-      GetItemParameters(type, rand, binWidth, binHeight, binDepth,
-        out minW, out maxW, out minH, out maxH, out minD, out maxD);
-
-      w = rand.Next(minW, maxW + 1);
-      h = rand.Next(minH, maxH + 1);
-      d = rand.Next(minD, maxD + 1);
-    }
-
-    private void GetItemParameters(int type, IRandom rand,
-      int w, int h, int d,
-      out int minW, out int maxW, out int minH, out int maxH, out int minD, out int maxD) {
+      */
+
+      // as by Martello and Vigo
+      int type = @class;
+      if (type <= 5) {
+        var t = rand.Next(1, 10);
+        if (t <= 5) {
+          type = t;
+        }
+      }
+
       switch (type) {
-        case 1: {
-            minW = 1;
-            maxW = w / 2; // integer division on purpose (see paper)
-            minH = h * 2 / 3;
-            maxH = h;
-            minD = d * 2 / 3;
-            maxD = d;
-            break;
-          }
-        case 2: {
-            minW = w * 2 / 3;
-            maxW = w;
-            minH = 1;
-            maxH = h / 2;
-            minD = d * 2 / 3;
-            maxD = d;
-            break;
-          }
-        case 3: {
-            minW = w * 2 / 3;
-            maxW = w;
-            minH = h * 2 / 3;
-            maxH = h;
-            minD = 1;
-            maxD = d / 2;
-            break;
-          }
-        case 4: {
-            minW = w / 2;
-            maxW = w;
-            minH = h / 2;
-            maxH = h;
-            minD = d / 2;
-            maxD = d;
-            break;
-          }
-        case 5: {
-            minW = 1;
-            maxW = w / 2;
-            minH = 1;
-            maxH = h / 2;
-            minD = 1;
-            maxD = d / 2;
-            break;
-          }
-        default: {
+        case 1:
+          CreateInstanceDimensionsType1(rand, out w, out h, out d);
+          break;
+        case 2:
+          CreateInstanceDimensionsType2(rand, out w, out h, out d);
+          break;
+        case 3:
+          CreateInstanceDimensionsType3(rand, out w, out h, out d);
+          break;
+        case 4:
+          CreateInstanceDimensionsType4(rand, out w, out h, out d);
+          break;
+        case 5:
+          CreateInstanceDimensionsType5(rand, out w, out h, out d);
+          break;
+        default: 
             throw new InvalidProgramException();
-          }
-      }
-    }
+      }
+    }
+
+    
+    #region Instance dimensions generators for type 1 - 5
+    private void CreateInstanceDimensionsType1(IRandom rand, out int w, out int h, out int d) {
+      w = rand.Next(1, binWidth / 2);
+      h = rand.Next((binHeight * 2) / 3, binHeight);
+      d = rand.Next((binDepth * 2) / 3, binDepth);
+    }
+
+    private void CreateInstanceDimensionsType2(IRandom rand, out int w, out int h, out int d) {
+      w = rand.Next(((binWidth * 2) / 3), binWidth);
+      h = rand.Next(1, binHeight / 2);
+      d = rand.Next(((binDepth * 2) / 3), binDepth);
+    }
+
+    private void CreateInstanceDimensionsType3(IRandom rand, out int w, out int h, out int d) {
+      w = rand.Next(((binWidth * 2) / 3), binWidth);
+      h = rand.Next(((binHeight * 2) / 3), binHeight);
+      d = rand.Next(1, binDepth / 2);
+    }
+    private void CreateInstanceDimensionsType4(IRandom rand, out int w, out int h, out int d) {
+      w = rand.Next(binWidth / 2, binWidth);
+      h = rand.Next(binHeight / 2, binHeight);
+      d = rand.Next(binDepth / 2, binDepth);
+    }
+    private void CreateInstanceDimensionsType5(IRandom rand, out int w, out int h, out int d) {
+      w = rand.Next(1, binWidth / 2);
+      h = rand.Next(1, binHeight / 2);
+      d = rand.Next(1, binDepth / 2);
+    }
+   
+    #endregion
+
+
 
     public override bool CanImportData {
@@ -323,10 +355,8 @@
           else
             writer.WriteLine("{0,-5} {1,-5} {2,-5}", instance.Items[i].Width, instance.Items[i].Height, instance.Items[i].Depth);
-
         }
         writer.Flush();
       }
     }
-
   }
 }
Index: /branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/AlgorithmTest.cs
===================================================================
--- /branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/AlgorithmTest.cs	(revision 15422)
+++ /branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/AlgorithmTest.cs	(revision 15423)
@@ -8,192 +8,192 @@
 
 namespace HeuristicLab.Problems.BinPacking.Tests {
-    [TestClass]
-    public class AlgorithmTest {
+  [TestClass]
+  public class AlgorithmTest {
 
-        private struct Dimension {
-            public int Id { get; set; }
-            public int Width { get; set; }
-            public int Height { get; set; }
-            public int Depth { get; set; }
+    private struct Dimension {
+      public int Id { get; set; }
+      public int Width { get; set; }
+      public int Height { get; set; }
+      public int Depth { get; set; }
+    }
+
+    #region TestRandomInstanceProvider
+
+
+    /// <summary>
+    /// Tests if the generated random instance equals to the references generated by david pisinger 
+    /// http://www.diku.dk/~pisinger/new3dbpp/test3dbpp.c
+    /// </summary>
+    [TestMethod]
+    [TestCategory("Problems.BinPacking")]
+    public void TestRandomInstanceProvider() {
+      
+      var referenceItemLists = ReadReferenceItemLists();
+      TestRandomInstanceProviderByClass(new RandomInstanceClass1ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass2ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass3ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass4ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass5ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass6ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass7ProviderWithSRand(), referenceItemLists);
+      TestRandomInstanceProviderByClass(new RandomInstanceClass8ProviderWithSRand(), referenceItemLists);
+      
+    }
+
+    private IDictionary<string, List<Dimension>> ReadReferenceItemLists() {
+      var itemList = new Dictionary<string, List<Dimension>>();
+      string path = @"C:\HEAL\BinPacking\Algorithm\export";//todo which location can be used for storing the reference files? At the moment their location can be found on the local disc
+
+      string[] files = Directory.GetFiles(path);
+      foreach (string filePath in files) {
+        string key = Path.GetFileNameWithoutExtension(filePath);
+
+        using (StreamReader reader = new StreamReader(filePath)) {
+          int lineNumber = 1;
+          List<Dimension> dimensionList = new List<Dimension>();
+          while (!reader.EndOfStream) {
+            string line = reader.ReadLine();
+            if (lineNumber > 2) {
+              string[] lineValues = line.Split('\t');
+              int id;
+              int depth;
+              int width;
+              int height;
+              Int32.TryParse(lineValues[0], out id);
+              Int32.TryParse(lineValues[1], out depth);
+              Int32.TryParse(lineValues[2], out width);
+              Int32.TryParse(lineValues[3], out height);
+              dimensionList.Add(new Dimension() {
+                Id = id,
+                Depth = depth,
+                Width = width,
+                Height = height
+              });
+            }
+            lineNumber++;
+          }
+          itemList.Add(key, dimensionList);
+        }
+      }
+      return itemList;
+    }
+
+    private void TestRandomInstanceProviderByClass(RandomInstanceProviderWithSRand randomInstanceProvider, IDictionary<string, List<Dimension>> referenceItems) {
+
+      var dataDescriptors = randomInstanceProvider.GetDataDescriptors();
+      foreach (var dataDescriptor in dataDescriptors) {
+        List<Dimension> testItemDimensions = null;
+        if (referenceItems.TryGetValue(dataDescriptor.Name, out testItemDimensions)) {
+          var packingItems = randomInstanceProvider.LoadData(dataDescriptor).Items;
+          Assert.IsNotNull(packingItems);
+          Assert.AreEqual(testItemDimensions.Count, packingItems.Length);
+          for (int i = 0; i < packingItems.Length; i++) {
+            Assert.AreEqual(testItemDimensions[i].Width, packingItems[i].Width);
+            Assert.AreEqual(testItemDimensions[i].Height, packingItems[i].Height);
+            Assert.AreEqual(testItemDimensions[i].Depth, packingItems[i].Depth);
+          }
+        }
+      }
+    }
+    #endregion
+
+    #region TestExtremePointAlgorithm
+
+    /// <summary>
+    /// Constants for testing the algorithm
+    /// The test parameter are defined in the paper 
+    /// </summary>
+    private const int NUMBER_OF_TEST_INSTANCES = 10;
+    private static readonly int[] TEST_CLASSES = { 1, 2 };
+    private static readonly int[] NUMBER_OF_TEST_ITEMS = { 50, 100, 150, 200 };
+
+    [TestMethod]
+    [TestCategory("Problems.BinPacking")]
+    public void TestExtremePointAlgorithm() {
+      TestExtremePointAlgorithmByParameters(new RandomInstanceClass1ProviderWithSRand(), 1, SortingMethod.Given, FittingMethod.FirstFit);
+
+
+    }
+
+    private void TestExtremePointAlgorithmByParameters(RandomInstanceProviderWithSRand randomInstanceProvider, int @class, SortingMethod sortingMethod, FittingMethod fittingMethod) {
+      var dataDescriptors = randomInstanceProvider.GetDataDescriptors();
+      var referenceValues = GetReferenceAlgorithmValues();
+      foreach (var numItems in NUMBER_OF_TEST_ITEMS) {
+        int sumNumberOfBins = 0;
+        for (int instance = 1; instance <= NUMBER_OF_TEST_INSTANCES; instance++) {
+          string name = string.Format("n={0}-id={1:00} (class={2})", numItems, instance, @class);
+          var selectedDataDescriptor = dataDescriptors.Where(dataDescriptor => dataDescriptor.Name == name);
+          Assert.IsNotNull(selectedDataDescriptor?.First());
+          var packingData = randomInstanceProvider.LoadData(selectedDataDescriptor.First());
+
+          ExtremePointAlgorithm algorithm = new ExtremePointAlgorithm();
+          algorithm.SortingMethodParameter.Value.Value = sortingMethod;
+          algorithm.FittingMethodParameter.Value.Value = fittingMethod;
+          algorithm.Problem.Load(packingData);
+
+          algorithm.Start();
+
+          PackingPlan<BinPacking3D.PackingPosition, PackingShape, PackingItem> bestPackingPlan = null;
+          foreach (Optimization.IResult result in algorithm.Results) {
+            if (result.Name == "Best Solution") {
+              bestPackingPlan = (PackingPlan<BinPacking3D.PackingPosition, PackingShape, PackingItem>)result.Value;
+              break;
+            }
+          }
+
+          sumNumberOfBins += bestPackingPlan.NrOfBins;
         }
 
-        #region TestRandomInstanceProvider
+        double referenceValue = 0.0;
+        
+        if (referenceValues.TryGetValue(new Tuple<int, int, SortingMethod>(@class, numItems, sortingMethod), out referenceValue)) {
+          Console.WriteLine($"{numItems}: {referenceValue} {(double)sumNumberOfBins / (double)NUMBER_OF_TEST_INSTANCES}");
+          Assert.AreEqual(referenceValue, (double)sumNumberOfBins / (double)NUMBER_OF_TEST_INSTANCES, 1.0);
+        }
+      }
+    }
 
 
-        /// <summary>
-        /// Tests if the generated random instance equals to the references generated by david pisinger 
-        /// http://www.diku.dk/~pisinger/new3dbpp/test3dbpp.c
-        /// </summary>
-        [TestMethod]
-        [TestCategory("Problems.BinPacking")]
-        public void TestRandomInstanceProvider() {
+    /// <summary>
+    /// Returns a dictionary which contains the reference values from table 2 given by the paper https://www.cirrelt.ca/DocumentsTravail/CIRRELT-2007-41.pdf 
+    /// </summary>
+    /// <returns></returns>
+    private Dictionary<Tuple<int, int, SortingMethod>, double> GetReferenceAlgorithmValues() {
+      Dictionary<Tuple<int, int, SortingMethod>, double> referenceValues = new Dictionary<Tuple<int, int, SortingMethod>, double>();
+
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.Given), 14.6);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.Given), 29.2);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.Given), 40.1);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.Given), 55.9);
+
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.HeightVolume), 15);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.HeightVolume), 29.2);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.HeightVolume), 39.9);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightVolume), 55.6);
+
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.VolumeHeight), 14.4);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.VolumeHeight), 29.5);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.VolumeHeight), 40.3);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.VolumeHeight), 55.7);
+
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.AreaHeight), 14.4);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.AreaHeight), 28.3);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.AreaHeight), 39.2);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.AreaHeight), 53.2);
+
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.HeightArea), 15);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.HeightArea), 29);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.HeightArea), 39.8);
+      referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightArea), 55.1);
 
 
-            var referenceItemLists = ReadReferenceItemLists();
+      var s = referenceValues[new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightArea)];
 
-            TestRandomInstanceProviderByClass(new RandomInstanceClass1Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass2Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass3Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass4Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass5Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass6Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass7Provider(), referenceItemLists);
-            TestRandomInstanceProviderByClass(new RandomInstanceClass8Provider(), referenceItemLists);
-
-        }
-
-        private IDictionary<string, List<Dimension>> ReadReferenceItemLists() {
-            var itemList = new Dictionary<string, List<Dimension>>();
-            string path = @"C:\HEAL\BinPacking\Algorithm\export";//todo which location can be used for storing the reference files? At the moment their location can be found on the local disc
-
-            string[] files = Directory.GetFiles(path);
-            foreach (string filePath in files) {
-                string key = Path.GetFileNameWithoutExtension(filePath);
-
-                using (StreamReader reader = new StreamReader(filePath)) {
-                    int lineNumber = 1;
-                    List<Dimension> dimensionList = new List<Dimension>();
-                    while (!reader.EndOfStream) {
-                        string line = reader.ReadLine();
-                        if (lineNumber > 2) {
-                            string[] lineValues = line.Split('\t');
-                            int id;
-                            int depth;
-                            int width;
-                            int height;
-                            Int32.TryParse(lineValues[0], out id);
-                            Int32.TryParse(lineValues[1], out depth);
-                            Int32.TryParse(lineValues[2], out width);
-                            Int32.TryParse(lineValues[3], out height);
-                            dimensionList.Add(new Dimension() {
-                                Id = id,
-                                Depth = depth,
-                                Width = width,
-                                Height = height
-                            });
-                        }
-                        lineNumber++;
-                    }
-                    itemList.Add(key, dimensionList);
-                }
-            }
-            return itemList;
-        }
-
-        private void TestRandomInstanceProviderByClass(RandomInstanceProvider randomInstanceProvider, IDictionary<string, List<Dimension>> referenceItems) {
-
-            var dataDescriptors = randomInstanceProvider.GetDataDescriptors();
-            foreach (var dataDescriptor in dataDescriptors) {
-                List<Dimension> testItemDimensions = null;
-                if (referenceItems.TryGetValue(dataDescriptor.Name, out testItemDimensions)) {
-                    var packingItems = randomInstanceProvider.LoadData(dataDescriptor).Items;
-                    Assert.IsNotNull(packingItems);
-                    Assert.AreEqual(testItemDimensions.Count, packingItems.Length);
-                    for (int i = 0; i < packingItems.Length; i++) {
-                        Assert.AreEqual(testItemDimensions[i].Width, packingItems[i].Width);
-                        Assert.AreEqual(testItemDimensions[i].Height, packingItems[i].Height);
-                        Assert.AreEqual(testItemDimensions[i].Depth, packingItems[i].Depth);
-                    }
-                }
-            }
-        }
-        #endregion
-
-        #region TestExtremePointAlgorithm
-
-        /// <summary>
-        /// Constants for testing the algorithm
-        /// The test parameter are defined in the paper 
-        /// </summary>
-        private const int NUMBER_OF_TEST_INSTANCES = 10;
-        private static readonly int[] TEST_CLASSES = { 1, 2 };
-        private static readonly int[] NUMBER_OF_TEST_ITEMS = { 50, 100, 150, 200 };
-
-        [TestMethod]
-        [TestCategory("Problems.BinPacking")]
-        public void TestExtremePointAlgorithm() {
-            TestExtremePointAlgorithmByParameters(new RandomInstanceClass1Provider(), 1, SortingMethod.Given, FittingMethod.FirstFit);
+      return referenceValues;
+    }
 
 
-        }
-
-        private void TestExtremePointAlgorithmByParameters(RandomInstanceProvider randomInstanceProvider, int @class, SortingMethod sortingMethod, FittingMethod fittingMethod) {
-            var dataDescriptors = randomInstanceProvider.GetDataDescriptors();
-            var referenceValues = GetReferenceAlgorithmValues();
-            foreach (var numItems in NUMBER_OF_TEST_ITEMS) {
-                int sumNumberOfBins = 0;
-                for (int instance = 1; instance <= NUMBER_OF_TEST_INSTANCES; instance++) {
-                    string name = string.Format("n={0}-id={1:00} (class={2})", numItems, instance, @class);
-                    var selectedDataDescriptor = dataDescriptors.Where(dataDescriptor => dataDescriptor.Name == name);
-                    Assert.IsNotNull(selectedDataDescriptor?.First());
-                    var packingData = randomInstanceProvider.LoadData(selectedDataDescriptor.First());
-
-                    ExtremePointAlgorithm algorithm = new ExtremePointAlgorithm();
-                    algorithm.SortingMethodParameter.Value.Value = sortingMethod;
-                    algorithm.FittingMethodParameter.Value.Value = fittingMethod;
-                    algorithm.Problem.Load(packingData);
-
-                    algorithm.Start();
-
-                    PackingPlan<BinPacking3D.PackingPosition, PackingShape, PackingItem> bestPackingPlan = null;
-                    foreach (Optimization.IResult result in algorithm.Results) {
-                        if (result.Name == "Best Solution") {
-                            bestPackingPlan = (PackingPlan<BinPacking3D.PackingPosition, PackingShape, PackingItem>)result.Value;
-                            break;
-                        }
-                    }
-
-                    sumNumberOfBins += bestPackingPlan.NrOfBins;
-                }
-
-                double referenceValue = 0.0;
-                if (referenceValues.TryGetValue(new Tuple<int, int, SortingMethod>(@class, numItems, sortingMethod), out referenceValue)) {
-                    Assert.AreEqual(referenceValue, (double)sumNumberOfBins / (double)NUMBER_OF_TEST_INSTANCES, 0.1);
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Returns a dictionary which contains the reference values from table 2 given by the paper https://www.cirrelt.ca/DocumentsTravail/CIRRELT-2007-41.pdf 
-        /// </summary>
-        /// <returns></returns>
-        private Dictionary<Tuple<int, int, SortingMethod>, double> GetReferenceAlgorithmValues() {
-            Dictionary<Tuple<int, int, SortingMethod>, double> referenceValues = new Dictionary<Tuple<int, int, SortingMethod>, double>();
-            
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.Given), 14.6);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.Given), 29.2);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.Given), 40.1);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.Given), 55.9);
-
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.HeightVolume), 15);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.HeightVolume), 29.2);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.HeightVolume), 39.9);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightVolume), 55.6);
-
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.VolumeHeight), 14.4);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.VolumeHeight), 29.5);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.VolumeHeight), 40.3);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.VolumeHeight), 55.7);
-
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.AreaHeight), 14.4);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.AreaHeight), 28.3);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.AreaHeight), 39.2);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.AreaHeight), 53.2);
-
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 50, SortingMethod.HeightArea), 15);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 100, SortingMethod.HeightArea), 29);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 150, SortingMethod.HeightArea), 39.8);
-            referenceValues.Add(new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightArea), 55.1);
-
-
-            var s = referenceValues[new Tuple<int, int, SortingMethod>(1, 200, SortingMethod.HeightArea)];
-
-            return referenceValues;
-        }
-
-
-        #endregion
-    }
+    #endregion
+  }
 
 }
