Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/11/17 19:36:03 (7 years ago)
Author:
pfleck
Message:

#2592

  • Renamed ScatterPlotContent to ParetoFrontScatterPlot (also renamed corresponding view).
  • Refactored ParetoFrontScatterPlotView (use ScatterPlot internally).
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/ParetoFrontScatterPlot.cs

    r15202 r15203  
    1919 */
    2020#endregion
     21
    2122using System.Linq;
    2223using HeuristicLab.Common;
     
    2627namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    2728  [StorableClass]
    28   [Item("ScatterPlot", "The optimal front, current front and its associated Points in the searchspace")]
    29   public class ScatterPlotContent : Item {
     29  [Item("Pareto Front Scatter Plot", "The optimal front, current front and its associated Points in the searchspace")]
     30  public class ParetoFrontScatterPlot : Item {
     31
     32    [Storable]
     33    private int objectives;
     34    public int Objectives {
     35      get { return objectives; }
     36    }
     37
     38    [Storable]
     39    private int problemSize;
     40    public int ProblemSize {
     41      get { return problemSize; }
     42    }
    3043
    3144    [Storable]
    3245    private double[][] qualities;
    3346    public double[][] Qualities {
    34       get {
    35         return qualities;
    36       }
    37 
    38       private set {
    39         qualities = value;
    40       }
    41     }
    42 
    43     [Storable]
    44     private int objectives;
    45     public int Objectives {
    46       get {
    47         return objectives;
    48       }
    49 
    50       private set {
    51         objectives = value;
    52       }
     47      get { return qualities; }
    5348    }
    5449
     
    5651    private double[][] solutions;
    5752    public double[][] Solutions {
    58       get {
    59         return solutions;
    60       }
    61 
    62       private set {
    63         solutions = value;
    64       }
     53      get { return solutions; }
    6554    }
    6655
     
    6857    private double[][] paretoFront;
    6958    public double[][] ParetoFront {
    70       get {
    71         return paretoFront;
    72       }
    73 
    74       private set {
    75         paretoFront = value;
    76       }
     59      get { return paretoFront; }
    7760    }
    7861
    79     [StorableConstructor]
    80     protected ScatterPlotContent(bool deserializing) : base() { }
    81 
    82     protected ScatterPlotContent(ScatterPlotContent original, Cloner cloner)
    83       : this() {
    84       this.qualities = original.qualities.Select(s => s.ToArray()).ToArray();
    85       this.solutions = original.solutions.Select(s => s.ToArray()).ToArray();
    86       this.paretoFront = original.paretoFront.Select(s => s.ToArray()).ToArray();
    87       this.objectives = original.objectives;
    88     }
    89     protected ScatterPlotContent() : base() { }
    90     public ScatterPlotContent(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) {
     62    #region Constructor, Cloning & Persistance
     63    public ParetoFrontScatterPlot(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives, int problemSize) {
    9164      this.qualities = qualities;
    9265      this.solutions = solutions;
    9366      this.paretoFront = paretoFront;
    9467      this.objectives = objectives;
     68      this.problemSize = problemSize;
     69    }
     70    public ParetoFrontScatterPlot() { }
     71
     72    protected ParetoFrontScatterPlot(ParetoFrontScatterPlot original, Cloner cloner)
     73      : base(original, cloner) {
     74      if (original.qualities != null) qualities = original.qualities.Select(s => s.ToArray()).ToArray();
     75      if (original.solutions != null) solutions = original.solutions.Select(s => s.ToArray()).ToArray();
     76      if (original.paretoFront != null) paretoFront = original.paretoFront.Select(s => s.ToArray()).ToArray();
     77      objectives = original.objectives;
     78      problemSize = original.problemSize;
     79    }
     80    public override IDeepCloneable Clone(Cloner cloner) {
     81      return new ParetoFrontScatterPlot(this, cloner);
    9582    }
    9683
    97     public override IDeepCloneable Clone(Cloner cloner) {
    98       return new ScatterPlotContent(this, cloner);
    99     }
     84    [StorableConstructor]
     85    protected ParetoFrontScatterPlot(bool deserializing)
     86      : base(deserializing) { }
     87    #endregion
    10088  }
    10189}
Note: See TracChangeset for help on using the changeset viewer.