1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Drawing;
|
---|
4 | using HeuristicLab.Common;
|
---|
5 | using HeuristicLab.Optimization;
|
---|
6 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Problems.MultiObjectiveTestFunctions.Drawings {
|
---|
9 | [StorableClass]
|
---|
10 | class IMOSolution : IMOQualities {
|
---|
11 | public bool CanChangeDescription {
|
---|
12 | get {
|
---|
13 | return false;
|
---|
14 | }
|
---|
15 | }
|
---|
16 |
|
---|
17 | public bool CanChangeName {
|
---|
18 | get {
|
---|
19 | return false;
|
---|
20 | }
|
---|
21 | }
|
---|
22 |
|
---|
23 | public string Description {
|
---|
24 | get {
|
---|
25 | return "MYResult";
|
---|
26 | }
|
---|
27 |
|
---|
28 | set {}
|
---|
29 | }
|
---|
30 |
|
---|
31 | public string Filename {
|
---|
32 | get { return "MyFilename"; }
|
---|
33 |
|
---|
34 | set {}
|
---|
35 | }
|
---|
36 |
|
---|
37 | public string ItemDescription {
|
---|
38 | get { return "this is IMOSolutionImplementation"; }
|
---|
39 | }
|
---|
40 |
|
---|
41 | public Image ItemImage {
|
---|
42 | get {
|
---|
43 | return HeuristicLab.Common.Resources.VSImageLibrary.Function;
|
---|
44 | }
|
---|
45 | }
|
---|
46 |
|
---|
47 | public string ItemName {
|
---|
48 | get {
|
---|
49 | return "MyName";
|
---|
50 | }
|
---|
51 | }
|
---|
52 |
|
---|
53 | public Version ItemVersion {
|
---|
54 | get { return Version.Parse("0.1"); }
|
---|
55 | }
|
---|
56 |
|
---|
57 | public string Name {
|
---|
58 | get {
|
---|
59 | return ItemName;
|
---|
60 | }
|
---|
61 |
|
---|
62 | set {}
|
---|
63 | }
|
---|
64 |
|
---|
65 | private IEnumerable<double[]> qualities;
|
---|
66 |
|
---|
67 | public IEnumerable<double[]> Qualities {
|
---|
68 | get {
|
---|
69 | return qualities;
|
---|
70 | }
|
---|
71 |
|
---|
72 | set {
|
---|
73 | qualities= value;
|
---|
74 | }
|
---|
75 | }
|
---|
76 |
|
---|
77 | private int objectives;
|
---|
78 | public int Objectives {
|
---|
79 | get {
|
---|
80 | return objectives;
|
---|
81 | }
|
---|
82 |
|
---|
83 | set {
|
---|
84 | objectives = value;
|
---|
85 | }
|
---|
86 | }
|
---|
87 |
|
---|
88 | private Individual[] solutions;
|
---|
89 | public Individual[] Solutions {
|
---|
90 | get {
|
---|
91 | return solutions;
|
---|
92 | }
|
---|
93 |
|
---|
94 | set {
|
---|
95 | solutions = value;
|
---|
96 | }
|
---|
97 | }
|
---|
98 |
|
---|
99 | private IEnumerable<double[]> paretoFront;
|
---|
100 | public IEnumerable<double[]> ParetoFront {
|
---|
101 | get {
|
---|
102 | return paretoFront;
|
---|
103 | }
|
---|
104 |
|
---|
105 | set {
|
---|
106 | paretoFront = value;
|
---|
107 | }
|
---|
108 | }
|
---|
109 |
|
---|
110 | public event EventHandler DescriptionChanged;
|
---|
111 | public event EventHandler ItemImageChanged;
|
---|
112 | public event EventHandler NameChanged;
|
---|
113 | public event EventHandler<CancelEventArgs<string>> NameChanging;
|
---|
114 | public event EventHandler ToStringChanged;
|
---|
115 |
|
---|
116 | [StorableConstructor]
|
---|
117 | protected IMOSolution(bool deserializing) : base(){ }
|
---|
118 | protected IMOSolution(IMOSolution original) : base(){
|
---|
119 | this.qualities = original.qualities;
|
---|
120 | this.solutions = original.solutions;
|
---|
121 | this.paretoFront = original.paretoFront;
|
---|
122 | this.objectives = original.objectives;
|
---|
123 | }
|
---|
124 | protected IMOSolution() : base() { }
|
---|
125 | public IMOSolution(IEnumerable<double[]> qualities, Individual[] solutions, IEnumerable<double[]> paretoFront, int objectives) {
|
---|
126 | this.qualities = qualities;
|
---|
127 | this.solutions = solutions;
|
---|
128 | this.paretoFront = paretoFront;
|
---|
129 | this.objectives = objectives;
|
---|
130 | }
|
---|
131 |
|
---|
132 | public object Clone() {
|
---|
133 | return new IMOSolution(this);
|
---|
134 | }
|
---|
135 |
|
---|
136 | public IDeepCloneable Clone(Cloner cloner) {
|
---|
137 | return (IDeepCloneable)Clone();
|
---|
138 | }
|
---|
139 | }
|
---|
140 | }
|
---|