source: trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/ParetoFrontScatterPlot.cs @ 15203

Last change on this file since 15203 was 15203, checked in by pfleck, 4 years ago

#2592

  • Renamed ScatterPlotContent to ParetoFrontScatterPlot (also renamed corresponding view).
  • Refactored ParetoFrontScatterPlotView (use ScatterPlot internally).
File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Linq;
23using HeuristicLab.Common;
24using HeuristicLab.Core;
25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26
27namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
28  [StorableClass]
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    }
43
44    [Storable]
45    private double[][] qualities;
46    public double[][] Qualities {
47      get { return qualities; }
48    }
49
50    [Storable]
51    private double[][] solutions;
52    public double[][] Solutions {
53      get { return solutions; }
54    }
55
56    [Storable]
57    private double[][] paretoFront;
58    public double[][] ParetoFront {
59      get { return paretoFront; }
60    }
61
62    #region Constructor, Cloning & Persistance
63    public ParetoFrontScatterPlot(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives, int problemSize) {
64      this.qualities = qualities;
65      this.solutions = solutions;
66      this.paretoFront = paretoFront;
67      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);
82    }
83
84    [StorableConstructor]
85    protected ParetoFrontScatterPlot(bool deserializing)
86      : base(deserializing) { }
87    #endregion
88  }
89}
Note: See TracBrowser for help on using the repository browser.