Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BinPackingAnalyzer.cs @ 16003

Last change on this file since 16003 was 14048, checked in by gkronber, 8 years ago

#1966: renamed *PackingDimension -> PackingPosition

File size: 4.0 KB
RevLine 
[9348]1#region License Information
2/* HeuristicLab
[13032]3 * Copyright (C) 2002-2015 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[9348]4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
[14046]25using HeuristicLab.Encodings.PackingEncoding;
[9348]26using HeuristicLab.Operators;
27using HeuristicLab.Optimization;
28using HeuristicLab.Parameters;
29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
30
[14046]31namespace HeuristicLab.Problems.BinPacking {
[9348]32  [Item("BinPackingAnalyzer", "Represents the generalized form of Analyzers for BinPacking Problems.")]
33  [StorableClass]
34  public abstract class BinPackingAnalyzer<D, B, I> : SingleSuccessorOperator, IAnalyzer
[14048]35    where D : class, IPackingPosition
[14045]36    where B : PackingShape<D>
[9348]37    where I : PackingShape<D>, IPackingItem {
38    public virtual bool EnabledByDefault {
39      get { return true; }
40    }
41
42    #region Parameter Properties
43    public LookupParameter<BoolValue> MaximizationParameter {
44      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
45    }
46    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
47      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
48    }
49    public LookupParameter<PackingPlan<D, B, I>> BestSolutionParameter {
50      get { return (LookupParameter<PackingPlan<D, B, I>>)Parameters["BestSolution"]; }
51    }
52    public ValueLookupParameter<ResultCollection> ResultsParameter {
53      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
54    }
55    public LookupParameter<DoubleValue> BestKnownQualityParameter {
56      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
57    }
58    public LookupParameter<PackingPlan<D, B, I>> BestKnownSolutionParameter {
59      get { return (LookupParameter<PackingPlan<D, B, I>>)Parameters["BestKnownSolution"]; }
60    }
61    public ScopeTreeLookupParameter<PackingPlan<D, B, I>> PackingPlanParameter {
62      get { return (ScopeTreeLookupParameter<PackingPlan<D,B,I>>)Parameters["PackingPlan"]; }
63    }
64    #endregion
65
[13605]66    [StorableConstructor]
67    protected BinPackingAnalyzer(bool deserializing) : base(deserializing) { }
68    protected BinPackingAnalyzer(BinPackingAnalyzer<D, B, I> original, Cloner cloner)
69      : base(original, cloner) {
70    }
71    protected BinPackingAnalyzer()
[9348]72      : base() {
73      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
74      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the packing solutions which should be analyzed."));
75      Parameters.Add(new LookupParameter<PackingPlan<D, B, I>>("BestSolution", "The best performing packing plan."));
76      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best packing solution should be stored."));
77      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this packing-problem instance."));
78      Parameters.Add(new LookupParameter<PackingPlan<D, B, I>>("BestKnownSolution", "The best known solution of this packing-problem instance."));
[13605]79      Parameters.Add(new ScopeTreeLookupParameter<PackingPlan<D, B, I>>("PackingPlan", "The solutions from which the best solution has to be chosen from."));
[9348]80    }
81  }
82}
Note: See TracBrowser for help on using the repository browser.