- Timestamp:
- 07/20/16 14:02:36 (8 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/BinPacking2D.cs
r14055 r14128 66 66 67 67 //Find ExtremePoints beginning from sourcepointY 68 var sourcePointY = new PackingPosition(0, position.X, position.Y + new Item.Height);68 var sourcePointY = new PackingPosition(0, position.X, position.Y + newHeight); 69 69 if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height) { 70 70 //Traversing down the x-axis -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/BL/BottomLeftPackingSequenceDecoder.cs
r14049 r14128 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Common; 27 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;28 27 using HeuristicLab.Problems.BinPacking; 29 28 using HeuristicLab.Encodings.PackingEncoding; 29 using HeuristicLab.Encodings.PermutationEncoding; 30 30 31 31 namespace HeuristicLab.Problems.BinPacking2D { … … 45 45 46 46 public override PackingPlan<PackingPosition, PackingShape, PackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, PackingShape binMeasures, ItemList<PackingItem> itemMeasures) { 47 var solution = encodedSolution as P ackingSequenceEncoding;47 var solution = encodedSolution as Permutation; 48 48 if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence"); 49 49 Solution result = new Solution(binMeasures); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/EP/ExtremePointMultiComponentVectorDecoder2D.cs
r14049 r14128 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Common; 26 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;27 26 using HeuristicLab.Problems.BinPacking; 28 27 using HeuristicLab.Encodings.PackingEncoding; -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/EP/ExtremePointPackingSequenceDecoder2D.cs
r14049 r14128 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Common; 27 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;28 27 using HeuristicLab.Problems.BinPacking; 29 28 using HeuristicLab.Encodings.PackingEncoding; 29 using HeuristicLab.Encodings.PermutationEncoding; 30 30 31 31 namespace HeuristicLab.Problems.BinPacking2D { … … 45 45 46 46 public override PackingPlan<PackingPosition, PackingShape, PackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, PackingShape binMeasures, ItemList<PackingItem> itemMeasures) { 47 var solution = encodedSolution as P ackingSequenceEncoding;48 if (solution == null) throw new InvalidOperationException("Encoding is not of type P ackingSequence");47 var solution = encodedSolution as Permutation; 48 if (solution == null) throw new InvalidOperationException("Encoding is not of type Permutation"); 49 49 Solution result = new Solution(binMeasures, true, false); 50 50 result.Pack(solution, itemMeasures); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/HeuristicLab.Problems.BinPacking2D-3.3.csproj
r14063 r14128 163 163 <ItemGroup> 164 164 <Compile Include="BinPacking2D.cs" /> 165 <Compile Include="Decoders\BL\BottomLeftGroupingVectorDecoder.cs" /> 166 <Compile Include="Decoders\BL\BottomLeftMultiComponentVectorDecoder.cs" /> 167 <Compile Include="Decoders\BL\BottomLeftPackingSequenceDecoder.cs" /> 168 <Compile Include="Decoders\EP\ExtremePointGroupingVectorDecoder2D.cs" /> 169 <Compile Include="Decoders\EP\ExtremePointMultiComponentVectorDecoder2D.cs" /> 170 <Compile Include="Decoders\EP\ExtremePointPackingSequenceDecoder2D.cs" /> 165 <Compile Include="Decoders\EP\ExtremePointPackingSequenceDecoder2D.cs"> 166 <SubType>Code</SubType> 167 </Compile> 171 168 <Compile Include="Instances\BPPData.cs" /> 172 169 <Compile Include="Instances\RandomDataDescriptor.cs" /> … … 176 173 <Compile Include="Interfaces\I2DOperator.cs" /> 177 174 <Compile Include="Interfaces\I2DPSDecoder.cs" /> 178 <Compile Include="MoveEvaluators\PackingMoveEvaluator2DGV.cs" />179 <Compile Include="MoveEvaluators\PackingMoveEvaluator2DMCV.cs" />180 <Compile Include="MoveEvaluators\PackingMoveEvaluator2DPS.cs" />181 175 <Compile Include="PackingItem.cs" /> 182 176 <Compile Include="PackingPosition.cs" /> 183 177 <Compile Include="PackingRatioEvaluator.cs" /> 178 <Compile Include="PackingSequenceProblem.cs" /> 184 179 <Compile Include="PackingShape.cs" /> 185 180 <Compile Include="Plugin.cs" /> 186 <Compile Include="Problem.cs" />187 181 <Compile Include="Properties\AssemblyInfo.cs" /> 188 182 <Compile Include="Solution.cs" /> … … 198 192 <Name>HeuristicLab.Problems.BinPacking-3.3</Name> 199 193 </ProjectReference> 194 </ItemGroup> 195 <ItemGroup> 196 <Folder Include="Decoders\BL\" /> 197 <Folder Include="MoveEvaluators\" /> 200 198 </ItemGroup> 201 199 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DGV.cs
r14049 r14128 29 29 [Item("GroupingVectorMoveEvaluator2D", "Class for evaluating packing moves for 2dimensional problems.")] 30 30 [StorableClass] 31 public class PackingMoveEvaluator2DGV : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IGroupingVectorMoveOperator, I2DOperator { 31 public class PackingMoveEvaluator2DGV<T> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, T>, ISingleObjectiveMoveEvaluator, IGroupingVectorMoveOperator, I2DOperator 32 where T : class , IItem { 32 33 [StorableConstructor] 33 34 protected PackingMoveEvaluator2DGV(bool deserializing) : base(deserializing) { } 34 protected PackingMoveEvaluator2DGV(PackingMoveEvaluator2DGV original, Cloner cloner)35 protected PackingMoveEvaluator2DGV(PackingMoveEvaluator2DGV<T> original, Cloner cloner) 35 36 : base(original, cloner) { 36 37 } 37 38 public override IDeepCloneable Clone(Cloner cloner) { 38 return new PackingMoveEvaluator2DGV (this, cloner);39 return new PackingMoveEvaluator2DGV<T>(this, cloner); 39 40 } 40 41 public PackingMoveEvaluator2DGV() -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DMCV.cs
r14049 r14128 29 29 [Item("MultiComponentVectorMoveEvaluator2D", "Class for evaluating packing moves for 2dimensional problems.")] 30 30 [StorableClass] 31 public class PackingMoveEvaluator2DMCV : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IMultiComponentVectorMoveOperator, I2DOperator { 31 public class PackingMoveEvaluator2DMCV<T> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, T>, ISingleObjectiveMoveEvaluator, IMultiComponentVectorMoveOperator, I2DOperator 32 where T : class, IItem { 32 33 [StorableConstructor] 33 34 protected PackingMoveEvaluator2DMCV(bool deserializing) : base(deserializing) { } 34 protected PackingMoveEvaluator2DMCV(PackingMoveEvaluator2DMCV original, Cloner cloner)35 protected PackingMoveEvaluator2DMCV(PackingMoveEvaluator2DMCV<T> original, Cloner cloner) 35 36 : base(original, cloner) { 36 37 } 37 38 public override IDeepCloneable Clone(Cloner cloner) { 38 return new PackingMoveEvaluator2DMCV (this, cloner);39 return new PackingMoveEvaluator2DMCV<T>(this, cloner); 39 40 } 40 41 public PackingMoveEvaluator2DMCV() -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DPS.cs
r14049 r14128 29 29 [Item("PackingSequenceMoveEvaluator2D", "Class for evaluating packing moves for 2dimensional problems.")] 30 30 [StorableClass] 31 public class PackingMoveEvaluator2DPS : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IPackingSequenceMoveOperator, I2DOperator { 31 public class PackingMoveEvaluator2DPS<T> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, T>, ISingleObjectiveMoveEvaluator, IPackingSequenceMoveOperator, I2DOperator 32 where T : class, IItem { 32 33 [StorableConstructor] 33 34 protected PackingMoveEvaluator2DPS(bool deserializing) : base(deserializing) { } 34 protected PackingMoveEvaluator2DPS(PackingMoveEvaluator2DPS original, Cloner cloner)35 protected PackingMoveEvaluator2DPS(PackingMoveEvaluator2DPS<T> original, Cloner cloner) 35 36 : base(original, cloner) { 36 37 } 37 38 public override IDeepCloneable Clone(Cloner cloner) { 38 return new PackingMoveEvaluator2DPS (this, cloner);39 return new PackingMoveEvaluator2DPS<T>(this, cloner); 39 40 } 40 41 public PackingMoveEvaluator2DPS() -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Problem.cs
r14055 r14128 26 26 using HeuristicLab.PluginInfrastructure; 27 27 using HeuristicLab.Encodings.PackingEncoding.PackingSequence; 28 using HeuristicLab.Encodings.PackingEncoding.GroupingVector;29 28 using HeuristicLab.Problems.Instances; 30 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;31 29 using HeuristicLab.Data; 32 using System;33 30 using HeuristicLab.Problems.BinPacking; 34 31 … … 37 34 [StorableClass] 38 35 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 300)] 39 // TODO: only support 2d BPPData40 36 public class Problem : Problem<PackingPosition, PackingShape, PackingItem>, IProblemInstanceConsumer<BPPData>, IProblemInstanceExporter<BPPData> { 41 37 … … 131 127 if (SolutionCreator is PackingSequenceRandomCreator) { 132 128 PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DPSDecoder>()); 133 } else if (SolutionCreator is GroupingVectorRandomCreator) {129 } /*else if (SolutionCreator is GroupingVectorRandomCreator) { 134 130 PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DGVDecoder>()); 135 131 } else if (SolutionCreator is MultiComponentVectorRandomCreator) { 136 132 PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DMCVDecoder>()); 137 } else {133 } */ else { 138 134 string error = "The given problem does not support the selected solution-creator."; 139 135 ErrorHandling.ShowErrorDialog(error, null);
Note: See TracChangeset
for help on using the changeset viewer.