#region License Information /* HeuristicLab * Copyright (C) 2002-2015 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using HeuristicLab.Problems.BinPacking.Interfaces; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Core; using HeuristicLab.Common; using HeuristicLab.Problems.BinPacking.Decoders; using HeuristicLab.Problems.Instances; using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector; namespace HeuristicLab.Problems.BinPacking.Problem { [Item("Bin Packing Problem (3D, ISO containers) (BPP)", "Represents a three-dimensional bin-packing problem using two different bin sizes.")] [StorableClass] [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 320)] public class ISOContainerBinPackingProblem : CuboidIdenticalBinPackingProblem { #region Default Instance private static readonly RealBPPData DefaultInstance = new RealBPPData() { Name = "3D BPP with weigthed items Default Instance", Description = "The default instance for 3D Bin Packing Problem with weighted items.", BinMeasures = new int[] {25,25,35}, ItemMeasures = new int[][] { new int[] {12,5,10}, new int[] {10,18,20}, new int[] {9,7,7}, new int[] {21,12,4}, new int[] {8,8,12}, new int[] {3,6,14}, new int[] {20,4,9}, new int[] {5,9,8}, new int[] {7,17,3}, new int[] {13,20,15}, new int[] {9,11,9}, new int[] {10,18,20}, new int[] {9,7,7}, new int[] {21,12,4}, new int[] {8,8,12}, new int[] {3,6,14}, new int[] {20,4,9}, new int[] {5,9,8}, new int[] {7,17,3}, new int[] {13,20,15}, new int[] {9,11,9}, new int[] {10,18,20}, new int[] {9,7,7}, new int[] {21,12,4}, new int[] {8,8,12}, new int[] {3,6,14}, new int[] {20,4,9}, new int[] {5,9,8}, new int[] {7,17,3}, new int[] {13,20,15}, new int[] {9,11,9}, new int[] {10,18,20}, new int[] {9,7,7}, new int[] {21,12,4}, new int[] {8,8,12}, new int[] {3,6,14}, new int[] {20,4,9}, new int[] {5,9,8}, new int[] {7,17,3}, new int[] {13,20,15}, new int[] {9,11,9} }, Items = 30, ItemWeights = new double[] { 12*5*10, 10*18*20, 9*7*7, 21*12*4, 8*8*12, 3*6*14, 20*4*9, 5*9*8, 7*17*3, 13*20*15, 9*11*9, 10*18*20, 9*7*7, 21*12*4, 8*8*12, 3*6*14, 20*4*9, 5*9*8, 7*17*3, 13*20*15, 9*11*9, 10*18*20, 9*7*7, 21*12*4, 8*8*12, 3*6*14, 20*4*9, 5*9*8, 7*17*3, 13*20*15, 9*11*9 }, ItemMaterials = new int[] { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, } }; #endregion [StorableConstructor] protected ISOContainerBinPackingProblem(bool deserializing) : base(deserializing) { } protected ISOContainerBinPackingProblem(ISOContainerBinPackingProblem original, Cloner cloner) : base(original, cloner) { } public override IDeepCloneable Clone(Cloner cloner) { return new ISOContainerBinPackingProblem(this, cloner); } public ISOContainerBinPackingProblem() : base() { } #region Helpers protected override void InitializeDecoder() { // Operators.RemoveAll(op => op is I2DOperator); TODO PackingSolutionDecoderParameter.ValidValues.Clear(); if (SolutionCreator is MultiComponentVectorRandomCreator) { PackingSolutionDecoderParameter.ValidValues.Add(new ISOContainerMultiComponentVectorDecoder3D()); } else { string error = "The given problem does not support the selected solution-creator."; PluginInfrastructure.ErrorHandling.ShowErrorDialog(error, null); } } protected override void InitializeProblemData() { Load(DefaultInstance); } #endregion } }