Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ParallelEngine/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontAnalyzer.cs @ 5177

Last change on this file since 5177 was 5177, checked in by swagner, 14 years ago

Removed property ExecutionContext in Operator (#1333)

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(IExecutionContext context) {
29      ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue;
30      ResultCollection results = ResultsParameter.ActualValue;
31      Analyze(context, qualities, results);
32      return base.Apply(context);
33    }
34
35    protected abstract void Analyze(IExecutionContext context, ItemArray<DoubleArray> qualities, ResultCollection results);
36  }
37}
Note: See TracBrowser for help on using the repository browser.