Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 5143 was 5143, checked in by abeham, 13 years ago

#1040

  • Merged NSGA-II into trunk
  • Ranking and crowding operators moved to HeuristicLab.Optimization.Operators
  • CrowdedTournamentSelector moved to HeuristicLab.Selection
  • Pareto front analyzer moved to HeuristicLab.Analysis with a base class should there be more (as discussed with swagner and mkommend)
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("BasicMultiObjectiveSolutionAnalyzer", "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.