Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/06/13 03:12:42 (11 years ago)
Author:
jhelm
Message:

#1966: Applied some heavy refactoring on the decoder-classes and cleaned up the code a bit;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointMultiComponentVectorDecoder3D.cs

    r9563 r9593  
    3838using HeuristicLab.Encodings.PackingEncoding.GroupingVector;
    3939using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
     40using HeuristicLab.Parameters;
    4041
    4142namespace HeuristicLab.Problems.BinPacking.Decoders {
     
    4748      CuboidPackingItem>, I3DMCVDecoder {
    4849
     50    public ValueParameter<BoolValue> StackingConstraintsParameter {
     51      get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; }
     52    }
     53
    4954    public ExtremePointMultiComponentVectorDecoder3D ()
    5055      : base() {
     56      Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not."));
    5157    }
    5258    [StorableConstructor]
     
    5965    }
    6066
    61     public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) {
     67    public static PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Decode(MultiComponentVectorEncoding solution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures, bool stackingConstraints) {
    6268      PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result =
    63         new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures, itemMeasures);
     69        new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures);
    6470
    65       result.PackingItemPositions = ExtremePointsFunctions3D.ExtremePointBasedPacking(ref solution, itemMeasures, binMeasures);
     71      result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, stackingConstraints);
    6672
    6773      return result;
     
    7379      if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
    7480
    75       return Decode(solution, binMeasures, itemMeasures);
     81      return Decode(solution, binMeasures, itemMeasures, StackingConstraintsParameter.Value.Value);
    7682    }
    7783  }
Note: See TracChangeset for help on using the changeset viewer.