Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Views/ScatterPlotContent.cs @ 14093

Last change on this file since 14093 was 14093, checked in by bwerth, 6 years ago

#1087 altered Cloning in ScatterPlotContent

File size: 2.8 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
21using System;
22using System.Drawing;
23using System.Linq;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27
28namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
29  [StorableClass]
30  public class ScatterPlotContent : Item {
31
32    [Storable]
33    private double[][] qualities;
34    public double[][] Qualities {
35      get {
36        return qualities;
37      }
38
39      set {
40        qualities = value;
41      }
42    }
43
44    [Storable]
45    private int objectives;
46    public int Objectives {
47      get {
48        return objectives;
49      }
50
51      set {
52        objectives = value;
53      }
54    }
55
56    [Storable]
57    private double[][] solutions;
58    public double[][] Solutions {
59      get {
60        return solutions;
61      }
62
63      set {
64        solutions = value;
65      }
66    }
67
68    [Storable]
69    private double[][] paretoFront;
70    public double[][] ParetoFront {
71      get {
72        return paretoFront;
73      }
74
75      set {
76        paretoFront = value;
77      }
78    }
79
80    [StorableConstructor]
81    protected ScatterPlotContent(bool deserializing) : base() { }
82
83    protected ScatterPlotContent(ScatterPlotContent original, Cloner cloner) : 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) {
91      this.qualities = qualities;
92      this.solutions = solutions;
93      this.paretoFront = paretoFront;
94      this.objectives = objectives;
95    }
96
97    public override IDeepCloneable Clone(Cloner cloner) {
98      return new ScatterPlotContent(this, cloner);
99    }
100  }
101}
Note: See TracBrowser for help on using the repository browser.