#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.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.PackingEncoding; using HeuristicLab.Operators; using HeuristicLab.Optimization; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Problems.BinPacking { [Item("BinPackingAnalyzer", "Represents the generalized form of Analyzers for BinPacking Problems.")] [StorableClass] public abstract class BinPackingAnalyzer : SingleSuccessorOperator, IAnalyzer where D : class, IPackingPosition where B : PackingShape where I : PackingShape, IPackingItem { public virtual bool EnabledByDefault { get { return true; } } #region Parameter Properties public LookupParameter MaximizationParameter { get { return (LookupParameter)Parameters["Maximization"]; } } public ScopeTreeLookupParameter QualityParameter { get { return (ScopeTreeLookupParameter)Parameters["Quality"]; } } public LookupParameter> BestSolutionParameter { get { return (LookupParameter>)Parameters["BestSolution"]; } } public ValueLookupParameter ResultsParameter { get { return (ValueLookupParameter)Parameters["Results"]; } } public LookupParameter BestKnownQualityParameter { get { return (LookupParameter)Parameters["BestKnownQuality"]; } } public LookupParameter> BestKnownSolutionParameter { get { return (LookupParameter>)Parameters["BestKnownSolution"]; } } public ScopeTreeLookupParameter> PackingPlanParameter { get { return (ScopeTreeLookupParameter>)Parameters["PackingPlan"]; } } #endregion [StorableConstructor] protected BinPackingAnalyzer(bool deserializing) : base(deserializing) { } protected BinPackingAnalyzer(BinPackingAnalyzer original, Cloner cloner) : base(original, cloner) { } protected BinPackingAnalyzer() : base() { Parameters.Add(new LookupParameter("Maximization", "True if the problem is a maximization problem.")); Parameters.Add(new ScopeTreeLookupParameter("Quality", "The qualities of the packing solutions which should be analyzed.")); Parameters.Add(new LookupParameter>("BestSolution", "The best performing packing plan.")); Parameters.Add(new ValueLookupParameter("Results", "The result collection where the best packing solution should be stored.")); Parameters.Add(new LookupParameter("BestKnownQuality", "The quality of the best known solution of this packing-problem instance.")); Parameters.Add(new LookupParameter>("BestKnownSolution", "The best known solution of this packing-problem instance.")); Parameters.Add(new ScopeTreeLookupParameter>("PackingPlan", "The solutions from which the best solution has to be chosen from.")); } } }