Changeset 14092 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Views/ScatterPlotContent.cs
- Timestamp:
- 07/18/16 13:50:08 (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Views/ScatterPlotContent.cs
r14091 r14092 21 21 using System; 22 22 using System.Drawing; 23 using System.Linq; 23 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 24 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 26 28 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 27 29 [StorableClass] 28 public class MOSolution : IMOFrontModel { 29 public bool CanChangeDescription { 30 get { 31 return false; 32 } 33 } 30 public class ScatterPlotContent : Item { 34 31 35 public bool CanChangeName { 36 get { 37 return false; 38 } 39 } 40 41 public string Description { 42 get { 43 return "MYResult"; 44 } 45 46 set { } 47 } 48 49 public string Filename { 50 get { return "MyFilename"; } 51 52 set { } 53 } 54 55 public string ItemDescription { 56 get { return "this is MOSolutionImplementation"; } 57 } 58 59 public Image ItemImage { 60 get { 61 return HeuristicLab.Common.Resources.VSImageLibrary.Function; 62 } 63 } 64 65 public string ItemName { 66 get { 67 return "MOSolution"; 68 } 69 } 70 71 public Version ItemVersion { 72 get { return Version.Parse("0.1"); } 73 } 74 75 public string Name { 76 get { 77 return ItemName; 78 } 79 80 set { } 81 } 82 32 [Storable] 83 33 private double[][] qualities; 84 85 34 public double[][] Qualities { 86 35 get { … … 93 42 } 94 43 44 [Storable] 95 45 private int objectives; 96 46 public int Objectives { … … 104 54 } 105 55 56 [Storable] 106 57 private double[][] solutions; 107 58 public double[][] Solutions { … … 115 66 } 116 67 68 [Storable] 117 69 private double[][] paretoFront; 118 70 public double[][] ParetoFront { … … 126 78 } 127 79 128 public event EventHandler DescriptionChanged; 129 public event EventHandler ItemImageChanged; 130 public event EventHandler NameChanged; 131 public event EventHandler<CancelEventArgs<string>> NameChanging; 132 public event EventHandler ToStringChanged; 80 [StorableConstructor] 81 protected ScatterPlotContent(bool deserializing) : base() { } 133 82 134 [StorableConstructor] 135 protected MOSolution(bool deserializing) : base() { } 136 137 138 protected MOSolution(MOSolution original, Cloner cloner) : this(original) { 139 this.qualities = original.qualities; 140 this.solutions = original.solutions; 141 this.paretoFront = original.paretoFront; 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(); 142 87 this.objectives = original.objectives; 143 88 } 144 protected MOSolution(MOSolution original) : base() { 145 this.qualities = original.qualities; 146 this.solutions = original.solutions; 147 this.paretoFront = original.paretoFront; 148 this.objectives = original.objectives; 149 } 150 protected MOSolution() : base() { } 151 public MOSolution(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) { 89 protected ScatterPlotContent() : base() { } 90 public ScatterPlotContent(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) { 152 91 this.qualities = qualities; 153 92 this.solutions = solutions; … … 156 95 } 157 96 158 public object Clone() { 159 return new MOSolution(this); 160 } 161 162 public IDeepCloneable Clone(Cloner cloner) { 163 return (IDeepCloneable)Clone(); 97 public override IDeepCloneable Clone(Cloner cloner) { 98 return cloner.Clone(this); 164 99 } 165 100 }
Note: See TracChangeset
for help on using the changeset viewer.