Changeset 15989 for branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D
- Timestamp:
- 07/09/18 12:59:38 (6 years ago)
- 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 83 83 _extremPointAlgorithm.FittingMethodParameter.Value.Value = FittingMethod.FirstFit; 84 84 _extremPointAlgorithm.ExtremePointCreationMethodParameter.Value.Value = ExtremePointCreationMethod.PointProjection; 85 _extremPointAlgorithm.SortBy MaterialParameter.Value.Value = false;85 _extremPointAlgorithm.SortBySequenceGroupParameter.Value.Value = false; 86 86 var result = TestUtils.InvokeMethod(typeof(ExtremePointAlgorithm), _extremPointAlgorithm, "GetBest", parameters) as Tuple<Solution, double, SortingMethod?, FittingMethod?, ExtremePointCreationMethod?>; 87 87 -
branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Instances/RandomInstanceProviderTest.cs
r15959 r15989 17 17 public int Height { get; set; } 18 18 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 } 101 20 102 21 #region TestExtremePointAlgorithm … … 198 117 algorithm.FittingMethodParameter.Value.Value = fittingMethod; 199 118 algorithm.ExtremePointCreationMethodParameter.Value.Value = epCreationMethod; 200 algorithm.SortBy MaterialParameter.Value.Value = false;119 algorithm.SortBySequenceGroupParameter.Value.Value = false; 201 120 202 121 algorithm.Problem.UseStackingConstraintsParameter.Value.Value = false; -
branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Instances/ThreeDInstanceParserTest.cs
r15959 r15989 19 19 20 20 _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 = 822 _items1.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 1)); // 2, V = 800, A = 80, h = 1023 _items1.Add(new PackingItem(8, 8, 10, _packingShape, 640, 4, 1)); // 3, V = 640, A = 80, h = 824 _items1.Add(new PackingItem(10, 8, 8, _packingShape, 640, 0, 1)); // 4, V = 640, A = 80, h = 821 _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 25 25 _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 = 826 _items1.Add(new PackingItem(8, 8, 8, _packingShape, 512, 2, 2)); // 6, V = 512, A = 64, h = 8 27 27 28 _items1.Add(new PackingItem(10, 10, 10, _packingShape,1000,3, 1)); // 7, V = 1000, A = 100, h = 1028 _items1.Add(new PackingItem(10, 10, 10, _packingShape,1000,3, 3)); // 7, V = 1000, A = 100, h = 10 29 29 30 _items1.Add(new PackingItem(9, 10, 10, _packingShape, 900, 4, 1)); // 8, V = 900, A = 90, h = 1031 _items1.Add(new PackingItem(10, 9, 10, _packingShape, 900, 0, 1)); // 9, V = 900, A = 100, h = 930 _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 32 32 _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 = 934 _items1.Add(new PackingItem(10, 9, 9, _packingShape, 810, 3, 1)); // 12, V = 810, A = 90, h = 935 _items1.Add(new PackingItem(9, 10, 9, _packingShape, 810, 4, 1)); // 13, V = 810, A = 81, h = 1036 _items1.Add(new PackingItem(9, 9, 9, _packingShape, 729, 0, 1)); // 14, V = 729, A = 81, h = 933 _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 37 37 38 38 _items2 = new List<PackingItem>(); 39 39 _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 = 841 _items2.Add(new PackingItem(10, 10, 8, _packingShape, 800, 3, 1)); // 2, V = 800, A = 80, h = 1042 _items2.Add(new PackingItem(8, 8, 10, _packingShape, 640, 4, 1)); // 3, V = 640, A = 80, h = 843 _items2.Add(new PackingItem(10, 8, 8, _packingShape, 640, 0, 1)); // 4, V = 640, A = 80, h = 840 _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 44 44 _items2.Add(new PackingItem(8, 10, 8, _packingShape, 640, 1, 1)); // 5, V = 640, A = 64, h = 10 45 45 } -
branches/2817-BinPackingSpeedup/HeuristicLab.Tests/HeuristicLab.Problems.Bin-Packing-3.3/3D/Sorting/PermutationSortingTest.cs
r15959 r15989 18 18 19 19 _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 = 821 _items.Add(new PackingItem(10, 10, 8, _packingShape, 1000, 3, 1)); // 2, V = 800, A = 80, h = 1022 _items.Add(new PackingItem(8, 8, 10, _packingShape, 1000, 4, 1)); // 3, V = 640, A = 80, h = 823 _items.Add(new PackingItem(10, 8, 8, _packingShape, 1000, 0, 1)); // 4, V = 640, A = 80, h = 820 _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 24 24 _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 = 825 _items.Add(new PackingItem(8, 8, 8, _packingShape, 1000, 2, 2)); // 6, V = 512, A = 64, h = 8 26 26 27 _items.Add(new PackingItem(10, 10, 10, _packingShape, 1000, 3, 1)); // 7, V = 1000, A = 100, h = 1027 _items.Add(new PackingItem(10, 10, 10, _packingShape, 1000, 3, 3)); // 7, V = 1000, A = 100, h = 10 28 28 29 _items.Add(new PackingItem(9, 10, 10, _packingShape, 1000, 4, 1)); // 8, V = 900, A = 90, h = 1030 _items.Add(new PackingItem(10, 9, 10, _packingShape, 1000, 0, 1)); // 9, V = 900, A = 100, h = 929 _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 31 31 _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 = 933 _items.Add(new PackingItem(10, 9, 9, _packingShape, 1000, 3, 1)); // 12, V = 810, A = 90, h = 934 _items.Add(new PackingItem(9, 10, 9, _packingShape, 1000, 4, 1)); // 13, V = 810, A = 81, h = 1035 _items.Add(new PackingItem(9, 9, 9, _packingShape, 1000, 0, 1)); // 14, V = 729, A = 81, h = 932 _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 36 36 } 37 37 … … 40 40 [TestCategory("Problems.BinPacking.3D")] 41 41 [TestProperty("Time", "short")] 42 public void TestSortByVolumeHeight Extension() {43 Permutation actual = _items.SortByVolumeHeight();42 public void TestSortByVolumeHeight() { 43 Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.VolumeHeight).SortPackingItems(_items, _packingShape); 44 44 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 8, 10, 9, 13, 11, 12, 0, 2, 1, 14, 5, 3, 4, 6}); 45 45 for (int i = 0; i < expected.Length; i++) { … … 51 51 [TestCategory("Problems.BinPacking.3D")] 52 52 [TestProperty("Time", "short")] 53 public void TestSortByHeightVolume Extension() {54 Permutation actual = _items.SortByHeightVolume();53 public void TestSortByHeightVolume() { 54 Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightVolume).SortPackingItems(_items, _packingShape); 55 55 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 8, 10, 13, 0, 2, 5, 9, 11, 12, 14, 1, 3, 4, 6 }); 56 56 for (int i = 0; i < expected.Length; i++) { … … 63 63 [TestCategory("Problems.BinPacking.3D")] 64 64 [TestProperty("Time", "short")] 65 public void TestSortByAreaHeight Extension() {66 Permutation actual = _items.SortByAreaHeight();65 public void TestSortByAreaHeight() { 66 Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.AreaHeight).SortPackingItems(_items, _packingShape); 67 67 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 9, 1, 8, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6}); 68 68 for (int i = 0; i < expected.Length; i++) { … … 75 75 [TestCategory("Problems.BinPacking.3D")] 76 76 [TestProperty("Time", "short")] 77 public void TestSortByHeightArea Extension() {78 Permutation actual = _items.SortByHeightArea();77 public void TestSortByHeightArea() { 78 Permutation actual = PackingItemSorterFactory.CreatePackingItemSorter(SortingMethod.HeightArea).SortPackingItems(_items, _packingShape); 79 79 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 7, 8, 10, 13, 0, 2, 5, 9, 11, 12, 14, 1, 3, 4, 6}); 80 80 for (int i = 0; i < expected.Length; i++) { … … 86 86 [TestCategory("Problems.BinPacking.3D")] 87 87 [TestProperty("Time", "short")] 88 public void TestSortByClusteredAreaHeight Extension() {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); 90 90 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 0, 2, 5, 7, 8, 10, 13, 9, 11, 12, 14, 1, 3, 4, 6 }); 91 91 for (int i = 0; i < expected.Length; i++) { … … 97 97 [TestCategory("Problems.BinPacking.3D")] 98 98 [TestProperty("Time", "short")] 99 public void TestSortByClusteredHeightArea Extension() {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); 101 101 Permutation expected = new Permutation(PermutationTypes.Absolute, new int[] { 1, 7, 9, 8, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6 }); 102 102 for (int i = 0; i < expected.Length; i++) { … … 108 108 [TestCategory("Problems.BinPacking.3D")] 109 109 [TestProperty("Time", "short")] 110 public void TestSortBy MaterialVolumeHeightExtension() {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 }); 113 113 for (int i = 0; i < expected.Length; i++) { 114 114 Assert.AreEqual(expected[i], actual[i]); … … 119 119 [TestCategory("Problems.BinPacking.3D")] 120 120 [TestProperty("Time", "short")] 121 public void TestSortByMaterialHeightVolume Extension() {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 }); 124 124 for (int i = 0; i < expected.Length; i++) { 125 125 Assert.AreEqual(expected[i], actual[i]); … … 131 131 [TestCategory("Problems.BinPacking.3D")] 132 132 [TestProperty("Time", "short")] 133 public void TestSortByMaterialAreaHeight Extension() {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 }); 136 136 for (int i = 0; i < expected.Length; i++) { 137 137 Assert.AreEqual(expected[i], actual[i]); … … 143 143 [TestCategory("Problems.BinPacking.3D")] 144 144 [TestProperty("Time", "short")] 145 public void TestSortByMaterialHeightArea Extension() {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 }); 148 148 for (int i = 0; i < expected.Length; i++) { 149 149 Assert.AreEqual(expected[i], actual[i]); … … 154 154 [TestCategory("Problems.BinPacking.3D")] 155 155 [TestProperty("Time", "short")] 156 public void TestSortByMaterialClusteredAreaHeight Extension() {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 }); 159 159 for (int i = 0; i < expected.Length; i++) { 160 160 Assert.AreEqual(expected[i], actual[i]); … … 165 165 [TestCategory("Problems.BinPacking.3D")] 166 166 [TestProperty("Time", "short")] 167 public void TestSortByMaterialClusteredHeightArea Extension() {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}); 170 170 for (int i = 0; i < expected.Length; i++) { 171 171 Assert.AreEqual(expected[i], actual[i]);
Note: See TracChangeset
for help on using the changeset viewer.