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 | using System;
|
---|
22 | using System.Drawing;
|
---|
23 | using HeuristicLab.Common;
|
---|
24 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
25 |
|
---|
26 | namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
|
---|
27 | [StorableClass]
|
---|
28 | public class MOSolution : IMOFrontModel {
|
---|
29 | public bool CanChangeDescription {
|
---|
30 | get {
|
---|
31 | return false;
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
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 |
|
---|
83 | private double[][] qualities;
|
---|
84 |
|
---|
85 | public double[][] Qualities {
|
---|
86 | get {
|
---|
87 | return qualities;
|
---|
88 | }
|
---|
89 |
|
---|
90 | set {
|
---|
91 | qualities = value;
|
---|
92 | }
|
---|
93 | }
|
---|
94 |
|
---|
95 | private int objectives;
|
---|
96 | public int Objectives {
|
---|
97 | get {
|
---|
98 | return objectives;
|
---|
99 | }
|
---|
100 |
|
---|
101 | set {
|
---|
102 | objectives = value;
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | private double[][] solutions;
|
---|
107 | public double[][] Solutions {
|
---|
108 | get {
|
---|
109 | return solutions;
|
---|
110 | }
|
---|
111 |
|
---|
112 | set {
|
---|
113 | solutions = value;
|
---|
114 | }
|
---|
115 | }
|
---|
116 |
|
---|
117 | private double[][] paretoFront;
|
---|
118 | public double[][] ParetoFront {
|
---|
119 | get {
|
---|
120 | return paretoFront;
|
---|
121 | }
|
---|
122 |
|
---|
123 | set {
|
---|
124 | paretoFront = value;
|
---|
125 | }
|
---|
126 | }
|
---|
127 |
|
---|
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;
|
---|
133 |
|
---|
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;
|
---|
142 | this.objectives = original.objectives;
|
---|
143 | }
|
---|
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) {
|
---|
152 | this.qualities = qualities;
|
---|
153 | this.solutions = solutions;
|
---|
154 | this.paretoFront = paretoFront;
|
---|
155 | this.objectives = objectives;
|
---|
156 | }
|
---|
157 |
|
---|
158 | public object Clone() {
|
---|
159 | return new MOSolution(this);
|
---|
160 | }
|
---|
161 |
|
---|
162 | public IDeepCloneable Clone(Cloner cloner) {
|
---|
163 | return (IDeepCloneable)Clone();
|
---|
164 | }
|
---|
165 | }
|
---|
166 | }
|
---|