Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/16 14:02:36 (8 years ago)
Author:
gkronber
Message:

#1966: refactoring of bin packing implementation

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/Decoders/DBL/DeepestBottomLeftPackingSequenceDecoder.cs

    r14049 r14128  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Common;
    26 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
    2726using HeuristicLab.Problems.BinPacking;
    2827using HeuristicLab.Encodings.PackingEncoding;
     28using HeuristicLab.Encodings.PermutationEncoding;
    2929
    3030namespace HeuristicLab.Problems.BinPacking3D {
     
    3232  [StorableClass]
    3333  public class DeepestBottomLeftPackingSequenceDecoder : PackingSolutionDecoder<PackingPosition, PackingShape, PackingItem>, I3DPSDecoder {
    34     public DeepestBottomLeftPackingSequenceDecoder(): base() {}
     34    public DeepestBottomLeftPackingSequenceDecoder() : base() { }
    3535    [StorableConstructor]
    3636    protected DeepestBottomLeftPackingSequenceDecoder(bool deserializing) : base(deserializing) { }
     
    4343
    4444    public override PackingPlan<PackingPosition, PackingShape, PackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, PackingShape binMeasures, ItemList<PackingItem> itemMeasures) {
    45       var solution = encodedSolution as PackingSequenceEncoding;
    46       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
     45      var solution = encodedSolution as Permutation;
     46      if (solution == null) throw new InvalidOperationException("Encoding is not of type Permutation");
    4747      Solution result = new Solution(binMeasures);
    4848      result.Pack(solution, itemMeasures);
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/Decoders/EP/ExtremePointPackingSequenceDecoder3D.cs

    r14049 r14128  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Common;
    27 using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
    2827using HeuristicLab.Problems.BinPacking;
    2928using HeuristicLab.Encodings.PackingEncoding;
     29using HeuristicLab.Encodings.PermutationEncoding;
    3030
    3131namespace HeuristicLab.Problems.BinPacking3D {
     
    4545
    4646    public override PackingPlan<PackingPosition, PackingShape, PackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, PackingShape binMeasures, ItemList<PackingItem> itemMeasures) {
    47       var solution = encodedSolution as PackingSequenceEncoding;
    48       if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
     47      var solution = encodedSolution as Permutation;
     48      if (solution == null) throw new InvalidOperationException("Encoding is not of type Permutation");
    4949      Solution result = new Solution(binMeasures, true, StackingConstraintsParameter.Value.Value);
    5050      result.Pack(solution, itemMeasures);
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/HeuristicLab.Problems.BinPacking3D-3.3.csproj

    r14062 r14128  
    166166    <Compile Include="DecoderInterfaces\I3DMCVDecoder.cs" />
    167167    <Compile Include="DecoderInterfaces\I3DPSDecoder.cs" />
    168     <Compile Include="Decoders\DBL\DeepestBottomLeftGroupingVectorDecoder.cs" />
    169     <Compile Include="Decoders\DBL\DeepestBottomLeftMultiComponentVectorDecoder.cs" />
    170168    <Compile Include="Decoders\DBL\DeepestBottomLeftPackingSequenceDecoder.cs" />
    171     <Compile Include="Decoders\EP\ExtremePointGroupingVectorDecoder3D.cs" />
    172     <Compile Include="Decoders\EP\ExtremePointMultiComponentVectorDecoder3D.cs" />
    173169    <Compile Include="Decoders\EP\ExtremePointPackingSequenceDecoder3D.cs" />
    174170    <Compile Include="I3DOperator.cs" />
     
    184180    <Compile Include="PackingShape.cs" />
    185181    <Compile Include="Plugin.cs" />
    186     <Compile Include="Problem.cs" />
    187182    <Compile Include="Properties\AssemblyInfo.cs" />
    188183    <Compile Include="Solution.cs" />
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/MoveEvaluators/PackingMoveEvaluator3DGV.cs

    r14049 r14128  
    3030  [Item("GroupingVectorMoveEvaluator3D", "Class for evaluating packing moves for 3dimensional problems.")]
    3131  [StorableClass]
    32   public class PackingMoveEvaluator3DGV : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IGroupingVectorMoveOperator, I3DOperator {
     32  public class PackingMoveEvaluator3DGV<M> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, M>, ISingleObjectiveMoveEvaluator, IGroupingVectorMoveOperator, I3DOperator
     33  where M: class, IItem {
    3334    [StorableConstructor]
    3435    protected PackingMoveEvaluator3DGV(bool deserializing) : base(deserializing) { }
    35     protected PackingMoveEvaluator3DGV(PackingMoveEvaluator3DGV original, Cloner cloner)
     36    protected PackingMoveEvaluator3DGV(PackingMoveEvaluator3DGV<M> original, Cloner cloner)
    3637      : base(original, cloner) {
    3738    }
    3839    public override IDeepCloneable Clone(Cloner cloner) {
    39       return new PackingMoveEvaluator3DGV(this, cloner);
     40      return new PackingMoveEvaluator3DGV<M>(this, cloner);
    4041    }
    4142    public PackingMoveEvaluator3DGV()
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/MoveEvaluators/PackingMoveEvaluator3DMCV.cs

    r14049 r14128  
    3030  [Item("MultiComponentVectorMoveEvaluator3D", "Class for evaluating packing moves for 3dimensional problems.")]
    3131  [StorableClass]
    32   public class PackingMoveEvaluator3DMCV : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IMultiComponentVectorMoveOperator, I3DOperator {
     32  public class PackingMoveEvaluator3DMCV<M> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, M>, ISingleObjectiveMoveEvaluator, IMultiComponentVectorMoveOperator, I3DOperator
     33  where M : class, IItem {
    3334    [StorableConstructor]
    3435    protected PackingMoveEvaluator3DMCV(bool deserializing) : base(deserializing) { }
    35     protected PackingMoveEvaluator3DMCV(PackingMoveEvaluator3DMCV original, Cloner cloner)
     36    protected PackingMoveEvaluator3DMCV(PackingMoveEvaluator3DMCV<M> original, Cloner cloner)
    3637      : base(original, cloner) {
    3738    }
    3839    public override IDeepCloneable Clone(Cloner cloner) {
    39       return new PackingMoveEvaluator3DMCV(this, cloner);
     40      return new PackingMoveEvaluator3DMCV<M>(this, cloner);
    4041    }
    4142    public PackingMoveEvaluator3DMCV()
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/MoveEvaluators/PackingMoveEvaluator3DPS.cs

    r14049 r14128  
    3030  [Item("PackingSequenceMoveEvaluator3D", "Class for evaluating packing moves for 3dimensional problems.")]
    3131  [StorableClass]
    32   public class PackingMoveEvaluator3DPS : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem>, ISingleObjectiveMoveEvaluator, IPackingSequenceMoveOperator, I3DOperator {
     32  public class PackingMoveEvaluator3DPS<M> : PackingMoveEvaluator<PackingPosition, PackingShape, PackingItem, M>, ISingleObjectiveMoveEvaluator, IPackingSequenceMoveOperator, I3DOperator
     33  where M : class, IItem {
    3334    [StorableConstructor]
    3435    protected PackingMoveEvaluator3DPS(bool deserializing) : base(deserializing) { }
    35     protected PackingMoveEvaluator3DPS(PackingMoveEvaluator3DPS original, Cloner cloner)
     36    protected PackingMoveEvaluator3DPS(PackingMoveEvaluator3DPS<M> original, Cloner cloner)
    3637      : base(original, cloner) {
    3738    }
    3839    public override IDeepCloneable Clone(Cloner cloner) {
    39       return new PackingMoveEvaluator3DPS(this, cloner);
     40      return new PackingMoveEvaluator3DPS<M>(this, cloner);
    4041    }
    4142    public PackingMoveEvaluator3DPS()
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/Problem.cs

    r14055 r14128  
    2626using HeuristicLab.Encodings.PermutationEncoding;
    2727using HeuristicLab.Encodings.PackingEncoding.PackingSequence;
    28 using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
    2928using HeuristicLab.Problems.Instances;
    30 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
    3129using HeuristicLab.PluginInfrastructure;
    3230using HeuristicLab.Data;
     
    131129      if (SolutionCreator is PackingSequenceRandomCreator) {
    132130        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DPSDecoder>());
    133       } else if (SolutionCreator is GroupingVectorRandomCreator) {
     131      } /* else if (SolutionCreator is GroupingVectorRandomCreator) {
    134132        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DGVDecoder>());
    135133      } else if (SolutionCreator is MultiComponentVectorRandomCreator) {
    136134        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DMCVDecoder>());
    137       } else {
     135      } */ else {
    138136        string error = "The given problem does not support the selected solution-creator.";
    139137        ErrorHandling.ShowErrorDialog(error, null);
Note: See TracChangeset for help on using the changeset viewer.