#region License Information
/* HeuristicLab
* Copyright (C) 2002-2012 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 System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HeuristicLab.Common;
using HeuristicLab.Core;
using HeuristicLab.Data;
using HeuristicLab.Operators;
using HeuristicLab.Optimization;
using HeuristicLab.Parameters;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
using HeuristicLab.Problems.BinPacking.Interfaces;
using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
using HeuristicLab.Problems.BinPacking.Shapes;
namespace HeuristicLab.Problems.BinPacking.Analyzers {
[Item("BinPackingAnalyzer", "Represents the generalized form of Analyzers for BinPacking Problems.")]
[StorableClass]
public abstract class BinPackingAnalyzer : SingleSuccessorOperator, IAnalyzer
where D : class, IPackingDimensions
where B : PackingShape, IPackingBin
where I : PackingShape, IPackingItem {
public virtual bool EnabledByDefault {
get { return true; }
}
protected BinPackingAnalyzer(BinPackingAnalyzer original, Cloner cloner)
: base(original, cloner) {
}
#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
public 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 ScopeTreeLookupParameter>("PackingPlan", "The solutions from which the best solution has to be chosen from."));
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."));
}
}
}