Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/16 15:50:10 (8 years ago)
Author:
bwerth
Message:

#1087 refactored Analyzers to use ResultParameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/ScatterPlotAnalyzer.cs

    r14092 r14097  
    3737    }
    3838
     39    public IResultParameter<ScatterPlotContent> ScatterPlotResultParameter {
     40      get { return (IResultParameter<ScatterPlotContent>)Parameters["Scatterplot"]; }
     41    }
     42
     43
    3944    [StorableConstructor]
    4045    protected ScatterPlotAnalyzer(bool deserializing) : base(deserializing) { }
     
    4651    public ScatterPlotAnalyzer() {
    4752      Parameters.Add(new ScopeTreeLookupParameter<RealVector>("Individuals", "The individual solutions to the problem"));
     53      Parameters.Add(new ResultParameter<ScatterPlotContent>("Scatterplot", "The scatterplot for the current and optimal (if known front)"));
     54
    4855    }
    4956
    5057    public override IOperation Apply() {
    51       var results = ResultsParameter.ActualValue;
    5258      var qualities = QualitiesParameter.ActualValue;
    5359      var testFunction = TestFunctionParameter.ActualValue;
    5460      int objectives = qualities[0].Length;
    5561      var individuals = IndividualsParameter.ActualValue;
    56 
    57       if (!results.ContainsKey("Scatterplot")) {
    58         results.Add(new Result("Scatterplot", typeof(ScatterPlotContent)));
    59       }
    6062
    6163      double[][] optimalFront = new double[0][];
     
    6668      var solutionClones = individuals.Select(s => s.ToArray()).ToArray();
    6769
    68       results["Scatterplot"].Value = new ScatterPlotContent(qualityClones, solutionClones, optimalFront, objectives);
     70      ScatterPlotResultParameter.ActualValue = new ScatterPlotContent(qualityClones, solutionClones, optimalFront, objectives);
    6971
    7072      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.