Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/18 12:59:38 (6 years ago)
Author:
rhanghof
Message:

#2817:

  • Adjusted the unit tests
  • Refactoring of the sorter
  • Bugfix on the BinPackerResidualSpaceBestFit packer
Location:
branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Algorithms/ExtremePointAlgorithmTest.cs

    r15959 r15989  
    8383      _extremPointAlgorithm.FittingMethodParameter.Value.Value = FittingMethod.FirstFit;
    8484      _extremPointAlgorithm.ExtremePointCreationMethodParameter.Value.Value = ExtremePointCreationMethod.PointProjection;
    85       _extremPointAlgorithm.SortByMaterialParameter.Value.Value = false;
     85      _extremPointAlgorithm.SortBySequenceGroupParameter.Value.Value = false;
    8686      var result = TestUtils.InvokeMethod(typeof(ExtremePointAlgorithm), _extremPointAlgorithm, "GetBest", parameters) as Tuple<Solution, double, SortingMethod?, FittingMethod?, ExtremePointCreationMethod?>;
    8787
  • branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Instances/RandomInstanceProviderTest.cs

    r15959 r15989  
    1717      public int Height { get; set; }
    1818      public int Depth { get; set; }
    19     }
    20 
    21     #region TestRandomInstanceProvider
    22 
    23 
    24     /// <summary>
    25     /// Tests if the generated random instance equals to the references generated by david pisinger
    26     /// http://www.diku.dk/~pisinger/new3dbpp/test3dbpp.c
    27     /// </summary>
    28     [TestMethod]
    29     [TestCategory("Problems.BinPacking.3D")]
    30     [TestProperty("Time", "long")]
    31     public void TestRandomInstanceProvider() {
    32 
    33       var referenceItemLists = ReadReferenceItemLists();
    34       TestRandomInstanceProviderByClass(new RandomInstanceClass1Provider(), referenceItemLists);
    35       TestRandomInstanceProviderByClass(new RandomInstanceClass2Provider(), referenceItemLists);
    36       TestRandomInstanceProviderByClass(new RandomInstanceClass3Provider(), referenceItemLists);
    37       TestRandomInstanceProviderByClass(new RandomInstanceClass4Provider(), referenceItemLists);
    38       TestRandomInstanceProviderByClass(new RandomInstanceClass5Provider(), referenceItemLists);
    39       TestRandomInstanceProviderByClass(new RandomInstanceClass6Provider(), referenceItemLists);
    40       TestRandomInstanceProviderByClass(new RandomInstanceClass7Provider(), referenceItemLists);
    41       TestRandomInstanceProviderByClass(new RandomInstanceClass8Provider(), referenceItemLists);
    42 
    43     }
    44 
    45     private IDictionary<string, List<Dimension>> ReadReferenceItemLists() {
    46       var itemList = new Dictionary<string, List<Dimension>>();
    47       string path = @".\..\HeuristicLab.Tests\HeuristicLab.Problems.Bin-Packing-3.3\TestInstances\ReferenceInstances";
    48 
    49       string[] files = Directory.GetFiles(path);
    50       foreach (string filePath in files) {
    51         string key = Path.GetFileNameWithoutExtension(filePath);
    52 
    53         using (StreamReader reader = new StreamReader(filePath)) {
    54           int lineNumber = 1;
    55           List<Dimension> dimensionList = new List<Dimension>();
    56           while (!reader.EndOfStream) {
    57             string line = reader.ReadLine();
    58             if (lineNumber > 2) {
    59               string[] lineValues = line.Split('\t');
    60               int id;
    61               int depth;
    62               int width;
    63               int height;
    64               Int32.TryParse(lineValues[0], out id);
    65               Int32.TryParse(lineValues[1], out depth);
    66               Int32.TryParse(lineValues[2], out width);
    67               Int32.TryParse(lineValues[3], out height);
    68               dimensionList.Add(new Dimension() {
    69                 Id = id,
    70                 Depth = depth,
    71                 Width = width,
    72                 Height = height
    73               });
    74             }
    75             lineNumber++;
    76           }
    77           itemList.Add(key, dimensionList);
    78         }
    79       }
    80       return itemList;
    81     }
    82 
    83     private void TestRandomInstanceProviderByClass(RandomInstanceProvider randomInstanceProvider, IDictionary<string, List<Dimension>> referenceItems) {
    84 
    85       var dataDescriptors = randomInstanceProvider.GetDataDescriptors();
    86       foreach (var dataDescriptor in dataDescriptors) {
    87         List<Dimension> testItemDimensions = null;
    88         if (referenceItems.TryGetValue(dataDescriptor.Name, out testItemDimensions)) {
    89           var packingItems = randomInstanceProvider.LoadData(dataDescriptor).Items;
    90           Assert.IsNotNull(packingItems);
    91           Assert.AreEqual(testItemDimensions.Count, packingItems.Length);
    92           for (int i = 0; i < packingItems.Length; i++) {
    93             Assert.AreEqual(testItemDimensions[i].Width, packingItems[i].Width);
    94             Assert.AreEqual(testItemDimensions[i].Height, packingItems[i].Height);
    95             Assert.AreEqual(testItemDimensions[i].Depth, packingItems[i].Depth);
    96           }
    97         }
    98       }
    99     }
    100     #endregion
     19    }   
    10120
    10221    #region TestExtremePointAlgorithm
     
    198117            algorithm.FittingMethodParameter.Value.Value = fittingMethod;
    199118            algorithm.ExtremePointCreationMethodParameter.Value.Value = epCreationMethod;
    200             algorithm.SortByMaterialParameter.Value.Value = false;
     119            algorithm.SortBySequenceGroupParameter.Value.Value = false;
    201120
    202121            algorithm.Problem.UseStackingConstraintsParameter.Value.Value = false;
  • branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Instances/ThreeDInstanceParserTest.cs

    r15959 r15989  
    1919
    2020      _items1.Add(new PackingItem(8, 10, 10, _packingShape, 800, 1, 1)); // 0,  V = 800,  A =  80, h = 10
    21       _items1.Add(new PackingItem(10, 8, 10, _packingShape, 800, 2, 1)); // 1,  V = 800,  A = 100, h =  8
    22       _items1.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 1)); // 2,  V = 800,  A =  80, h = 10
    23       _items1.Add(new PackingItem(8, 8, 10,  _packingShape, 640, 4, 1)); // 3,   V = 640,  A =  80, h =  8
    24       _items1.Add(new PackingItem(10, 8, 8,  _packingShape, 640, 0, 1)); // 4,   V = 640,  A =  80, h =  8
     21      _items1.Add(new PackingItem(10, 8, 10, _packingShape, 800, 2, 2)); // 1,  V = 800,  A = 100, h =  8
     22      _items1.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 3)); // 2,  V = 800,  A =  80, h = 10
     23      _items1.Add(new PackingItem(8, 8, 10,  _packingShape, 640, 4, 4)); // 3,   V = 640,  A =  80, h =  8
     24      _items1.Add(new PackingItem(10, 8, 8,  _packingShape, 640, 0, 0)); // 4,   V = 640,  A =  80, h =  8
    2525      _items1.Add(new PackingItem(8, 10, 8,  _packingShape, 640, 1, 1)); // 5,   V = 640,  A =  64, h = 10 
    26       _items1.Add(new PackingItem(8, 8, 8,   _packingShape, 512, 2, 1)); // 6,    V = 512,  A =  64, h =  8
     26      _items1.Add(new PackingItem(8, 8, 8,   _packingShape, 512, 2, 2)); // 6,    V = 512,  A =  64, h =  8
    2727
    28       _items1.Add(new PackingItem(10, 10, 10, _packingShape,1000,3, 1)); // 7, V = 1000, A = 100, h = 10
     28      _items1.Add(new PackingItem(10, 10, 10, _packingShape,1000,3, 3)); // 7, V = 1000, A = 100, h = 10
    2929
    30       _items1.Add(new PackingItem(9, 10, 10, _packingShape, 900, 4, 1)); // 8,  V = 900,  A =  90, h = 10
    31       _items1.Add(new PackingItem(10, 9, 10, _packingShape, 900, 0, 1)); // 9,  V = 900,  A = 100, h =  9
     30      _items1.Add(new PackingItem(9, 10, 10, _packingShape, 900, 4, 4)); // 8,  V = 900,  A =  90, h = 10
     31      _items1.Add(new PackingItem(10, 9, 10, _packingShape, 900, 0, 0)); // 9,  V = 900,  A = 100, h =  9
    3232      _items1.Add(new PackingItem(10, 10, 9, _packingShape, 900, 1, 1)); // 10, V = 900,  A =  90, h = 10
    33       _items1.Add(new PackingItem(9, 9, 10,  _packingShape, 810, 2, 1)); // 11,  V = 810,  A =  90, h =  9
    34       _items1.Add(new PackingItem(10, 9, 9,  _packingShape, 810, 3, 1)); // 12,  V = 810,  A =  90, h =  9
    35       _items1.Add(new PackingItem(9, 10, 9,  _packingShape, 810, 4, 1)); // 13,  V = 810,  A =  81, h = 10
    36       _items1.Add(new PackingItem(9, 9, 9,   _packingShape, 729, 0, 1)); // 14,   V = 729,  A =  81, h =  9
     33      _items1.Add(new PackingItem(9, 9, 10,  _packingShape, 810, 2, 2)); // 11,  V = 810,  A =  90, h =  9
     34      _items1.Add(new PackingItem(10, 9, 9,  _packingShape, 810, 3, 3)); // 12,  V = 810,  A =  90, h =  9
     35      _items1.Add(new PackingItem(9, 10, 9,  _packingShape, 810, 4, 4)); // 13,  V = 810,  A =  81, h = 10
     36      _items1.Add(new PackingItem(9, 9, 9,   _packingShape, 729, 0, 0)); // 14,   V = 729,  A =  81, h =  9
    3737
    3838      _items2 = new List<PackingItem>();
    3939      _items2.Add(new PackingItem(8, 10, 10, _packingShape, 800, 1, 1)); // 0,  V = 800,  A =  80, h = 10
    40       _items2.Add(new PackingItem(10, 8, 10, _packingShape, 800, 2, 1)); // 1,  V = 800,  A = 100, h =  8
    41       _items2.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 1)); // 2,  V = 800,  A =  80, h = 10
    42       _items2.Add(new PackingItem(8, 8, 10, _packingShape, 640, 4, 1)); // 3,   V = 640,  A =  80, h =  8
    43       _items2.Add(new PackingItem(10, 8, 8, _packingShape, 640, 0, 1)); // 4,   V = 640,  A =  80, h =  8
     40      _items2.Add(new PackingItem(10, 8, 10, _packingShape, 800, 2, 2)); // 1,  V = 800,  A = 100, h =  8
     41      _items2.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 3)); // 2,  V = 800,  A =  80, h = 10
     42      _items2.Add(new PackingItem(8, 8, 10, _packingShape, 640, 4, 4)); // 3,   V = 640,  A =  80, h =  8
     43      _items2.Add(new PackingItem(10, 8, 8, _packingShape, 640, 0, 0)); // 4,   V = 640,  A =  80, h =  8
    4444      _items2.Add(new PackingItem(8, 10, 8, _packingShape, 640, 1, 1)); // 5,   V = 640,  A =  64, h = 10 
    4545    }
  • branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Sorting/PermutationSortingTest.cs

    r15959 r15989  
    1818
    1919      _items.Add(new PackingItem(8, 10, 10, _packingShape, 1000, 1, 1)); // 0,  V = 800,  A =  80, h = 10
    20       _items.Add(new PackingItem(10, 8, 10, _packingShape, 1000, 2, 1)); // 1,  V = 800,  A = 100, h =  8
    21       _items.Add(new PackingItem(10, 10, 8, _packingShape, 1000, 3, 1)); // 2,  V = 800,  A =  80, h = 10
    22       _items.Add(new PackingItem(8, 8, 10, _packingShape, 1000, 4, 1)); // 3,   V = 640,  A =  80, h =  8
    23       _items.Add(new PackingItem(10, 8, 8, _packingShape, 1000, 0, 1)); // 4,   V = 640,  A =  80, h =  8
     20      _items.Add(new PackingItem(10, 8, 10, _packingShape, 1000, 2, 2)); // 1,  V = 800,  A = 100, h =  8
     21      _items.Add(new PackingItem(10, 10, 8, _packingShape, 1000, 3, 3)); // 2,  V = 800,  A =  80, h = 10
     22      _items.Add(new PackingItem(8, 8, 10, _packingShape, 1000, 4, 4)); // 3,   V = 640,  A =  80, h =  8
     23      _items.Add(new PackingItem(10, 8, 8, _packingShape, 1000, 0, 0)); // 4,   V = 640,  A =  80, h =  8
    2424      _items.Add(new PackingItem(8, 10, 8, _packingShape, 1000, 1, 1)); // 5,   V = 640,  A =  64, h = 10 
    25       _items.Add(new PackingItem(8, 8, 8, _packingShape, 1000, 2, 1)); // 6,    V = 512,  A =  64, h =  8
     25      _items.Add(new PackingItem(8, 8, 8, _packingShape, 1000, 2, 2)); // 6,    V = 512,  A =  64, h =  8
    2626
    27       _items.Add(new PackingItem(10, 10, 10, _packingShape, 1000, 3, 1)); // 7, V = 1000, A = 100, h = 10
     27      _items.Add(new PackingItem(10, 10, 10, _packingShape, 1000, 3, 3)); // 7, V = 1000, A = 100, h = 10
    2828
    29       _items.Add(new PackingItem(9, 10, 10, _packingShape, 1000, 4, 1)); // 8,  V = 900,  A =  90, h = 10
    30       _items.Add(new PackingItem(10, 9, 10, _packingShape, 1000, 0, 1)); // 9,  V = 900,  A = 100, h =  9
     29      _items.Add(new PackingItem(9, 10, 10, _packingShape, 1000, 4, 4)); // 8,  V = 900,  A =  90, h = 10
     30      _items.Add(new PackingItem(10, 9, 10, _packingShape, 1000, 0, 0)); // 9,  V = 900,  A = 100, h =  9
    3131      _items.Add(new PackingItem(10, 10, 9, _packingShape, 1000, 1, 1)); // 10, V = 900,  A =  90, h = 10
    32       _items.Add(new PackingItem(9, 9, 10, _packingShape, 1000, 2, 1)); // 11,  V = 810,  A =  90, h =  9
    33       _items.Add(new PackingItem(10, 9, 9, _packingShape, 1000, 3, 1)); // 12,  V = 810,  A =  90, h =  9
    34       _items.Add(new PackingItem(9, 10, 9, _packingShape, 1000, 4, 1)); // 13,  V = 810,  A =  81, h = 10
    35       _items.Add(new PackingItem(9, 9, 9, _packingShape, 1000, 0, 1)); // 14,   V = 729,  A =  81, h =  9
     32      _items.Add(new PackingItem(9, 9, 10, _packingShape, 1000, 2, 2)); // 11,  V = 810,  A =  90, h =  9
     33      _items.Add(new PackingItem(10, 9, 9, _packingShape, 1000, 3, 3)); // 12,  V = 810,  A =  90, h =  9
     34      _items.Add(new PackingItem(9, 10, 9, _packingShape, 1000, 4, 4)); // 13,  V = 810,  A =  81, h = 10
     35      _items.Add(new PackingItem(9, 9, 9, _packingShape, 1000, 0, 0)); // 14,   V = 729,  A =  81, h =  9
    3636    }
    3737
     
    4040    [TestCategory("Problems.BinPacking.3D")]
    4141    [TestProperty("Time", "short")]
    42     public void TestSortByVolumeHeightExtension() {
    43       Permutation actual = _items.SortByVolumeHeight();
     42    public void TestSortByVolumeHeight() {
     43      Permutation actual =  PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.VolumeHeight).SortPackingItems(_items, _packingShape);
    4444      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7,  8, 10, 9, 13, 11, 12, 0, 2, 1, 14, 5, 3, 4, 6});
    4545      for (int i = 0; i < expected.Length; i++) {
     
    5151    [TestCategory("Problems.BinPacking.3D")]
    5252    [TestProperty("Time", "short")]
    53     public void TestSortByHeightVolumeExtension() {
    54       Permutation actual = _items.SortByHeightVolume();
     53    public void TestSortByHeightVolume() {
     54      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightVolume).SortPackingItems(_items, _packingShape);
    5555      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 8, 10, 13, 0, 2, 5, 9, 11, 12, 14, 1, 3, 4, 6 });
    5656      for (int i = 0; i < expected.Length; i++) {
     
    6363    [TestCategory("Problems.BinPacking.3D")]
    6464    [TestProperty("Time", "short")]
    65     public void TestSortByAreaHeightExtension() {
    66       Permutation actual = _items.SortByAreaHeight();
     65    public void TestSortByAreaHeight() {
     66      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.AreaHeight).SortPackingItems(_items, _packingShape);
    6767      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 9, 1, 8, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6});
    6868      for (int i = 0; i < expected.Length; i++) {
     
    7575    [TestCategory("Problems.BinPacking.3D")]
    7676    [TestProperty("Time", "short")]
    77     public void TestSortByHeightAreaExtension() {
    78       Permutation actual = _items.SortByHeightArea();
     77    public void TestSortByHeightArea() {
     78      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightArea).SortPackingItems(_items, _packingShape);
    7979      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 8, 10, 13, 0, 2, 5, 9, 11, 12, 14, 1, 3, 4, 6});
    8080      for (int i = 0; i < expected.Length; i++) {
     
    8686    [TestCategory("Problems.BinPacking.3D")]
    8787    [TestProperty("Time", "short")]
    88     public void TestSortByClusteredAreaHeightExtension() {
    89       Permutation actual = _items.SortByClusteredAreaHeight(_packingShape, 1.0);
     88    public void TestSortByClusteredAreaHeight() {
     89      Permutation actual = ((IPackingItemClusteredSorter)PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.ClusteredAreaHeight)).SortPackingItems(_items, _packingShape, 1.0);
    9090      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 0, 2, 5, 7, 8, 10, 13, 9, 11, 12, 14, 1, 3, 4, 6 });
    9191      for (int i = 0; i < expected.Length; i++) {
     
    9797    [TestCategory("Problems.BinPacking.3D")]
    9898    [TestProperty("Time", "short")]
    99     public void TestSortByClusteredHeightAreaExtension() {
    100       Permutation actual = _items.SortByClusteredHeightArea(_packingShape, 1.0);
     99    public void TestSortByClusteredHeightArea() {
     100      Permutation actual = ((IPackingItemClusteredSorter)PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.ClusteredHeightArea)).SortPackingItems(_items, _packingShape, 1.0);
    101101      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 1, 7, 9, 8, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6 });
    102102      for (int i = 0; i < expected.Length; i++) {
     
    108108    [TestCategory("Problems.BinPacking.3D")]
    109109    [TestProperty("Time", "short")]
    110     public void TestSortByMaterialVolumeHeightExtension() {
    111       Permutation actual = _items.SortByMaterialVolumeHeight();
    112       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 8, 13, 3, 7, 12, 2, 11, 1, 6, 10, 0, 5, 9, 14, 4 });
     110    public void TestSortBySequenceGroupVolumeHeight() {
     111      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.VolumeHeight).SortPackingItemsBySequenceGroup(_items, _packingShape);
     112      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 10, 0, 5, 11, 1, 6, 7, 12, 2, 8, 13, 3 });
    113113      for (int i = 0; i < expected.Length; i++) {
    114114        Assert.AreEqual(expected[i], actual[i]);
     
    119119    [TestCategory("Problems.BinPacking.3D")]
    120120    [TestProperty("Time", "short")]
    121     public void TestSortByMaterialHeightVolumeExtension() {
    122       Permutation actual = _items.SortByMaterialHeightVolume();
    123       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 8, 13, 3, 7, 2, 12, 11, 1, 6, 10, 0, 5, 9, 14, 4 });
     121    public void TestSortByMaterialHeightVolume() {
     122      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightVolume).SortPackingItemsBySequenceGroup(_items, _packingShape);
     123      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 10, 0, 5, 11, 1, 6, 7, 2, 12, 8, 13, 3 });
    124124      for (int i = 0; i < expected.Length; i++) {
    125125        Assert.AreEqual(expected[i], actual[i]);
     
    131131    [TestCategory("Problems.BinPacking.3D")]
    132132    [TestProperty("Time", "short")]
    133     public void TestSortByMaterialAreaHeightExtension() {
    134       Permutation actual = _items.SortByMaterialAreaHeight();
    135       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 8, 13, 3, 7, 12, 2, 1, 11, 6, 10, 0, 5, 9, 14, 4 });
     133    public void TestSortByMaterialAreaHeight() {
     134      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.AreaHeight).SortPackingItemsBySequenceGroup(_items, _packingShape);
     135      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 10, 0, 5, 1, 11, 6, 7, 12, 2, 8, 13, 3 });
    136136      for (int i = 0; i < expected.Length; i++) {
    137137        Assert.AreEqual(expected[i], actual[i]);
     
    143143    [TestCategory("Problems.BinPacking.3D")]
    144144    [TestProperty("Time", "short")]
    145     public void TestSortByMaterialHeightAreaExtension() {
    146       Permutation actual = _items.SortByMaterialHeightArea();
    147       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 8, 13, 3, 7, 2, 12, 11, 1, 6, 10, 0, 5, 9, 14, 4 });
     145    public void TestSortByMaterialHeightArea() {
     146      Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightArea).SortPackingItemsBySequenceGroup(_items, _packingShape);
     147      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 10, 0, 5, 11, 1, 6, 7, 2, 12, 8, 13, 3 });
    148148      for (int i = 0; i < expected.Length; i++) {
    149149        Assert.AreEqual(expected[i], actual[i]);
     
    154154    [TestCategory("Problems.BinPacking.3D")]
    155155    [TestProperty("Time", "short")]
    156     public void TestSortByMaterialClusteredAreaHeightExtension() {
    157       Permutation actual = _items.SortByMaterialClusteredAreaHeight(_packingShape, 1.0);
    158       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 8, 13, 3, 2, 7, 12, 11, 1, 6, 0, 5, 10, 9, 14, 4 });
     156    public void TestSortByMaterialClusteredAreaHeight() {
     157      Permutation actual = ((IPackingItemClusteredSorter)PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.ClusteredAreaHeight)).SortPackingItemsBySequenceGroup(_items, _packingShape, 1.0);
     158      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 0, 5, 10, 11, 1, 6, 2, 7, 12, 8, 13, 3 });
    159159      for (int i = 0; i < expected.Length; i++) {
    160160        Assert.AreEqual(expected[i], actual[i]);
     
    165165    [TestCategory("Problems.BinPacking.3D")]
    166166    [TestProperty("Time", "short")]
    167     public void TestSortByMaterialClusteredHeightAreaExtension() {
    168       Permutation actual = _items.SortByClusteredHeightArea(_packingShape, 1.0);
    169       Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 1, 7, 9, 8, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6 });
     167    public void TestSortByMaterialClusteredHeightArea() {
     168      Permutation actual = ((IPackingItemClusteredSorter)PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.ClusteredHeightArea)).SortPackingItemsBySequenceGroup(_items, _packingShape, 1.0);
     169      Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 9, 14, 4, 10, 0, 5, 1, 11, 6, 7, 12, 2, 8, 13, 3});
    170170      for (int i = 0; i < expected.Length; i++) {
    171171        Assert.AreEqual(expected[i], actual[i]);
Note: See TracChangeset for help on using the changeset viewer.