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 | {
|
---|
28 | [StorableClass]
|
---|
29 | class MOSolution : IMOFrontModel
|
---|
30 | {
|
---|
31 | public bool CanChangeDescription
|
---|
32 | {
|
---|
33 | get
|
---|
34 | {
|
---|
35 | return false;
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | public bool CanChangeName
|
---|
40 | {
|
---|
41 | get
|
---|
42 | {
|
---|
43 | return false;
|
---|
44 | }
|
---|
45 | }
|
---|
46 |
|
---|
47 | public string Description
|
---|
48 | {
|
---|
49 | get
|
---|
50 | {
|
---|
51 | return "MYResult";
|
---|
52 | }
|
---|
53 |
|
---|
54 | set { }
|
---|
55 | }
|
---|
56 |
|
---|
57 | public string Filename
|
---|
58 | {
|
---|
59 | get { return "MyFilename"; }
|
---|
60 |
|
---|
61 | set { }
|
---|
62 | }
|
---|
63 |
|
---|
64 | public string ItemDescription
|
---|
65 | {
|
---|
66 | get { return "this is MOSolutionImplementation"; }
|
---|
67 | }
|
---|
68 |
|
---|
69 | public Image ItemImage
|
---|
70 | {
|
---|
71 | get
|
---|
72 | {
|
---|
73 | return HeuristicLab.Common.Resources.VSImageLibrary.Function;
|
---|
74 | }
|
---|
75 | }
|
---|
76 |
|
---|
77 | public string ItemName
|
---|
78 | {
|
---|
79 | get
|
---|
80 | {
|
---|
81 | return "MOSolution";
|
---|
82 | }
|
---|
83 | }
|
---|
84 |
|
---|
85 | public Version ItemVersion
|
---|
86 | {
|
---|
87 | get { return Version.Parse("0.1"); }
|
---|
88 | }
|
---|
89 |
|
---|
90 | public string Name
|
---|
91 | {
|
---|
92 | get
|
---|
93 | {
|
---|
94 | return ItemName;
|
---|
95 | }
|
---|
96 |
|
---|
97 | set { }
|
---|
98 | }
|
---|
99 |
|
---|
100 | private double[][] qualities;
|
---|
101 |
|
---|
102 | public double[][] Qualities
|
---|
103 | {
|
---|
104 | get
|
---|
105 | {
|
---|
106 | return qualities;
|
---|
107 | }
|
---|
108 |
|
---|
109 | set
|
---|
110 | {
|
---|
111 | qualities = value;
|
---|
112 | }
|
---|
113 | }
|
---|
114 |
|
---|
115 | private int objectives;
|
---|
116 | public int Objectives
|
---|
117 | {
|
---|
118 | get
|
---|
119 | {
|
---|
120 | return objectives;
|
---|
121 | }
|
---|
122 |
|
---|
123 | set
|
---|
124 | {
|
---|
125 | objectives = value;
|
---|
126 | }
|
---|
127 | }
|
---|
128 |
|
---|
129 | private double[][] solutions;
|
---|
130 | public double[][] Solutions
|
---|
131 | {
|
---|
132 | get
|
---|
133 | {
|
---|
134 | return solutions;
|
---|
135 | }
|
---|
136 |
|
---|
137 | set
|
---|
138 | {
|
---|
139 | solutions = value;
|
---|
140 | }
|
---|
141 | }
|
---|
142 |
|
---|
143 | private double[][] paretoFront;
|
---|
144 | public double[][] ParetoFront
|
---|
145 | {
|
---|
146 | get
|
---|
147 | {
|
---|
148 | return paretoFront;
|
---|
149 | }
|
---|
150 |
|
---|
151 | set
|
---|
152 | {
|
---|
153 | paretoFront = value;
|
---|
154 | }
|
---|
155 | }
|
---|
156 |
|
---|
157 | public event EventHandler DescriptionChanged;
|
---|
158 | public event EventHandler ItemImageChanged;
|
---|
159 | public event EventHandler NameChanged;
|
---|
160 | public event EventHandler<CancelEventArgs<string>> NameChanging;
|
---|
161 | public event EventHandler ToStringChanged;
|
---|
162 |
|
---|
163 | [StorableConstructor]
|
---|
164 | protected MOSolution(bool deserializing) : base() { }
|
---|
165 |
|
---|
166 |
|
---|
167 | protected MOSolution(MOSolution original, Cloner cloner) : this(original)
|
---|
168 | {
|
---|
169 | this.qualities = original.qualities;
|
---|
170 | this.solutions = original.solutions;
|
---|
171 | this.paretoFront = original.paretoFront;
|
---|
172 | this.objectives = original.objectives;
|
---|
173 | }
|
---|
174 | protected MOSolution(MOSolution original) : base()
|
---|
175 | {
|
---|
176 | this.qualities = original.qualities;
|
---|
177 | this.solutions = original.solutions;
|
---|
178 | this.paretoFront = original.paretoFront;
|
---|
179 | this.objectives = original.objectives;
|
---|
180 | }
|
---|
181 | protected MOSolution() : base() { }
|
---|
182 | public MOSolution(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives)
|
---|
183 | {
|
---|
184 | this.qualities = qualities;
|
---|
185 | this.solutions = solutions;
|
---|
186 | this.paretoFront = paretoFront;
|
---|
187 | this.objectives = objectives;
|
---|
188 | }
|
---|
189 |
|
---|
190 | public object Clone()
|
---|
191 | {
|
---|
192 | return new MOSolution(this);
|
---|
193 | }
|
---|
194 |
|
---|
195 | public IDeepCloneable Clone(Cloner cloner)
|
---|
196 | {
|
---|
197 | return (IDeepCloneable)Clone();
|
---|
198 | }
|
---|
199 | }
|
---|
200 | }
|
---|