Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontAnalyzer.cs @ 8508

Last change on this file since 8508 was 7172, checked in by swagner, 13 years ago

Disabled run-time intensive analyzers by default (#1584)

File size: 1.8 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Operators;
5using HeuristicLab.Optimization;
6using HeuristicLab.Parameters;
7using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
8
9namespace HeuristicLab.Analysis {
10  [Item("ParetoFrontAnalyzer", "Analyzer for multiobjective problems that collects and presents the current Pareto front as double matrix as well as the solution scopes that lie on the current front.")]
11  [StorableClass]
12  public abstract class ParetoFrontAnalyzer : SingleSuccessorOperator, IAnalyzer {
13    public virtual bool EnabledByDefault {
14      get { return true; }
15    }
16
17    public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
18      get { return (IScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; }
19    }
20    public ILookupParameter<ResultCollection> ResultsParameter {
21      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
22    }
23
24    [StorableConstructor]
25    protected ParetoFrontAnalyzer(bool deserializing) : base(deserializing) { }
26    protected ParetoFrontAnalyzer(ParetoFrontAnalyzer original, Cloner cloner) : base(original, cloner) { }
27    public ParetoFrontAnalyzer() {
28      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of qualities of each solution."));
29      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The result collection to store the front to."));
30    }
31
32    public override IOperation Apply() {
33      ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue;
34      ResultCollection results = ResultsParameter.ActualValue;
35      Analyze(qualities, results);
36      return base.Apply();
37    }
38
39    protected abstract void Analyze(ItemArray<DoubleArray> qualities, ResultCollection results);
40  }
41}
Note: See TracBrowser for help on using the repository browser.