Changeset 14153 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding
- Timestamp:
- 07/21/16 14:33:53 (8 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/BottomLeftIntegerVectorDecoder.cs
r14151 r14153 46 46 } 47 47 48 protected override PackingPosition FindPositionForItem(BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>bp, PackingItem item) {48 protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item) { 49 49 return bp.FindPositionBySliding(item, rotated: false); 50 50 } 51 51 52 protected override BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>CreatePacking(52 protected override BinPacking2D CreatePacking( 53 53 Solution partialSolution, 54 54 ref IList<int> remainingIDs, IList<PackingItem> items) { 55 var bp = partialSolution.NewBinPacking();55 var bp = new BinPacking2D(partialSolution.BinMeasures); 56 56 bp.SlidingBasedPacking(ref remainingIDs, items); 57 57 return bp; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/ExtremePointIntegerVectorDecoder.cs
r14151 r14153 46 46 } 47 47 48 protected override PackingPosition FindPositionForItem(BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>bp, PackingItem item) {48 protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item) { 49 49 return bp.FindExtremePointForItem(item, false, stackingConstraints: false); 50 50 } 51 51 52 protected override BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>CreatePacking(52 protected override BinPacking2D CreatePacking( 53 53 Solution partialSolution, 54 54 ref IList<int> remainingIDs, IList<PackingItem> items) { 55 var bp = partialSolution.NewBinPacking();55 var bp = new BinPacking2D(partialSolution.BinMeasures); 56 56 bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false); 57 57 return bp; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/IntegerVectorDecoderBase.cs
r14151 r14153 39 39 40 40 41 public Solution Decode(IntegerVector intVec, PackingShape binShape, IList<PackingItem> items) {41 public virtual Solution Decode(IntegerVector intVec, PackingShape binShape, IList<PackingItem> items) { 42 42 var sequenceMatrix = IntegerVectorProblem.GenerateSequenceMatrix(intVec); 43 43 Solution result = CreateSolution(binShape); … … 54 54 var temp = new List<int>(remainingIDs); 55 55 foreach (int id in temp) { 56 foreach ( varbp in result.BinPackings) {56 foreach (BinPacking2D bp in result.BinPackings) { 57 57 var position = FindPositionForItem(bp, items[id]); 58 58 if (position != null) { … … 70 70 result.UpdateBinPackings(); 71 71 72 // gkronber: original implementation also updates the encoded solution72 // gkronber: original implementation by Helm also updates the encoded solution (TODO) 73 73 // var newSolution = new int[intVec.Length]; 74 74 // int binIndex = 0; … … 84 84 85 85 protected abstract Solution CreateSolution(PackingShape binShape); 86 protected abstract PackingPosition FindPositionForItem(BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>bp, PackingItem item);87 protected abstract BinPacking .BinPacking<PackingPosition, PackingShape, PackingItem>CreatePacking(Solution partialSolution, ref IList<int> remainingIDs, IList<PackingItem> items);86 protected abstract PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item); 87 protected abstract BinPacking2D CreatePacking(Solution partialSolution, ref IList<int> remainingIDs, IList<PackingItem> items); 88 88 } 89 89 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/IntegerVectorProblem.cs
r14151 r14153 66 66 private void AddOperators() { 67 67 68 // move operators are not yet supported 68 // move operators are not yet supported (TODO) 69 69 Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator); 70 70 Operators.RemoveAll(x => x is SingleObjectiveMoveMaker); 71 71 Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator); 72 72 73 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); 73 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); // gkronber: not strictly necessary (only when customer ops are added) 74 74 } 75 75
Note: See TracChangeset
for help on using the changeset viewer.