- Timestamp:
- 05/09/13 15:03:41 (12 years ago)
- Location:
- branches/HeuristicLab.BinPacking
- Files:
-
- 15 added
- 2 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Plugin.cs
r9440 r9473 26 26 /// Plugin class for HeuristicLab.Problems.BinPacking.Views plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9 348")]28 [Plugin("HeuristicLab.Problems.BinPacking.Views", "3.3.7.9440")] 29 29 [PluginFile("HeuristicLab.Problems.BinPacking.Views-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Properties/AssemblyInfo.cs
r9440 r9473 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.7.9 348")]56 [assembly: AssemblyFileVersion("3.3.7.9440")] -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointsFunctions3D.cs
r9440 r9473 5 5 using HeuristicLab.Collections; 6 6 using HeuristicLab.Core; 7 using HeuristicLab.Encodings.IntegerVectorEncoding; 7 8 using HeuristicLab.Encodings.PackingEncoding.GroupingVector; 8 9 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector; 9 10 using HeuristicLab.Encodings.PackingEncoding.PackingSequence; 11 using HeuristicLab.Encodings.PackingEncoding.Potvin; 10 12 using HeuristicLab.Problems.BinPacking.Dimensions; 11 13 using HeuristicLab.Problems.BinPacking.Interfaces; … … 18 20 19 21 22 23 public static ObservableDictionary<int, ThreeDimensionalPacking> ExtremePointBasedPacking(ref PotvinEncoding solution, 24 ItemList<CuboidPackingItem> itemMeasures, CuboidPackingBin binMeasures) { 25 if (!solution.DelimiterInitialized) { 26 #region Preperations 27 var itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>(); 28 int nrOfBins = 1; 29 30 var occupiedPoints = new List<int[, ,]>(); 31 occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures); 32 33 HashSet<ThreeDimensionalPacking> extremePoints = new HashSet<ThreeDimensionalPacking>(); 34 extremePoints.Add(new ThreeDimensionalPacking(0, 0, 0, 0, false)); 35 #endregion 36 37 Dictionary<int, List<int>> itemIndexesForBin = new Dictionary<int, List<int>>(); 38 itemIndexesForBin[0] = new List<int>(); 39 40 foreach (int itemIndex in solution.IntVector) { 41 var item = itemMeasures[itemIndex]; 42 extremePoints = OrderExtremePoints(extremePoints, occupiedPoints, binMeasures); 43 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions); 44 if (positionFound != null) { 45 extremePoints.Remove(positionFound); 46 } else { 47 positionFound = new ThreeDimensionalPacking(nrOfBins, 0, 0, 0); 48 occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures); 49 itemIndexesForBin[nrOfBins] = new List<int>(); 50 nrOfBins++; 51 } 52 itemPositions[itemIndex] = positionFound; 53 itemIndexesForBin[positionFound.AssignedBin].Add(itemIndex); 54 occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex); 55 extremePoints = GenerateNewExtremePointsForNewItem(extremePoints, occupiedPoints, item, positionFound, binMeasures); 56 } 57 List<int> intVector = new List<int>(); 58 foreach (var indexes in itemIndexesForBin) { 59 foreach (var index in indexes.Value) { 60 intVector.Add(index); 61 } 62 intVector.Add(-1); 63 } 64 intVector.RemoveAt(intVector.Count - 1); 65 solution.IntVector = new IntegerVector (intVector.ToArray()); 66 67 return itemPositions; 68 } else { 69 #region Preperations 70 int nrOfBins = solution.IntVector.Count(i => i.Equals (-1)) + 1; 71 72 //Get all indexes of items for every bin according to int vector 73 Dictionary<int, List<int>> unpackedItemIndexesPerBin = new Dictionary<int, List<int>>(); 74 Dictionary<int, HashSet<ThreeDimensionalPacking>> extremePointsForBin = new Dictionary<int, HashSet<ThreeDimensionalPacking>>(); 75 var occupiedPoints = new List<int[, ,]>(); 76 77 int binCounter = 0; 78 unpackedItemIndexesPerBin[binCounter] = new List<int>(); 79 for (int i = 0; i < solution.IntVector.Length; i++) { 80 if (solution.IntVector[i].Equals(-1)) { 81 unpackedItemIndexesPerBin[binCounter++] = new List<int>(); 82 extremePointsForBin[i] = new HashSet<ThreeDimensionalPacking>(); 83 extremePointsForBin[i].Add(new ThreeDimensionalPacking(i, 0, 0, 0, false)); 84 occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures); 85 } else { 86 unpackedItemIndexesPerBin[binCounter].Add(solution.IntVector[i]); 87 } 88 89 } 90 91 92 ObservableDictionary<int, ThreeDimensionalPacking> itemPositions = new ObservableDictionary<int, ThreeDimensionalPacking>(); 93 var remainingItems = new List<int>(); 94 95 #endregion Preperations 96 97 98 99 //Iterate over all bin-lists 100 for (int binNr = 0; binNr < nrOfBins; binNr++) { 101 //Iterate over the current bin-item-list and find feasible positions in the current bin for each item 102 var unpackedItems = unpackedItemIndexesPerBin[binNr]; 103 for (int i = 0; i < unpackedItems.Count; i++) { 104 var itemIndex = unpackedItems[i]; 105 var item = itemMeasures[itemIndex]; 106 107 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 108 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions); 109 if (positionFound != null) { 110 extremePointsForBin[binNr].Remove(positionFound); 111 itemPositions[itemIndex] = positionFound; 112 occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex); 113 extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures); 114 } else 115 remainingItems.Add(itemIndex); 116 } 117 } 118 119 120 121 //Packing of remaining items 122 //Iterate over all bin-lists 123 for (int binNr = 0; binNr < nrOfBins && remainingItems.Count > 0; binNr++) { 124 var unpackedItems = new List<int>(remainingItems); 125 //Iterate over all the remaining items 126 for (int i = 0; i < unpackedItems.Count; i++) { 127 var itemIndex = unpackedItems[i]; 128 var item = itemMeasures[itemIndex]; 129 130 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 131 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions); 132 if (positionFound != null) { 133 extremePointsForBin[binNr].Remove(positionFound); 134 InsertItemgeneAfterLastItemgeneOfUsedBin(ref solution, itemIndex, binNr); 135 itemPositions[itemIndex] = positionFound; 136 occupiedPoints = OccupyPointsForNewItem(occupiedPoints, item, positionFound, itemIndex); 137 extremePointsForBin[binNr] = GenerateNewExtremePointsForNewItem(extremePointsForBin[binNr], occupiedPoints, item, positionFound, binMeasures); 138 remainingItems.Remove(itemIndex); 139 } 140 } 141 if (remainingItems.Count > 0 && binNr + 1 >= nrOfBins) { 142 extremePointsForBin[nrOfBins] = new HashSet<ThreeDimensionalPacking>(); 143 extremePointsForBin[nrOfBins].Add(new ThreeDimensionalPacking(nrOfBins, 0, 0, 0, false)); 144 occupiedPoints = IncreaseBinCountForOccupiedPoints(occupiedPoints, binMeasures); 145 nrOfBins++; 146 } 147 } 148 149 return itemPositions; 150 } 151 } 152 private static void InsertItemgeneAfterLastItemgeneOfUsedBin(ref PotvinEncoding solution, int itemIndex, int binNr) { 153 List<int> temp = new List<int> (solution.IntVector); 154 temp.Remove(itemIndex); 155 var delimiterIndexes = temp.Select((value, index) => value == -1).Select((value, index) => index); 156 int insertionIndex = temp.Count; 157 if (binNr < delimiterIndexes.Count()) { 158 insertionIndex = delimiterIndexes.ElementAt(binNr); 159 } 160 temp.Insert(insertionIndex, itemIndex); 161 solution.IntVector = new IntegerVector (temp.ToArray()); 162 } 20 163 21 164 … … 56 199 var item = itemMeasures[itemIndex]; 57 200 58 extremePointsForBin[binNr] = new HashSet<ThreeDimensionalPacking>(extremePointsForBin[binNr].OrderBy(ep => ep.AssignedBin).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));201 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 59 202 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated); 60 203 if (positionFound != null) { … … 78 221 var item = itemMeasures[itemIndex]; 79 222 80 extremePointsForBin[binNr] = new HashSet<ThreeDimensionalPacking>(extremePointsForBin[binNr].OrderBy(ep => ep.AssignedBin).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));223 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 81 224 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions, unpackedItems[i].Rotated); 82 225 if (positionFound != null) { … … 147 290 var item = itemMeasures[itemIndex]; 148 291 149 extremePointsForBin[binNr] = new HashSet<ThreeDimensionalPacking>(extremePointsForBin[binNr].OrderBy(ep => ep.AssignedBin).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));292 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 150 293 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions); 151 294 if (positionFound != null) { … … 170 313 var item = itemMeasures[itemIndex]; 171 314 172 extremePointsForBin[binNr] = new HashSet<ThreeDimensionalPacking>(extremePointsForBin[binNr].OrderBy(ep => ep.AssignedBin).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));315 extremePointsForBin[binNr] = OrderExtremePoints(extremePointsForBin[binNr], occupiedPoints, binMeasures); 173 316 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePointsForBin[binNr], occupiedPoints, itemPositions); 174 317 if (positionFound != null) { … … 208 351 foreach (int itemIndex in solution.PackingSequence) { 209 352 var item = itemMeasures[itemIndex]; 210 extremePoints = new HashSet<ThreeDimensionalPacking>(extremePoints.OrderBy(ep => ep.AssignedBin).ThenBy(ep => ShortestPossibleSideFromEP(ep, occupiedPoints, binMeasures)));353 extremePoints = OrderExtremePoints(extremePoints, occupiedPoints, binMeasures); 211 354 var positionFound = FindExtremePointForItem(itemIndex, itemMeasures, binMeasures, extremePoints, occupiedPoints, itemPositions); 212 355 if (positionFound != null) { … … 373 516 return extremePoints; 374 517 } 518 519 520 private static HashSet<ThreeDimensionalPacking> OrderExtremePoints(HashSet<ThreeDimensionalPacking> hashSet, List<int[, ,]> occupiedPoints, CuboidPackingBin binMeasures) { 521 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))); 522 } 375 523 private static int ShortestPossibleSideFromEP(ThreeDimensionalPacking ep, List<int[, ,]> occupiedPoints, CuboidPackingBin binMeasures) { 376 524 int shortestSide = int.MaxValue; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/Attributes/SingleGroupingMoveAttribute.cs
r9440 r9473 29 29 public class SingleGroupingMoveAttribute : MultiComponentVectorMoveAttribute { 30 30 [Storable] 31 public int I temIndex { get; protected set; }31 public int Index { get; protected set; } 32 32 [Storable] 33 33 public int AssignedBin { get; protected set; } … … 37 37 protected SingleGroupingMoveAttribute(SingleGroupingMoveAttribute original, Cloner cloner) 38 38 : base(original, cloner) { 39 this.I temIndex = original.ItemIndex;39 this.Index = original.Index; 40 40 this.AssignedBin = original.AssignedBin; 41 41 } 42 42 public SingleGroupingMoveAttribute() : this(-1, -1, -1) { } 43 public SingleGroupingMoveAttribute(int i temIndex, int assignedBin, double moveQuality)43 public SingleGroupingMoveAttribute(int index, int assignedBin, double moveQuality) 44 44 : base(moveQuality) { 45 I temIndex = itemIndex;45 Index = index; 46 46 AssignedBin = assignedBin; 47 47 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/ExhaustiveMultiComponentVectorMoveGenerator.cs
r9440 r9473 40 40 } 41 41 42 43 42 public static MultiComponentVectorMove[] Apply(MultiComponentVectorEncoding multiComponentVector) { 44 //NrOfMoves = nrOfRotationMoves + nrOfSingleGroupingMoves + nrOfSwap SequenceMoves43 //NrOfMoves = nrOfRotationMoves + nrOfSingleGroupingMoves + nrOfSwapPositionMoves 45 44 // nrOfRotationMoves = nrOfItems 46 45 // nrOfSingleGroupingMoves = nrOfItems * (nrOfBins - 1) 47 // nrOfSwapSequenceMoves = SUM(foreach binNr: !nrOfItemsInBin) 48 49 int lastBinNr = 0; 50 foreach (var pi in multiComponentVector.PackingInformations) { 51 if (pi.AssignedBin > lastBinNr) 52 lastBinNr = pi.AssignedBin; 53 } 54 int nrOfBins = lastBinNr + 1; 55 56 int nrOfRotationMoves = multiComponentVector.PackingInformations.Count; 57 int nrOfSingleGroupingMoves = nrOfRotationMoves * (nrOfBins - 1); 58 59 int[] itemsPerBin = new int[nrOfBins]; 60 foreach (var pi in multiComponentVector.PackingInformations) { 61 itemsPerBin[pi.AssignedBin]++; 62 } 63 int nrOfSwapSequenceMoves = 0; 64 foreach (int items in itemsPerBin) { 65 nrOfSwapSequenceMoves += (items * (items - 1)) / 2; 66 } 67 68 int totalMoves = nrOfRotationMoves + nrOfSingleGroupingMoves + nrOfSwapSequenceMoves; 46 // nrOfSwapPositionMoves = SUM(foreach binNr: !nrOfItemsInBin) 47 int totalMoves = 48 NrOfRotationMoves(multiComponentVector) + 49 NrOfSingleGroupingMoves(multiComponentVector) + 50 NrOfSwapPositionMoves(multiComponentVector) + 51 NrOfChangePositionMoves(multiComponentVector); 69 52 MultiComponentVectorMove[] moves = new MultiComponentVectorMove[totalMoves]; 70 53 int count = 0; … … 75 58 moves[count++] = move; 76 59 } 77 foreach (MultiComponentVectorMove move in GenerateSwapSequenceMoves(multiComponentVector)) { 60 foreach (MultiComponentVectorMove move in GenerateSwapPositionMoves(multiComponentVector)) { 61 moves[count++] = move; 62 } 63 foreach (MultiComponentVectorMove move in GenerateChangePositionMoves(multiComponentVector)) { 78 64 moves[count++] = move; 79 65 } 80 66 return moves; 81 } 67 } 82 68 83 69 protected override MultiComponentVectorMove[] GenerateMoves(MultiComponentVectorEncoding multiComponentVector) { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/Moves/SingleGroupingMove.cs
r9440 r9473 30 30 public class SingleGroupingMove : MultiComponentVectorMove { 31 31 [Storable] 32 public int I temIndex { get; protected set; }32 public int Index { get; protected set; } 33 33 [Storable] 34 34 public int NewGroup { get; protected set; } … … 38 38 protected SingleGroupingMove(SingleGroupingMove original, Cloner cloner) 39 39 : base(original, cloner) { 40 this.I temIndex = original.ItemIndex;40 this.Index = original.Index; 41 41 this.NewGroup = original.NewGroup; 42 42 } 43 43 public SingleGroupingMove(int index, int newGroup, MultiComponentVectorEncoding multiComponentVector) 44 44 : base(multiComponentVector) { 45 I temIndex = index;45 Index = index; 46 46 NewGroup = newGroup; 47 47 } … … 52 52 53 53 public override MultiComponentVectorEncoding GetVectorAfterMove() { 54 //var result = new MultiComponentVectorEncoding(); 55 //result.PackingInformations = new ItemList<PackingInformation>(this.MultiComponentVector.PackingInformations); 56 //result.PackingInformations[ItemIndex].AssignedBin = NewGroup; 57 //return result; 58 return InsertItemgeneAfterLastItemgeneOfUsedBin(MultiComponentVector, ItemIndex, NewGroup); 54 return GetVectorAfterMove(MultiComponentVector, Index, NewGroup); 59 55 } 60 private MultiComponentVectorEncoding InsertItemgeneAfterLastItemgeneOfUsedBin(MultiComponentVectorEncoding solution, int itemIndex, int binNr) { 56 public static MultiComponentVectorEncoding GetVectorAfterMove(MultiComponentVectorEncoding originalSolution, int itemIndex, int binNr) { 57 var solution = originalSolution.Clone (new Cloner()) as MultiComponentVectorEncoding; 61 58 var itemgene = solution.PackingInformations[itemIndex]; 62 59 solution.PackingInformations.Remove(itemgene); … … 64 61 int targetIndex = solution.PackingInformations.FindLastIndex(pi => pi.AssignedBin == binNr); 65 62 solution.PackingInformations.Insert(targetIndex + 1, itemgene); 63 //solution.PackingInformations[itemIndex].AssignedBin = binNr; 66 64 return solution; 67 65 } … … 70 68 return typeof(SingleGroupingMoveAttribute); 71 69 } 70 71 public override string ToString() { 72 return "GM(i="+Index+",g="+NewGroup+")"; 73 } 72 74 } 73 75 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/Moves/SingleItemRotationMove.cs
r9440 r9473 48 48 49 49 public override MultiComponentVectorEncoding GetVectorAfterMove() { 50 var result = new MultiComponentVectorEncoding(); 51 result.PackingInformations = new ItemList<PackingInformation>(this.MultiComponentVector.PackingInformations); 52 result.PackingInformations[ItemIndex].Rotated = !result.PackingInformations[ItemIndex].Rotated; 50 return GetVectorAfterMove (MultiComponentVector, ItemIndex); 51 } 52 public static MultiComponentVectorEncoding GetVectorAfterMove(MultiComponentVectorEncoding multiComponentVector, int itemIndex) { 53 var result = multiComponentVector.Clone(new Cloner()) as MultiComponentVectorEncoding; 54 result.PackingInformations[itemIndex].Rotated = !result.PackingInformations[itemIndex].Rotated; 53 55 return result; 54 56 } … … 57 59 return typeof(SingleItemRotationMoveAttribute); 58 60 } 61 62 public override string ToString() { 63 return "RM(i=" + ItemIndex+")"; 64 } 59 65 } 60 66 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/MultiComponentVectorMoveGenerator.cs
r9440 r9473 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Problems.BinPacking.Decoders; 29 30 using HeuristicLab.Problems.BinPacking.Interfaces; 31 using HeuristicLab.Problems.BinPacking.PackingBin; 32 using HeuristicLab.Problems.BinPacking.PackingItem; 30 33 31 34 namespace HeuristicLab.Encodings.PackingEncoding.MultiComponentVector { … … 44 47 protected ScopeParameter CurrentScopeParameter { 45 48 get { return (ScopeParameter)Parameters["CurrentScope"]; } 46 } 49 } 50 47 51 48 52 [StorableConstructor] … … 57 61 58 62 59 60 63 public static int NrOfRotationMoves(MultiComponentVectorEncoding mcv) { 64 return mcv.PackingInformations.Count; 65 } 61 66 public static IEnumerable<MultiComponentVectorMove> GenerateRotationMoves(MultiComponentVectorEncoding multiComponentVector) { 62 67 for (int i = 0; i < multiComponentVector.PackingInformations.Count; i++) … … 64 69 } 65 70 71 public static int NrOfSingleGroupingMoves(MultiComponentVectorEncoding mcv) { 72 int nrOfBins = 0; 73 foreach (var pi in mcv.PackingInformations) { 74 if (pi.AssignedBin > nrOfBins) 75 nrOfBins = pi.AssignedBin; 76 } 77 nrOfBins++; 78 return mcv.PackingInformations.Count * (nrOfBins - 1); 79 } 66 80 public static IEnumerable<MultiComponentVectorMove> GenerateSingleGroupingMoves(MultiComponentVectorEncoding multiComponentVector) { 67 81 int nrOfBins = 0; … … 78 92 } 79 93 80 public static IEnumerable<MultiComponentVectorMove> GenerateSwapSequenceMoves(MultiComponentVectorEncoding multiComponentVector) { 94 public static int NrOfSwapPositionMoves(MultiComponentVectorEncoding mcv) { 95 int nrOfBins = 0; 96 foreach (var pi in mcv.PackingInformations) { 97 if (pi.AssignedBin > nrOfBins) 98 nrOfBins = pi.AssignedBin; 99 } 100 nrOfBins++; 101 int[] itemsPerBin = new int[nrOfBins]; 102 foreach (var pi in mcv.PackingInformations) { 103 itemsPerBin[pi.AssignedBin]++; 104 } 105 int nrOfSwapPositionMoves = 0; 106 foreach (int items in itemsPerBin) { 107 nrOfSwapPositionMoves += (items * (items - 1)) / 2; 108 } 109 return nrOfSwapPositionMoves; 110 } 111 public static IEnumerable<MultiComponentVectorMove> GenerateSwapPositionMoves(MultiComponentVectorEncoding multiComponentVector) { 81 112 Dictionary<int, List<int>> indexesPerBin = new Dictionary<int, List<int>>(); 82 113 for (int i = 0; i < multiComponentVector.PackingInformations.Count; i++) { … … 89 120 for (int i = 0; i < entry.Value.Count - 1; i++) 90 121 for (int j = i + 1; j < entry.Value.Count; j++) 91 yield return new Swap SequenceMove(entry.Value[i], entry.Value[j], multiComponentVector);122 yield return new SwapPositionMove(entry.Value[i], entry.Value[j], multiComponentVector); 92 123 } 93 124 } 94 125 126 public static int NrOfChangePositionMoves(MultiComponentVectorEncoding mcv) { 127 int nrOfBins = 0; 128 foreach (var pi in mcv.PackingInformations) { 129 if (pi.AssignedBin > nrOfBins) 130 nrOfBins = pi.AssignedBin; 131 } 132 nrOfBins++; 133 int[] itemsPerBin = new int[nrOfBins]; 134 foreach (var pi in mcv.PackingInformations) { 135 itemsPerBin[pi.AssignedBin]++; 136 } 137 int nrOfSwapPositionMoves = 0; 138 foreach (int items in itemsPerBin) { 139 nrOfSwapPositionMoves += (items * (items - 1)) / 2; 140 } 141 return nrOfSwapPositionMoves; 142 } 143 public static IEnumerable<MultiComponentVectorMove> GenerateChangePositionMoves(MultiComponentVectorEncoding multiComponentVector) { 144 Dictionary<int, List<int>> indexesPerBin = new Dictionary<int, List<int>>(); 145 for (int i = 0; i < multiComponentVector.PackingInformations.Count; i++) { 146 int currentBin = multiComponentVector.PackingInformations[i].AssignedBin; 147 if (!indexesPerBin.ContainsKey(currentBin)) 148 indexesPerBin[currentBin] = new List<int>(); 149 indexesPerBin[currentBin].Add(i); 150 } 151 foreach (var entry in indexesPerBin) { 152 for (int i = 0; i < entry.Value.Count - 1; i++) 153 for (int j = i + 1; j < entry.Value.Count; j++) 154 yield return new ChangePositionMove(entry.Value[i], entry.Value[j], multiComponentVector); 155 } 156 } 95 157 96 158 public override IOperation Apply() { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/MultiComponentVectorMoveHardTabuCriterion.cs
r9440 r9473 94 94 private bool IsMoveTabu(ItemList<IItem> tabuList, MultiComponentVectorMove move, MultiComponentVectorEncoding multiComponentVector, double moveQuality, bool maximization, bool useAspiration) { 95 95 bool isTabu = false; 96 SingleItemRotationMove sirm = move as SingleItemRotationMove; 97 SingleGroupingMove sgm = move as SingleGroupingMove; 98 SwapSequenceMove ssm = move as SwapSequenceMove; 96 SingleItemRotationMove sirm = move as SingleItemRotationMove; 97 SingleGroupingMove sgm = move as SingleGroupingMove; 98 SwapPositionMove spm = move as SwapPositionMove; 99 ChangePositionMove cpm = move as ChangePositionMove; 100 MCVTripleMove tm = move as MCVTripleMove; 99 101 var attributes = tabuList.FindAll(ta => ta.GetType().Equals(move.GetMoveAttributeType())); 100 102 … … 102 104 foreach (IItem tabuMove in attributes) { 103 105 SingleItemRotationMoveAttribute sirmAttr = (tabuMove as SingleItemRotationMoveAttribute); 106 if (sirmAttr.MoveQuality.Equals(moveQuality)) 107 return true; 104 108 if (sirmAttr != null 105 109 && (!useAspiration … … 114 118 foreach (IItem tabuMove in attributes) { 115 119 SingleGroupingMoveAttribute sgmAttr = (tabuMove as SingleGroupingMoveAttribute); 120 if (sgmAttr.MoveQuality.Equals(moveQuality)) 121 return true; 116 122 if (sgmAttr != null 117 123 && (!useAspiration 118 124 || maximization && moveQuality <= sgmAttr.MoveQuality 119 125 || !maximization && moveQuality >= sgmAttr.MoveQuality)) { 120 if (sgm.ItemIndex == sgmAttr.ItemIndex || multiComponentVector.PackingInformations[sgm.ItemIndex].AssignedBin == sgmAttr.AssignedBin) 126 if ( multiComponentVector.PackingInformations[sgm.Index].ItemIndex == multiComponentVector.PackingInformations[sgmAttr.Index].ItemIndex 127 || multiComponentVector.PackingInformations[sgm.Index].AssignedBin == sgmAttr.AssignedBin) 121 128 isTabu = true; 122 129 } 123 130 if (isTabu) break; 124 131 } 125 } else if (s sm != null) {132 } else if (spm != null) { 126 133 foreach (IItem tabuMove in attributes) { 127 SwapSequenceMoveAttribute ssmAttr = (tabuMove as SwapSequenceMoveAttribute); 128 if (ssmAttr != null 134 SwapPositionMoveAttribute spmAttr = (tabuMove as SwapPositionMoveAttribute); 135 if (spmAttr.MoveQuality.Equals(moveQuality)) 136 return true; 137 if (spmAttr != null 129 138 && (!useAspiration 130 || maximization && moveQuality <= ssmAttr.MoveQuality 131 || !maximization && moveQuality >= ssmAttr.MoveQuality)) { 132 if (ssm.Index1 == ssmAttr.Index1 133 || ssm.Index2 == ssmAttr.Index2 134 || multiComponentVector.PackingInformations[ssm.Index1].ItemIndex == ssmAttr.ItemIndex1 135 || multiComponentVector.PackingInformations[ssm.Index2].ItemIndex == ssmAttr.ItemIndex2) 139 || maximization && moveQuality <= spmAttr.MoveQuality 140 || !maximization && moveQuality >= spmAttr.MoveQuality)) { 141 if (spm.Index1 == spmAttr.Index1 142 || spm.Index2 == spmAttr.Index2 143 || multiComponentVector.PackingInformations[spm.Index1].ItemIndex == spmAttr.ItemIndex1 144 || multiComponentVector.PackingInformations[spm.Index2].ItemIndex == spmAttr.ItemIndex2) 145 isTabu = true; 146 } 147 if (isTabu) break; 148 } 149 } else if (cpm != null) { 150 foreach (IItem tabuMove in attributes) { 151 ChangePositionMoveAttribute cpmAttr = (tabuMove as ChangePositionMoveAttribute); 152 if (cpmAttr.MoveQuality.Equals(moveQuality)) 153 return true; 154 if (cpmAttr != null 155 && (!useAspiration 156 || maximization && moveQuality <= cpmAttr.MoveQuality 157 || !maximization && moveQuality >= cpmAttr.MoveQuality)) { 158 if (cpm.Index == cpmAttr.Index 159 || cpm.TargetIndex == cpmAttr.TargetIndex 160 || multiComponentVector.PackingInformations[cpm.Index].ItemIndex == cpmAttr.ItemIndex) 161 isTabu = true; 162 } 163 if (isTabu) break; 164 } 165 } else if (tm != null) { 166 foreach (IItem tabuMove in attributes) { 167 MCVTripleMoveAttribute tmAttr = (tabuMove as MCVTripleMoveAttribute); 168 if (tmAttr.MoveQuality.Equals(moveQuality)) 169 return true; 170 if (tmAttr != null 171 && (!useAspiration 172 || maximization && moveQuality <= tmAttr.MoveQuality 173 || !maximization && moveQuality >= tmAttr.MoveQuality)) { 174 if ((tm.Index == tmAttr.Index && tm.TargetIndex == tmAttr.TargetIndex) 175 || tm.Index == tmAttr.Index 176 || multiComponentVector.PackingInformations[tm.Index].ItemIndex == tmAttr.ItemIndex 177 ) 136 178 isTabu = true; 137 179 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/MultiComponentVectorMoveMaker.cs
r9440 r9473 66 66 public override IOperation Apply() { 67 67 MultiComponentVectorMove move = MultiComponentVectorMoveParameter.ActualValue; 68 MultiComponentVectorEncoding MultiComponentVector = MultiComponentVectorParameter.ActualValue;68 MultiComponentVectorEncoding multiComponentVector = MultiComponentVectorParameter.ActualValue; 69 69 DoubleValue moveQuality = MoveQualityParameter.ActualValue; 70 70 DoubleValue quality = QualityParameter.ActualValue; 71 71 72 MultiComponentVector = move.GetVectorAfterMove();72 multiComponentVector.PackingInformations = move.GetVectorAfterMove().PackingInformations; 73 73 74 74 quality.Value = moveQuality.Value; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/MultiComponentVectorMoveSoftTabuCriterion.cs
r9440 r9473 65 65 public MultiComponentVectorMoveSoftTabuCriterion() 66 66 : base() { 67 67 Parameters.Add(new LookupParameter<MultiComponentVectorMove>("MultiComponentVectorMove", "The move to evaluate.")); 68 68 Parameters.Add(new LookupParameter<MultiComponentVectorEncoding>("MultiComponentVector", "The solution to evaluate.")); 69 69 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); … … 94 94 private bool IsMoveTabu(ItemList<IItem> tabuList, MultiComponentVectorMove move, MultiComponentVectorEncoding multiComponentVector, double moveQuality, bool maximization, bool useAspiration) { 95 95 bool isTabu = false; 96 SingleItemRotationMove sirm = move as SingleItemRotationMove; 97 SingleGroupingMove sgm = move as SingleGroupingMove; 98 SwapSequenceMove ssm = move as SwapSequenceMove; 96 97 SingleItemRotationMove sirm = move as SingleItemRotationMove; 98 SingleGroupingMove sgm = move as SingleGroupingMove; 99 SwapPositionMove spm = move as SwapPositionMove; 100 ChangePositionMove cpm = move as ChangePositionMove; 101 MCVTripleMove tm = move as MCVTripleMove; 99 102 var attributes = tabuList.FindAll(ta => ta.GetType().Equals(move.GetMoveAttributeType())); 100 103 … … 106 109 || maximization && moveQuality <= sirmAttr.MoveQuality 107 110 || !maximization && moveQuality >= sirmAttr.MoveQuality)) { 108 109 111 if (sirm.ItemIndex == sirmAttr.ItemIndex && multiComponentVector.PackingInformations[sirm.ItemIndex].Rotated == sirmAttr.ItemRotation) 112 isTabu = true; 110 113 } 111 114 if (isTabu) break; … … 118 121 || maximization && moveQuality <= sgmAttr.MoveQuality 119 122 || !maximization && moveQuality >= sgmAttr.MoveQuality)) { 120 if (sgm.ItemIndex == sgmAttr.ItemIndex && multiComponentVector.PackingInformations[sgm.ItemIndex].AssignedBin == sgmAttr.AssignedBin) 121 isTabu = true; 123 if (multiComponentVector.PackingInformations[sgm.Index].ItemIndex == multiComponentVector.PackingInformations[sgmAttr.Index].ItemIndex 124 && multiComponentVector.PackingInformations[sgm.Index].AssignedBin == sgmAttr.AssignedBin) 125 isTabu = true; 122 126 } 123 127 if (isTabu) break; 124 128 } 125 } else if (s sm != null) {129 } else if (spm != null) { 126 130 foreach (IItem tabuMove in attributes) { 127 Swap SequenceMoveAttribute ssmAttr = (tabuMove as SwapSequenceMoveAttribute);128 if (s smAttr != null131 SwapPositionMoveAttribute spmAttr = (tabuMove as SwapPositionMoveAttribute); 132 if (spmAttr != null 129 133 && (!useAspiration 130 || maximization && moveQuality <= ssmAttr.MoveQuality 131 || !maximization && moveQuality >= ssmAttr.MoveQuality)) { 132 if (ssm.Index1 == ssmAttr.Index1 133 && ssm.Index2 == ssmAttr.Index2 134 && multiComponentVector.PackingInformations[ssm.Index1].ItemIndex == ssmAttr.ItemIndex1 135 && multiComponentVector.PackingInformations[ssm.Index2].ItemIndex == ssmAttr.ItemIndex2) 134 || maximization && moveQuality <= spmAttr.MoveQuality 135 || !maximization && moveQuality >= spmAttr.MoveQuality)) { 136 if (spm.Index1 == spmAttr.Index1 137 && spm.Index2 == spmAttr.Index2 138 && multiComponentVector.PackingInformations[spm.Index1].ItemIndex == spmAttr.ItemIndex1 139 && multiComponentVector.PackingInformations[spm.Index2].ItemIndex == spmAttr.ItemIndex2) 140 isTabu = true; 141 } 142 if (isTabu) break; 143 } 144 } else if (cpm != null) { 145 foreach (IItem tabuMove in attributes) { 146 ChangePositionMoveAttribute cpmAttr = (tabuMove as ChangePositionMoveAttribute); 147 if (cpmAttr != null 148 && (!useAspiration 149 || maximization && moveQuality <= cpmAttr.MoveQuality 150 || !maximization && moveQuality >= cpmAttr.MoveQuality)) { 151 if (cpm.Index == cpmAttr.Index 152 && cpm.TargetIndex == cpmAttr.TargetIndex 153 && multiComponentVector.PackingInformations[cpm.Index].ItemIndex == cpmAttr.ItemIndex) 154 isTabu = true; 155 } 156 if (isTabu) break; 157 } 158 } else if (tm != null) { 159 foreach (IItem tabuMove in attributes) { 160 MCVTripleMoveAttribute tmAttr = (tabuMove as MCVTripleMoveAttribute); 161 if (tmAttr != null 162 && (!useAspiration 163 || maximization && moveQuality <= tmAttr.MoveQuality 164 || !maximization && moveQuality >= tmAttr.MoveQuality)) { 165 if ((tm.Index == tmAttr.Index && tm.TargetIndex == tmAttr.TargetIndex) 166 && multiComponentVector.PackingInformations[tm.Index].ItemIndex == tmAttr.ItemIndex 167 && tm.Rotation == !(tmAttr.RotationAfter.Equals(tmAttr.RotationBefore)) 168 && (tm.Group == tmAttr.GroupAfter && multiComponentVector.PackingInformations[tm.Index].AssignedBin == tmAttr.GroupBefore) 169 ) 136 170 isTabu = true; 137 171 } … … 140 174 } 141 175 142 176 143 177 144 178 return isTabu; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/MultiComponentVectorTabuMaker.cs
r9440 r9473 64 64 SingleGroupingMove sgm = move as SingleGroupingMove; 65 65 if (sgm != null) 66 return new SingleGroupingMoveAttribute(sgm.ItemIndex, solution.PackingInformations[sgm.ItemIndex].AssignedBin, baseQuality); 67 SwapSequenceMove ssm = move as SwapSequenceMove; 68 if (ssm != null) 69 return new SwapSequenceMoveAttribute(ssm.Index1, ssm.Index2, solution.PackingInformations[ssm.Index1].ItemIndex, solution.PackingInformations[ssm.Index2].ItemIndex, baseQuality); 66 return new SingleGroupingMoveAttribute(sgm.Index, solution.PackingInformations[sgm.Index].AssignedBin, baseQuality); 67 SwapPositionMove spm = move as SwapPositionMove; 68 if (spm != null) 69 return new SwapPositionMoveAttribute(spm.Index1, spm.Index2, solution.PackingInformations[spm.Index1].ItemIndex, solution.PackingInformations[spm.Index2].ItemIndex, baseQuality); 70 ChangePositionMove cpm = move as ChangePositionMove; 71 if (cpm != null) 72 return new ChangePositionMoveAttribute(cpm.Index, cpm.TargetIndex, solution.PackingInformations[cpm.Index].ItemIndex, baseQuality); 73 MCVTripleMove tm = move as MCVTripleMove; 74 if (tm != null) 75 return new MCVTripleMoveAttribute( 76 tm.Index, 77 tm.TargetIndex, 78 solution.PackingInformations[tm.Index].ItemIndex, 79 solution.PackingInformations[tm.Index].Rotated, 80 tm.Rotation ^ solution.PackingInformations[tm.Index].Rotated, 81 solution.PackingInformations[tm.Index].AssignedBin, 82 tm.Group, 83 baseQuality); 70 84 71 85 else return solution; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/Moves/ThreeWay/StochasticMultiComponentVectorMoveGenerator.cs
r9440 r9473 60 60 MultiComponentVectorMove[] moves = new MultiComponentVectorMove[sampleSize]; 61 61 var rm = new List<MultiComponentVectorMove> (GenerateRotationMoves(multiComponentVector)); 62 var gm = new List<MultiComponentVectorMove> (GenerateSingleGroupingMoves(multiComponentVector)); 63 var sm = new List<MultiComponentVectorMove> (GenerateSwapSequenceMoves(multiComponentVector)); 62 var gm = new List<MultiComponentVectorMove>(GenerateSingleGroupingMoves(multiComponentVector)); 63 var sm = new List<MultiComponentVectorMove>(GenerateSwapPositionMoves(multiComponentVector)); 64 var cpm = new List<MultiComponentVectorMove>(GenerateChangePositionMoves(multiComponentVector)); 64 65 65 66 for (int i = 0; i < sampleSize; i++) { 66 int typeDecision = random.Next( 3);67 int typeDecision = random.Next(4); 67 68 switch (typeDecision) { 68 69 case 0: moves[i] = rm[random.Next(rm.Count)]; … … 71 72 break; 72 73 case 2: moves[i] = sm[random.Next(sm.Count)]; 74 break; 75 case 3: moves[i] = cpm[random.Next(cpm.Count)]; 73 76 break; 74 77 default: -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs
r9440 r9473 68 68 MultiComponentVectorEncoding mce = obj as MultiComponentVectorEncoding; 69 69 if (mce != null && mce.PackingInformations != null && mce.PackingInformations.Count == this.PackingInformations.Count) { 70 for (int i = 0; i < =mce.PackingInformations.Count; i++) {70 for (int i = 0; i < mce.PackingInformations.Count; i++) { 71 71 if (mce.PackingInformations[i] != this.PackingInformations[i]) 72 72 return false; … … 134 134 var result = new ItemList<PackingInformation>(); 135 135 foreach (int itemIndex in permutation) { 136 result.Add(new PackingInformation (itemIndex, random.Next(0, lowerBound + 1), random.Next(0,100) > 60 ? true : false)); 136 result.Add(new PackingInformation(itemIndex, random.Next(0, lowerBound + 1), random.Next(0, 100) > 60 ? true : false)); 137 } 138 return result; 139 } 140 141 public static ItemList<PackingInformation> CreateListRandomlyWithSortedSequence(int items, int lowerBound, IRandom random) { 142 Permutation permutation = new Permutation(PermutationTypes.Absolute, items); 143 var result = new ItemList<PackingInformation>(); 144 foreach (int itemIndex in permutation) { 145 result.Add(new PackingInformation(itemIndex, random.Next(0, lowerBound + 1), false)); 137 146 } 138 147 return result; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorRandomCreator.cs
r9440 r9473 43 43 get { return (IValueLookupParameter<IntValue>)Parameters["LowerBound"]; } 44 44 } 45 public IValueParameter<BoolValue> SortedSequenceParameter { 46 get { return (IValueParameter<BoolValue>)Parameters["SortedSequence"]; } 47 } 45 48 46 49 [StorableConstructor] … … 52 55 } 53 56 54 57 public MultiComponentVectorRandomCreator() 55 58 : base() { 56 59 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 57 60 Parameters.Add(new ValueLookupParameter<IntValue>("PackingItems", "The number of packing-items handled in this problem instance.")); 58 61 Parameters.Add(new ValueLookupParameter<IntValue>("LowerBound", "The lower possible number of bins needed to solve this problem (taken from Dell'Amico, Martello and Vigo; 2002)")); 62 Parameters.Add(new ValueParameter<BoolValue>("SortedSequence", "Determines if the items of the created instances are to be sorted by their size.")); 59 63 60 64 EncodedSolutionParameter.ActualName = "MultiComponentVector"; 65 SortedSequenceParameter.ActualValue = new BoolValue(false); 61 66 } 62 67 63 68 64 public static MultiComponentVectorEncoding Apply(int items, int lowerBound, IRandom random) {69 public static MultiComponentVectorEncoding Apply(int items, int lowerBound, IRandom random, bool sortedSequence) { 65 70 var solution = new MultiComponentVectorEncoding(); 66 solution.PackingInformations = PackingInformation.CreateListRandomly(items, lowerBound, random); 71 if (sortedSequence) 72 solution.PackingInformations = PackingInformation.CreateListRandomlyWithSortedSequence(items, lowerBound, random); 73 else 74 solution.PackingInformations = PackingInformation.CreateListRandomly(items, lowerBound, random); 67 75 return solution; 68 76 } 69 77 70 78 protected override IPackingSolutionEncoding CreateSolution() { 71 return Apply(PackingItemsParameter.ActualValue.Value, LowerBoundParameter.ActualValue.Value, RandomParameter.ActualValue );79 return Apply(PackingItemsParameter.ActualValue.Value, LowerBoundParameter.ActualValue.Value, RandomParameter.ActualValue, SortedSequenceParameter.Value.Value); 72 80 } 73 81 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/PackingRatioRegularIdenticalBinEvaluator.cs
r9440 r9473 93 93 double usedSpaceInThisBin = packedItemsInThisBin.Select(s => s.Value.MultipliedMeasures).Sum(); 94 94 //k = 2 --> (Fi/C)*(Fi/C) 95 result += (((usedSpaceInThisBin) / (usableSpace)) * ((usedSpaceInThisBin) / (usableSpace))) / (i + 1);95 result += (((usedSpaceInThisBin) / (usableSpace)) * ((usedSpaceInThisBin) / (usableSpace))) / (i*i + 1); 96 96 } 97 97 -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
r9440 r9473 176 176 <Compile Include="Decoders\3D\DBL\DeepestBottomLeftMultiComponentVectorDecoder.cs" /> 177 177 <Compile Include="Decoders\3D\DBL\DeepestBottomLeftFunctions.cs" /> 178 <Compile Include="Decoders\3D\EP\ExtremePointPotvinDecoder3D.cs"> 179 <SubType>Code</SubType> 180 </Compile> 178 181 <Compile Include="Decoders\3D\EP\ExtremePointsFunctions3D.cs" /> 179 182 <Compile Include="Decoders\3D\DBL\DeepestBottomLeftGroupingVectorDecoder.cs" /> … … 196 199 <Compile Include="Encodings\GroupingVector\GroupingVectorManipulator.cs" /> 197 200 <Compile Include="Encodings\GroupingVector\GroupingVectorRandomCreator.cs" /> 198 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\SwapSequenceMoveAttribute.cs" /> 201 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\ChangePositionMoveAttribute.cs" /> 202 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\MCVTripleMoveAttribute.cs" /> 203 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\SwapPositionMoveAttribute.cs" /> 199 204 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\SingleGroupingMoveAttribute.cs" /> 200 205 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\MultiComponentVectorMoveAttribute.cs" /> 201 206 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Attributes\SingleItemRotationMoveAttribute.cs" /> 207 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\StochasticMCVTripleMoveGenerator.cs" /> 208 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\ExhaustiveMCVTripleMoveGenerator.cs" /> 209 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\ChangePositionMove.cs" /> 210 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\MCVTripleMove.cs" /> 202 211 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\MultiComponentVectorMoveHardTabuCriterion.cs" /> 203 212 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\MultiComponentVectorMove.cs" /> 204 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\Swap SequenceMove.cs" />213 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\SwapPositionMove.cs" /> 205 214 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\Moves\SingleItemRotationMove.cs" /> 206 215 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\ExhaustiveMultiComponentVectorMoveGenerator.cs" /> … … 211 220 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\MultiComponentVectorTabuMaker.cs" /> 212 221 <Compile Include="Encodings\MultiComponentVector\Moves\ThreeWay\StochasticMultiComponentVectorMoveGenerator.cs" /> 222 <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorEncoding.cs"> 223 <SubType>Code</SubType> 224 </Compile> 213 225 <Compile Include="Encodings\MultiComponentVector\PartiallyMatchedMultiComponentVectorCrossover.cs" /> 214 226 <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorCrossover.cs" /> 215 <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorEncoding.cs" />216 227 <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorManipulator.cs" /> 217 228 <Compile Include="Encodings\MultiComponentVector\MultiComponentVectorRandomCreator.cs" /> … … 225 236 <Compile Include="Encodings\PackingSolutionCrossover.cs" /> 226 237 <Compile Include="Encodings\PackingSolutionManipulator.cs" /> 238 <Compile Include="Encodings\Potvin\PotvinEncoding.cs"> 239 <SubType>Code</SubType> 240 </Compile> 241 <Compile Include="Encodings\Potvin\PotvinRandomCreator.cs"> 242 <SubType>Code</SubType> 243 </Compile> 227 244 <Compile Include="Evaluators\2D\BinUtilizationRectangularIdenticalBinEvaluator.cs" /> 228 245 <Compile Include="Evaluators\2D\PackingRatioRectangularIdenticalBinEvaluator.cs" /> … … 240 257 <Compile Include="Instances\BPPORLIBParser.cs" /> 241 258 <Compile Include="Instances\BPPORLIBDataDescriptor.cs" /> 259 <Compile Include="Interfaces\IPotvinOperator.cs" /> 242 260 <Compile Include="Interfaces\IMultiComponentVectorMoveOperator.cs" /> 243 261 <Compile Include="Interfaces\IGroupingVectorMoveOperator.cs" /> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs
r9440 r9473 26 26 /// Plugin class for HeuristicLab.Problems.BinPacking plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9 348")]28 [Plugin("HeuristicLab.Problems.BinPacking", "3.3.7.9440")] 29 29 [PluginFile("HeuristicLab.Problems.BinPacking-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/CuboidIdenticalBinPackingProblem.cs
r9440 r9473 44 44 using HeuristicLab.Problems.Instances; 45 45 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector; 46 using HeuristicLab.Encodings.PackingEncoding.Potvin; 46 47 47 48 namespace HeuristicLab.Problems.BinPacking.Problem { … … 125 126 } else if (SolutionCreator is MultiComponentVectorRandomCreator) { 126 127 PackingSolutionDecoder = new ExtremePointMultiComponentVectorDecoder3D(); 128 } else if (SolutionCreator is PotvinRandomCreator) { 129 PackingSolutionDecoder = new ExtremePointPotvinDecoder3D(); 127 130 } else { 128 131 string error = "The given problem does not support the selected solution-creator."; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs
r9440 r9473 43 43 using HeuristicLab.Problems.Instances; 44 44 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector; 45 using HeuristicLab.Encodings.PackingEncoding.Potvin; 45 46 46 47 namespace HeuristicLab.Problems.BinPacking.Problem { … … 138 139 Operators.AddRange(ApplicationManager.Manager.GetInstances<IMultiComponentVectorOperator>()); 139 140 InitializeDecoder(); 141 } else if (SolutionCreator.GetType() == typeof(PotvinRandomCreator)) { 142 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPotvinOperator>()); 143 InitializeDecoder(); 140 144 } 141 145 }
Note: See TracChangeset
for help on using the changeset viewer.