Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/02/13 04:26:26 (11 years ago)
Author:
jhelm
Message:

#1966: Implemented additional Operator-Wrappers for PackingSequence and GroupingVector; Implemented additional problem-class for Rosenbauer-Problemstatement; Added marker-interfaces for decoder-types;

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/CuboidIdenticalBinPackingProblem.cs

    r9495 r9563  
    4444using HeuristicLab.Problems.Instances;
    4545using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector;
     46using HeuristicLab.PluginInfrastructure;
    4647
    4748namespace HeuristicLab.Problems.BinPacking.Problem {
     
    112113    }
    113114    public CuboidIdenticalBinPackingProblem() : base(
    114       new PackingPlanEvaluationAlgorithm<PackingSequenceEncoding, ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>()) {
     115      new PackingPlanEvaluationAlgorithm<Permutation, ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>()) {
    115116    }
    116117
     
    121122      Operators.RemoveAll(op => typeof(I2DOperator).IsAssignableFrom(op.GetType()));
    122123
    123       if (SolutionCreator is PackingSequenceRandomCreator) {
    124         PackingSolutionDecoder = new ExtremePointPackingSequenceDecoder3D();
    125       } else if (SolutionCreator is GroupingVectorRandomCreator) {
    126         PackingSolutionDecoder = new ExtremePointGroupingVectorDecoder3D();
    127       } else if (SolutionCreator is MultiComponentVectorRandomCreator) {
    128         PackingSolutionDecoder = new ExtremePointMultiComponentVectorDecoder3D();
     124      PackingSolutionDecoderParameter.ValidValues.Clear();
     125      if (SolutionCreator is PackingSequenceRandomCreator) {   
     126        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DPSDecoder>());
     127        //PackingSolutionDecoder = new ExtremePointPackingSequenceDecoder3D();
     128      } else if (SolutionCreator is GroupingVectorRandomCreator) {     
     129        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DGVDecoder>());
     130        //PackingSolutionDecoder = new ExtremePointGroupingVectorDecoder3D();
     131      } else if (SolutionCreator is MultiComponentVectorRandomCreator) {   
     132        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I3DMCVDecoder>());
     133        //PackingSolutionDecoder = ApplicationManager.Manager.GetInstances<ExtremePointMultiComponentVectorDecoder3D>().First();
    129134      } else {
    130135        string error = "The given problem does not support the selected solution-creator.";
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/ISOContainerBinPackingProblem.cs

    r9495 r9563  
    4949  [StorableClass]
    5050  [Creatable("Problems")]
    51   public class ISOContainerBinPackingProblem : RegularIdenticalBinPackingProblem<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> {
     51  public class ISOContainerBinPackingProblem : CuboidIdenticalBinPackingProblem {
     52
    5253
    5354    #region Default Instance
    54     private static readonly BPPData DefaultInstance = new BPPData() { 
    55       Name = "3D BPP Default Instance",
    56       Description = "The default instance for 3D Bin Packing.",
     55    private static readonly RealBPPData DefaultInstance = new RealBPPData() { 
     56      Name = "3D BPP with weigthed items Default Instance",
     57      Description = "The default instance for 3D Bin Packing Problem with weighted items.",
    5758      BinMeasures = new int[] {25,25,35},
    5859      ItemMeasures = new int[][] {
     
    99100        new int[] {9,11,9}
    100101      },
    101       Items = 30
     102      Items = 30,
     103      ItemWeights = new double[] {
     104        12*5*10,
     105        10*18*20,
     106        9*7*7,
     107        21*12*4,
     108        8*8*12,
     109        3*6*14,
     110        20*4*9,
     111        5*9*8,
     112        7*17*3,
     113        13*20*15,
     114        9*11*9,
     115        10*18*20,
     116        9*7*7,
     117        21*12*4,
     118        8*8*12,
     119        3*6*14,
     120        20*4*9,
     121        5*9*8,
     122        7*17*3,
     123        13*20*15,
     124        9*11*9,
     125        10*18*20,
     126        9*7*7,
     127        21*12*4,
     128        8*8*12,
     129        3*6*14,
     130        20*4*9,
     131        5*9*8,
     132        7*17*3,
     133        13*20*15,
     134        9*11*9
     135      },
     136      ItemMaterials = new int[] {
     137        1,
     138        0,
     139        0,
     140        1,
     141        0,
     142        0,
     143        1,
     144        1,
     145        0,
     146        1,
     147        1,
     148        0,
     149        0,
     150        1,
     151        0,
     152        0,
     153        1,
     154        1,
     155        0,
     156        1,
     157        1,
     158        0,
     159        0,
     160        1,
     161        0,
     162        0,
     163        1,
     164        1,
     165        0,
     166        1,
     167        1,
     168
     169      }
    102170    };
    103171    #endregion
     
    111179      return new ISOContainerBinPackingProblem(this, cloner);
    112180    }
    113     public ISOContainerBinPackingProblem() : base(
    114       new PackingPlanEvaluationAlgorithm<PackingSequenceEncoding, ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>()) {
     181    public ISOContainerBinPackingProblem()
     182      : base() {
    115183    }
    116184
     
    119187    #region Helpers
    120188    protected override void InitializeDecoder() {
    121       if (SolutionCreator is PackingSequenceRandomCreator) {
    122         PackingSolutionDecoder = new ExtremePointPackingSequenceDecoder3D();
    123       } else if (SolutionCreator is GroupingVectorRandomCreator) {
    124         PackingSolutionDecoder = new ExtremePointGroupingVectorDecoder3D();
    125       } else if (SolutionCreator is MultiComponentVectorRandomCreator) {
    126         PackingSolutionDecoder = new ExtremePointMultiComponentVectorDecoder3D();
     189      Operators.RemoveAll(op => typeof(I2DOperator).IsAssignableFrom(op.GetType()));
     190
     191      PackingSolutionDecoderParameter.ValidValues.Clear();
     192      if (SolutionCreator is MultiComponentVectorRandomCreator) {
     193        PackingSolutionDecoderParameter.ValidValues.Add(new ISOContainerMultiComponentVectorDecoder3D());
    127194      } else {
    128195        string error = "The given problem does not support the selected solution-creator.";
     
    131198    }
    132199
    133     protected override IPackingPlanEvaluator CreateDefaultEvaluator() {
    134       return new PackingRatioCuboidIdenticalBinEvaluator();
    135     }
    136 
    137200    protected override void InitializeProblemData() {
    138201      Load(DefaultInstance);
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RectangularIdenticalBinPackingProblem.cs

    r9495 r9563  
    108108    }
    109109    public RectangularIdenticalBinPackingProblem() : base(
    110       new PackingPlanEvaluationAlgorithm<PackingSequenceEncoding, TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>()) {
     110      new PackingPlanEvaluationAlgorithm<Permutation, TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>()) {
    111111    }
    112112
     
    116116      Operators.RemoveAll(op => typeof(I3DOperator).IsAssignableFrom(op.GetType()));
    117117
    118       if (SolutionCreator is PackingSequenceRandomCreator) {
    119         PackingSolutionDecoder = new ExtremePointPackingSequenceDecoder2D();
    120       } else if (SolutionCreator is GroupingVectorRandomCreator) {
    121         PackingSolutionDecoder = new ExtremePointGroupingVectorDecoder2D();
    122       } else if (SolutionCreator is MultiComponentVectorRandomCreator) {
    123         PackingSolutionDecoder = new ExtremePointMultiComponentVectorDecoder2D();
     118      PackingSolutionDecoderParameter.ValidValues.Clear();
     119      if (SolutionCreator is PackingSequenceRandomCreator) {       
     120        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DPSDecoder>());
     121        //PackingSolutionDecoder = new ExtremePointPackingSequenceDecoder2D();
     122      } else if (SolutionCreator is GroupingVectorRandomCreator) { 
     123        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DGVDecoder>());
     124        //PackingSolutionDecoder = new ExtremePointGroupingVectorDecoder2D();
     125      } else if (SolutionCreator is MultiComponentVectorRandomCreator) { 
     126        PackingSolutionDecoderParameter.ValidValues.UnionWith(ApplicationManager.Manager.GetInstances<I2DMCVDecoder>());
     127        //PackingSolutionDecoder = new ExtremePointMultiComponentVectorDecoder2D();
    124128      } else {
    125129        string error = "The given problem does not support the selected solution-creator.";
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs

    r9495 r9563  
    5656      get { return (ValueParameter<B>)Parameters["PackingBinMeasures"]; }
    5757    }
    58     public OptionalValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter {
    59       get { return (OptionalValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; }
     58    public ConstrainedValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter {
     59      get { return (ConstrainedValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; }
    6060    }
    6161    #endregion
     
    8585      Parameters.Add(new ValueParameter<B>("PackingBinMeasures", "Packing-bin data defining the measures of the used bins.", new B()));
    8686      Parameters.Add(new ValueParameter<IPackingPlanEvaluator>("PackingPlanEvaluator", "The evaluator is used to determine the quality of a solution.", CreateDefaultEvaluator()));
    87       Parameters.Add(new OptionalValueParameter<IPackingSolutionDecoder>("PackingSolutionDecoder", "The operator that decodes the representation and creates a packing plan."));
     87      Parameters.Add(new ConstrainedValueParameter<IPackingSolutionDecoder>("PackingSolutionDecoder", "The operator that decodes the representation and creates a packing plan."));
    8888      this.Maximization.Value = true;
    8989      InitializeProblemInstance();
     
    232232
    233233    #region Problem instance handling
    234     public void Load(BPPData data) {
     234    public virtual void Load(BPPData data) {
     235      var realData = data as RealBPPData;
    235236      var binData = new B();
    236237      binData.InitializeFromMeasures (data.BinMeasures);
     
    241242        item.InitializeFromMeasures(data.ItemMeasures[j]);
    242243        item.AddTargetBinMeasures(data.BinMeasures);
     244        if (realData != null) {
     245          item.Weight = realData.ItemWeights[j];
     246          item.Material = realData.ItemMaterials[j];
     247        }
    243248        itemData.Add(item);
    244249      }
Note: See TracChangeset for help on using the changeset viewer.