Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontAnalyzer.cs @ 6934

Last change on this file since 6934 was 5438, checked in by gkronber, 14 years ago

#1040 Reviewed NSGA-II operators in 'HeuristicLab.Analysis.MultiObjective', 'HeuristicLab.Optimization.Operators.MultiObjective' and 'HeuristicLab.Selection' and fixed minor issues.

File size: 1.7 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 IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
14      get { return (IScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; }
15    }
16    public ILookupParameter<ResultCollection> ResultsParameter {
17      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
18    }
19
20    [StorableConstructor]
21    protected ParetoFrontAnalyzer(bool deserializing) : base(deserializing) { }
22    protected ParetoFrontAnalyzer(ParetoFrontAnalyzer original, Cloner cloner) : base(original, cloner) { }
23    public ParetoFrontAnalyzer() {
24      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of qualities of each solution."));
25      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The result collection to store the front to."));
26    }
27
28    public override IOperation Apply() {
29      ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue;
30      ResultCollection results = ResultsParameter.ActualValue;
31      Analyze(qualities, results);
32      return base.Apply();
33    }
34
35    protected abstract void Analyze(ItemArray<DoubleArray> qualities, ResultCollection results);
36  }
37}
Note: See TracBrowser for help on using the repository browser.