|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| package org.jgap.supergenes; |
|
11 |
| |
|
12 |
| import java.io.*; |
|
13 |
| import java.lang.reflect.*; |
|
14 |
| import java.net.*; |
|
15 |
| import java.util.*; |
|
16 |
| import org.jgap.*; |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| public abstract class AbstractSupergene |
|
31 |
| extends BaseGene |
|
32 |
| implements Supergene, SupergeneValidator { |
|
33 |
| |
|
34 |
| private final static String CVS_REVISION = "$Revision: 1.20 $"; |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| |
|
39 |
| |
|
40 |
| public final static String GENE_DELIMITER = "#"; |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| public final static String GENE_DELIMITER_HEADING = "<"; |
|
47 |
| |
|
48 |
| |
|
49 |
| |
|
50 |
| |
|
51 |
| |
|
52 |
| public final static String GENE_DELIMITER_CLOSING = ">"; |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| public final static int MAX_RETRIES = 1; |
|
60 |
| |
|
61 |
| |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| public final static int MAX_IMMUTABLE_GENES = 100000; |
|
66 |
| |
|
67 |
| |
|
68 |
| private Gene[] m_genes; |
|
69 |
| |
|
70 |
| |
|
71 |
| private static Set[] m_immutable = new Set[1]; |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
| |
|
76 |
| |
|
77 |
5
| public Gene[] getGenes() {
|
|
78 |
5
| return m_genes;
|
|
79 |
| } |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
| |
|
86 |
| |
|
87 |
| |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
6
| public final Gene geneAt(final int a_index) {
|
|
94 |
6
| return m_genes[a_index];
|
|
95 |
| }; |
|
96 |
| |
|
97 |
| |
|
98 |
| |
|
99 |
| |
|
100 |
| |
|
101 |
| |
|
102 |
| |
|
103 |
| |
|
104 |
| |
|
105 |
0
| public AbstractSupergene()
|
|
106 |
| throws InvalidConfigurationException { |
|
107 |
0
| this(Genotype.getStaticConfiguration(), new Gene[]{});
|
|
108 |
| } |
|
109 |
| |
|
110 |
| |
|
111 |
| |
|
112 |
| |
|
113 |
| |
|
114 |
| |
|
115 |
| |
|
116 |
| |
|
117 |
| |
|
118 |
0
| public AbstractSupergene(final Configuration a_config)
|
|
119 |
| throws InvalidConfigurationException { |
|
120 |
0
| this(a_config, new Gene[]{});
|
|
121 |
| } |
|
122 |
| |
|
123 |
| |
|
124 |
| |
|
125 |
| |
|
126 |
| |
|
127 |
| |
|
128 |
| |
|
129 |
| |
|
130 |
58
| public AbstractSupergene(final Configuration a_conf, final Gene[] a_genes)
|
|
131 |
| throws InvalidConfigurationException { |
|
132 |
58
| super(a_conf);
|
|
133 |
58
| if (a_genes == null) {
|
|
134 |
0
| throw new RuntimeException("null value for genes not allowed!");
|
|
135 |
| } |
|
136 |
58
| m_genes = a_genes;
|
|
137 |
| } |
|
138 |
| |
|
139 |
| |
|
140 |
| |
|
141 |
| |
|
142 |
| |
|
143 |
| |
|
144 |
| |
|
145 |
2
| public boolean isValid() {
|
|
146 |
2
| if (m_validator == null) {
|
|
147 |
1
| return true;
|
|
148 |
| } |
|
149 |
| else { |
|
150 |
1
| return m_validator.isValid(m_genes, this);
|
|
151 |
| } |
|
152 |
| } |
|
153 |
| |
|
154 |
| |
|
155 |
| |
|
156 |
| |
|
157 |
| |
|
158 |
| |
|
159 |
| |
|
160 |
| |
|
161 |
| |
|
162 |
| |
|
163 |
| |
|
164 |
| |
|
165 |
| |
|
166 |
| |
|
167 |
| |
|
168 |
| |
|
169 |
| |
|
170 |
| |
|
171 |
| |
|
172 |
| |
|
173 |
| |
|
174 |
1
| public boolean isValid(final Gene[] a_case, final Supergene a_forSupergene) {
|
|
175 |
1
| throw new Error("For " + getClass().getName() + ", override "
|
|
176 |
| + " isValid (Gene[], Supergene) or set an" |
|
177 |
| + " external validator."); |
|
178 |
| } |
|
179 |
| |
|
180 |
| |
|
181 |
| |
|
182 |
| |
|
183 |
| |
|
184 |
| |
|
185 |
| |
|
186 |
| |
|
187 |
| |
|
188 |
| |
|
189 |
| |
|
190 |
| |
|
191 |
| |
|
192 |
3
| protected Gene newGeneInternal() {
|
|
193 |
3
| Gene[] g = new Gene[m_genes.length];
|
|
194 |
3
| for (int i = 0; i < m_genes.length; i++) {
|
|
195 |
5
| g[i] = m_genes[i].newGene();
|
|
196 |
| } |
|
197 |
3
| try {
|
|
198 |
3
| Constructor constr = getClass().getConstructor(new Class[] {Configuration.class, Gene[].class});
|
|
199 |
3
| AbstractSupergene age =
|
|
200 |
| (AbstractSupergene) constr.newInstance(new Object[] {getConfiguration(), getGenes()}); |
|
201 |
3
| if (m_validator != this) {
|
|
202 |
1
| age.setValidator(m_validator);
|
|
203 |
| } |
|
204 |
3
| age.m_genes = g;
|
|
205 |
3
| return age;
|
|
206 |
| } |
|
207 |
| catch (Exception ex) { |
|
208 |
0
| ex.printStackTrace();
|
|
209 |
0
| throw new Error(
|
|
210 |
| "This should not happen. Is the constructor with parameters " |
|
211 |
| + "{org.jgap.Configuration, org,jgap,Gene[]} provided for " |
|
212 |
| + getClass().getName() + "?"); |
|
213 |
| } |
|
214 |
| } |
|
215 |
| |
|
216 |
| |
|
217 |
| |
|
218 |
| |
|
219 |
| |
|
220 |
| |
|
221 |
| |
|
222 |
| |
|
223 |
0
| public void applyMutation(final int a_index, final double a_percentage) {
|
|
224 |
| |
|
225 |
| |
|
226 |
| |
|
227 |
0
| if (a_index < m_immutable.length) {
|
|
228 |
0
| if (m_immutable[a_index] != null) {
|
|
229 |
0
| synchronized (m_immutable) {
|
|
230 |
0
| if (m_immutable[a_index].contains(this)) {
|
|
231 |
0
| return;
|
|
232 |
| } |
|
233 |
| } |
|
234 |
| } |
|
235 |
| } |
|
236 |
| |
|
237 |
| |
|
238 |
| |
|
239 |
| |
|
240 |
| |
|
241 |
| |
|
242 |
0
| Object backup = m_genes[a_index].getAllele();
|
|
243 |
0
| for (int i = 0; i < MAX_RETRIES; i++) {
|
|
244 |
0
| m_genes[a_index].applyMutation(0, a_percentage);
|
|
245 |
0
| if (isValid()) {
|
|
246 |
0
| return;
|
|
247 |
| } |
|
248 |
| } |
|
249 |
| |
|
250 |
0
| m_genes[a_index].setAllele(backup);
|
|
251 |
0
| markImmutable(a_index);
|
|
252 |
| } |
|
253 |
| |
|
254 |
| |
|
255 |
| |
|
256 |
| |
|
257 |
0
| private void markImmutable(final int a_index) {
|
|
258 |
0
| synchronized (m_immutable) {
|
|
259 |
0
| if (m_immutable.length <= a_index) {
|
|
260 |
| |
|
261 |
| |
|
262 |
0
| Set[] r = new Set[2 * m_immutable.length];
|
|
263 |
0
| System.arraycopy(m_immutable, 0, r, 0, m_immutable.length);
|
|
264 |
0
| m_immutable = r;
|
|
265 |
| } |
|
266 |
0
| if (m_immutable[a_index] == null) {
|
|
267 |
0
| m_immutable[a_index] = new TreeSet();
|
|
268 |
| } |
|
269 |
0
| if (m_immutable[a_index].size() < MAX_IMMUTABLE_GENES) {
|
|
270 |
0
| m_immutable[a_index].add(this);
|
|
271 |
| } |
|
272 |
| } |
|
273 |
| ; |
|
274 |
| } |
|
275 |
| |
|
276 |
| |
|
277 |
| |
|
278 |
| |
|
279 |
| |
|
280 |
| |
|
281 |
| |
|
282 |
| |
|
283 |
1
| public static void reset() {
|
|
284 |
1
| m_immutable = new Set[1];
|
|
285 |
| } |
|
286 |
| |
|
287 |
| |
|
288 |
| |
|
289 |
| |
|
290 |
| |
|
291 |
| |
|
292 |
| |
|
293 |
| |
|
294 |
0
| public void setToRandomValue(final RandomGenerator a_numberGenerator) {
|
|
295 |
| |
|
296 |
0
| for (int i = 0; i < m_genes.length; i++) {
|
|
297 |
0
| m_genes[i].setToRandomValue(a_numberGenerator);
|
|
298 |
| } |
|
299 |
0
| if (isValid()) {
|
|
300 |
0
| return;
|
|
301 |
| } |
|
302 |
0
| for (int i = 0; i < MAX_RETRIES; i++) {
|
|
303 |
0
| for (int j = 0; j < m_genes.length; j++) {
|
|
304 |
| |
|
305 |
| |
|
306 |
0
| m_genes[j].setToRandomValue(a_numberGenerator);
|
|
307 |
0
| if (isValid()) {
|
|
308 |
0
| return;
|
|
309 |
| } |
|
310 |
| } |
|
311 |
| } |
|
312 |
| } |
|
313 |
| |
|
314 |
| |
|
315 |
| |
|
316 |
| |
|
317 |
| |
|
318 |
| |
|
319 |
3
| public void setAllele(final Object a_superAllele) {
|
|
320 |
3
| if (m_genes.length < 1) {
|
|
321 |
| |
|
322 |
1
| return;
|
|
323 |
| } |
|
324 |
2
| Object[] a = (Object[]) a_superAllele;
|
|
325 |
2
| if (a.length != m_genes.length) {
|
|
326 |
1
| throw new IllegalArgumentException("Record length, " + a.length
|
|
327 |
| + " not equal to " |
|
328 |
| + m_genes.length); |
|
329 |
| } |
|
330 |
1
| for (int i = 0; i < m_genes.length; i++) {
|
|
331 |
5
| m_genes[i].setAllele(a[i]);
|
|
332 |
| } |
|
333 |
| } |
|
334 |
| |
|
335 |
| |
|
336 |
| |
|
337 |
| |
|
338 |
| |
|
339 |
0
| public Object getAllele() {
|
|
340 |
0
| Object[] o = new Object[m_genes.length];
|
|
341 |
0
| for (int i = 0; i < m_genes.length; i++) {
|
|
342 |
0
| o[i] = m_genes[i].getAllele();
|
|
343 |
| } |
|
344 |
0
| return o;
|
|
345 |
| } |
|
346 |
| |
|
347 |
| |
|
348 |
| |
|
349 |
| |
|
350 |
| |
|
351 |
| |
|
352 |
5
| public String getPersistentRepresentation() {
|
|
353 |
5
| StringBuffer b = new StringBuffer();
|
|
354 |
| |
|
355 |
5
| String validator = null;
|
|
356 |
5
| String v_representation = "";
|
|
357 |
5
| SupergeneValidator v = getValidator();
|
|
358 |
5
| if (v == null) {
|
|
359 |
1
| validator = "null";
|
|
360 |
| } |
|
361 |
| else |
|
362 |
4
| if (v == this) {
|
|
363 |
3
| validator = "this";
|
|
364 |
| } |
|
365 |
| else { |
|
366 |
1
| validator = v.getClass().getName();
|
|
367 |
1
| v_representation = v.getPersistent();
|
|
368 |
| } |
|
369 |
5
| b.append(GENE_DELIMITER_HEADING);
|
|
370 |
5
| b.append(encode(validator + GENE_DELIMITER + v_representation));
|
|
371 |
5
| b.append(GENE_DELIMITER_CLOSING);
|
|
372 |
| |
|
373 |
5
| Gene gene;
|
|
374 |
5
| for (int i = 0; i < m_genes.length; i++) {
|
|
375 |
11
| gene = m_genes[i];
|
|
376 |
11
| b.append(GENE_DELIMITER_HEADING);
|
|
377 |
11
| b.append(encode(gene.getClass().getName() + GENE_DELIMITER
|
|
378 |
| + gene.getPersistentRepresentation())); |
|
379 |
11
| b.append(GENE_DELIMITER_CLOSING);
|
|
380 |
| } |
|
381 |
5
| return b.toString();
|
|
382 |
| } |
|
383 |
| |
|
384 |
| |
|
385 |
| |
|
386 |
| |
|
387 |
| |
|
388 |
| |
|
389 |
| |
|
390 |
| |
|
391 |
| |
|
392 |
| |
|
393 |
| |
|
394 |
| |
|
395 |
| |
|
396 |
| |
|
397 |
| |
|
398 |
| |
|
399 |
| |
|
400 |
6
| public void setValueFromPersistentRepresentation(String a_representation)
|
|
401 |
| throws UnsupportedRepresentationException { |
|
402 |
6
| if (a_representation != null) {
|
|
403 |
5
| try {
|
|
404 |
| |
|
405 |
| |
|
406 |
5
| List r = split(a_representation);
|
|
407 |
5
| Iterator iter = r.iterator();
|
|
408 |
5
| m_genes = new Gene[r.size() - 1];
|
|
409 |
| |
|
410 |
| |
|
411 |
5
| StringTokenizer st;
|
|
412 |
5
| String clas;
|
|
413 |
5
| String representation;
|
|
414 |
5
| String g;
|
|
415 |
5
| Gene gene;
|
|
416 |
5
| String validator = (String) iter.next();
|
|
417 |
5
| setValidator(createValidator(decode(validator)));
|
|
418 |
5
| for (int i = 0; i < m_genes.length; i++) {
|
|
419 |
11
| g = decode( (String) iter.next());
|
|
420 |
11
| st = new StringTokenizer(g, GENE_DELIMITER);
|
|
421 |
11
| if (st.countTokens() != 2)
|
|
422 |
0
| throw new UnsupportedRepresentationException("In " + g + ", " +
|
|
423 |
| "expecting two tokens, separated by " + GENE_DELIMITER); |
|
424 |
11
| clas = st.nextToken();
|
|
425 |
11
| representation = st.nextToken();
|
|
426 |
11
| gene = createGene(clas, representation);
|
|
427 |
11
| m_genes[i] = gene;
|
|
428 |
| } |
|
429 |
| } |
|
430 |
| catch (Exception ex) { |
|
431 |
0
| ex.printStackTrace();
|
|
432 |
0
| throw new UnsupportedRepresentationException(ex.getCause().
|
|
433 |
| getMessage()); |
|
434 |
| } |
|
435 |
| } |
|
436 |
| else { |
|
437 |
1
| throw new UnsupportedRepresentationException("null value not allowed");
|
|
438 |
| } |
|
439 |
| } |
|
440 |
| |
|
441 |
| |
|
442 |
5
| protected SupergeneValidator createValidator(String a_rep) {
|
|
443 |
5
| try {
|
|
444 |
5
| StringTokenizer vo = new StringTokenizer
|
|
445 |
| (a_rep, GENE_DELIMITER, true); |
|
446 |
0
| if (vo.countTokens() != 2)throw new Error
|
|
447 |
| ("In " + a_rep + ", expecting two tokens, separated by " + |
|
448 |
| GENE_DELIMITER); |
|
449 |
5
| String clas = vo.nextToken();
|
|
450 |
5
| SupergeneValidator sv;
|
|
451 |
5
| if (clas.equals("this")) {
|
|
452 |
3
| sv = this;
|
|
453 |
| } |
|
454 |
2
| else if (clas.equals("null")) {
|
|
455 |
1
| sv = null;
|
|
456 |
| } |
|
457 |
| else { |
|
458 |
| |
|
459 |
1
| Class svClass = Class.forName(clas);
|
|
460 |
1
| Constructor constr = svClass.getConstructor(new Class[] {Configuration.class});
|
|
461 |
1
| sv = (SupergeneValidator) constr.newInstance(new Object[] {
|
|
462 |
| getConfiguration()}); |
|
463 |
| } |
|
464 |
5
| if (sv != null) {
|
|
465 |
4
| sv.setFromPersistent(decode(vo.nextToken()));
|
|
466 |
| } |
|
467 |
5
| return sv;
|
|
468 |
| } |
|
469 |
| catch (Exception ex) { |
|
470 |
0
| throw new Error
|
|
471 |
| ("Unable to create validator from '" + a_rep + "' for " + |
|
472 |
| getClass().getName(), ex); |
|
473 |
| } |
|
474 |
| } |
|
475 |
| |
|
476 |
| |
|
477 |
11
| protected Gene createGene(String a_geneClassName,
|
|
478 |
| String a_persistentRepresentation) |
|
479 |
| throws Exception { |
|
480 |
11
| Class geneClass = Class.forName(a_geneClassName);
|
|
481 |
11
| Constructor constr = geneClass.getConstructor(new Class[] {Configuration.class});
|
|
482 |
11
| Gene gene = (Gene) constr.newInstance(new Object[] {getConfiguration()});
|
|
483 |
11
| gene.setValueFromPersistentRepresentation(a_persistentRepresentation);
|
|
484 |
11
| return gene;
|
|
485 |
| } |
|
486 |
| |
|
487 |
| |
|
488 |
0
| public void cleanup() {
|
|
489 |
0
| for (int i = 0; i < m_genes.length; i++) {
|
|
490 |
0
| m_genes[i].cleanup();
|
|
491 |
| } |
|
492 |
| } |
|
493 |
| |
|
494 |
| |
|
495 |
| |
|
496 |
| |
|
497 |
| |
|
498 |
3
| public String toString() {
|
|
499 |
3
| StringBuffer b = new StringBuffer();
|
|
500 |
3
| b.append("Supergene " + getClass().getName() + " {");
|
|
501 |
3
| for (int i = 0; i < m_genes.length; i++) {
|
|
502 |
1
| b.append("|");
|
|
503 |
1
| b.append(m_genes[i].toString());
|
|
504 |
1
| b.append("|");
|
|
505 |
| } |
|
506 |
3
| if (m_validator == null) {
|
|
507 |
1
| b.append(" non validating");
|
|
508 |
| } |
|
509 |
| else { |
|
510 |
2
| b.append(" validator: "+m_validator.getClass().getName());
|
|
511 |
| } |
|
512 |
3
| b.append("}");
|
|
513 |
3
| return b.toString();
|
|
514 |
| } |
|
515 |
| |
|
516 |
| |
|
517 |
3
| public int size() {
|
|
518 |
3
| return m_genes.length;
|
|
519 |
| } |
|
520 |
| |
|
521 |
| |
|
522 |
| |
|
523 |
10
| public int compareTo(Object o) {
|
|
524 |
10
| AbstractSupergene q = (AbstractSupergene) o;
|
|
525 |
9
| int c = m_genes.length - q.m_genes.length;
|
|
526 |
9
| if (c != 0) {
|
|
527 |
4
| return c;
|
|
528 |
| } |
|
529 |
5
| for (int i = 0; i < m_genes.length; i++) {
|
|
530 |
0
| c = m_genes[i].compareTo(q.m_genes[i]);
|
|
531 |
0
| if (c != 0) {
|
|
532 |
0
| return c;
|
|
533 |
| } |
|
534 |
| } |
|
535 |
5
| if (getClass().equals(o.getClass())) {
|
|
536 |
3
| return 0;
|
|
537 |
| } |
|
538 |
2
| return getClass().getName().compareTo(o.getClass().getName());
|
|
539 |
| } |
|
540 |
| |
|
541 |
| |
|
542 |
| |
|
543 |
| |
|
544 |
| |
|
545 |
| |
|
546 |
| |
|
547 |
14
| public boolean equals(Object a_gene) {
|
|
548 |
14
| if (a_gene == null || ! (a_gene.getClass().equals(getClass()))) {
|
|
549 |
2
| return false;
|
|
550 |
| } |
|
551 |
12
| AbstractSupergene age = (AbstractSupergene) a_gene;
|
|
552 |
12
| if (m_validator != age.m_validator)
|
|
553 |
9
| if (m_validator != null && age.m_immutable != null)
|
|
554 |
9
| if (!m_validator.getClass().equals(age.m_validator.getClass()))
|
|
555 |
0
| return false;
|
|
556 |
12
| return Arrays.equals(m_genes, age.m_genes);
|
|
557 |
| } |
|
558 |
| |
|
559 |
| |
|
560 |
0
| public int hashCode() {
|
|
561 |
0
| int s = 0;
|
|
562 |
0
| for (int i = m_genes.length - 1; i >= 0; i--) {
|
|
563 |
0
| s += m_genes[i].hashCode();
|
|
564 |
| } |
|
565 |
0
| return s;
|
|
566 |
| } |
|
567 |
| |
|
568 |
| |
|
569 |
20
| protected static final String encode(String a_x) {
|
|
570 |
20
| try {
|
|
571 |
20
| return URLEncoder.encode(a_x, "UTF-8");
|
|
572 |
| } |
|
573 |
| catch (UnsupportedEncodingException ex) { |
|
574 |
0
| throw new Error("This should never happen!");
|
|
575 |
| } |
|
576 |
| } |
|
577 |
| |
|
578 |
| |
|
579 |
38
| protected static final String decode(String a_x) {
|
|
580 |
38
| try {
|
|
581 |
38
| return URLDecoder.decode(a_x, "UTF-8");
|
|
582 |
| } |
|
583 |
| catch (UnsupportedEncodingException ex) { |
|
584 |
0
| throw new Error("This should never happen!");
|
|
585 |
| } |
|
586 |
| } |
|
587 |
| |
|
588 |
| |
|
589 |
| |
|
590 |
| |
|
591 |
| |
|
592 |
| |
|
593 |
| |
|
594 |
| |
|
595 |
| |
|
596 |
10
| protected static final List split(String a_string)
|
|
597 |
| throws UnsupportedRepresentationException { |
|
598 |
10
| List a = Collections.synchronizedList(new ArrayList());
|
|
599 |
10
| StringTokenizer st = new StringTokenizer
|
|
600 |
| (a_string, GENE_DELIMITER_HEADING + GENE_DELIMITER_CLOSING, true); |
|
601 |
10
| while (st.hasMoreTokens()) {
|
|
602 |
34
| if (!st.nextToken().equals(GENE_DELIMITER_HEADING)) {
|
|
603 |
0
| throw new UnsupportedRepresentationException
|
|
604 |
| (a_string + " no open tag"); |
|
605 |
| } |
|
606 |
34
| String n = st.nextToken();
|
|
607 |
2
| if (n.equals(GENE_DELIMITER_CLOSING)) a.add("");
|
|
608 |
| else { |
|
609 |
32
| a.add(n);
|
|
610 |
32
| if (!st.nextToken().equals(GENE_DELIMITER_CLOSING)) {
|
|
611 |
0
| throw new UnsupportedRepresentationException
|
|
612 |
| (a_string + " no close tag"); |
|
613 |
| } |
|
614 |
| } |
|
615 |
| } |
|
616 |
10
| return a;
|
|
617 |
| } |
|
618 |
| |
|
619 |
| |
|
620 |
28
| public void addGene(Gene a_gene) {
|
|
621 |
28
| Gene[] genes = new Gene[m_genes.length + 1];
|
|
622 |
28
| System.arraycopy(m_genes, 0, genes, 0, m_genes.length);
|
|
623 |
28
| genes[m_genes.length] = a_gene;
|
|
624 |
28
| m_genes = genes;
|
|
625 |
| } |
|
626 |
| |
|
627 |
| |
|
628 |
| |
|
629 |
| |
|
630 |
| |
|
631 |
| |
|
632 |
| |
|
633 |
8
| public void setValidator(SupergeneValidator a_validator) {
|
|
634 |
8
| m_validator = a_validator;
|
|
635 |
| } |
|
636 |
| |
|
637 |
| |
|
638 |
| |
|
639 |
| |
|
640 |
| |
|
641 |
| |
|
642 |
5
| public SupergeneValidator getValidator() {
|
|
643 |
5
| return m_validator;
|
|
644 |
| } |
|
645 |
| |
|
646 |
| |
|
647 |
| protected SupergeneValidator m_validator = this; |
|
648 |
| |
|
649 |
| |
|
650 |
| |
|
651 |
0
| public String getPersistent() {
|
|
652 |
0
| return "";
|
|
653 |
| } |
|
654 |
| |
|
655 |
| |
|
656 |
| |
|
657 |
3
| public void setFromPersistent(String a_from) {
|
|
658 |
| } |
|
659 |
| |
|
660 |
| |
|
661 |
| |
|
662 |
| |
|
663 |
0
| public Object getInternalValue() {
|
|
664 |
0
| if (true) {
|
|
665 |
0
| throw new RuntimeException("getInternalValue() called unexpectedly!");
|
|
666 |
| } |
|
667 |
0
| return null;
|
|
668 |
| } |
|
669 |
| } |