$darkmode
DENOPTIM
CandidateLW.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Vishwesh Venkatraman <vishwesh.venkatraman@ntnu.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.graph;
20
21
31public class CandidateLW
32{
36 private String uid;
37
41 private String name;
42
46 private String pathNameToFile;
47
51 private Double fitness;
52
56 private String error;
57
61 private Integer generationId;
62
66 private Integer level;
67
71 private String generatingSource;
72
73//------------------------------------------------------------------------------
74
75 public CandidateLW(String uid, String name, String pathNameToFile)
76 {
77 this.uid = uid;
78 this.name = name;
79 this.pathNameToFile = pathNameToFile;
80 }
81
82//------------------------------------------------------------------------------
83
84 public void setFitness(double fitness)
85 {
86 this.fitness = fitness;
87 }
88
89//------------------------------------------------------------------------------
90
91 public double getFitness()
92 {
93 return fitness;
94 }
95
96//------------------------------------------------------------------------------
97
98 public void setError(String error)
99 {
100 this.error = error;
101 }
102
103//------------------------------------------------------------------------------
104
105 public String getError()
106 {
107 return error;
108 }
109
110//------------------------------------------------------------------------------
111
112 public String getName()
113 {
114 return name;
115 }
116
117//------------------------------------------------------------------------------
118
119 public String getUid()
120 {
121 return uid;
122 }
123
124//------------------------------------------------------------------------------
125
126 public String getPathToFile()
127 {
128 return pathNameToFile;
129 }
130
131//------------------------------------------------------------------------------
132
133 public boolean hasFitness()
134 {
135 return fitness != null;
136 }
137
138//------------------------------------------------------------------------------
139
140 public void setGeneration(int genId)
141 {
142 generationId = genId;
143 }
144
145//------------------------------------------------------------------------------
146
147 public int getGeneration()
148 {
149 return generationId;
150 }
151
152//------------------------------------------------------------------------------
153
154 public void setGeneratingSource(String source)
155 {
156 generatingSource = source;
157 }
158
159//------------------------------------------------------------------------------
160
161 public String getGeneratingSource()
162 {
163 return generatingSource;
164 }
165
166//------------------------------------------------------------------------------
167
173 public void setLevel(int lev)
174 {
175 level = lev;
176 }
177
178//------------------------------------------------------------------------------
179
186 public int getLevel()
187 {
188 return level;
189 }
190
191//------------------------------------------------------------------------------
192
193 @Override
194 public boolean equals(Object o)
195 {
196 if (o== null)
197 return false;
198
199 if (o == this)
200 return true;
201
202 if (o.getClass() != getClass())
203 return false;
204
205 CandidateLW other = (CandidateLW) o;
206
207
208 if (!this.name.equals(other.name))
209 return false;
210
211 if (!this.uid.equals(other.uid))
212 return false;
213
214 return true;
215 }
216
217//------------------------------------------------------------------------------
218
219}
A light-weight candidate is a very low-demanding collection of data upon a specific candidate item.
String pathNameToFile
Pathname to file defining this item in detail.
int getLevel()
Returns the level that generated this graph in a fragment space exploration experiment.
CandidateLW(String uid, String name, String pathNameToFile)
void setFitness(double fitness)
void setError(String error)
String name
Name of this candidate (not guaranteed to be unique).
String error
Error that prevented calculation of the fitness or null.
void setLevel(int lev)
Sets level that generated this graph in a fragment space exploration experiment.
Integer generationId
ID of the generation this molecule belong to (or null)
Integer level
Level that generated this graph in fragment space exploration (or null)
Double fitness
fThe fitness value or null;
void setGeneratingSource(String source)
void setGeneration(int genId)
String uid
Unique identifier of this candidate.
boolean equals(Object o)
String generatingSource
A statement defining how this item was generated.