01: /*
02: * This file is part of JGAP.
03: *
04: * JGAP offers a dual license model containing the LGPL as well as the MPL.
05: *
06: * For licensing information please see the file license.txt included with JGAP
07: * or have a look at the top of class org.jgap.Chromosome which representatively
08: * includes the JGAP license policy applicable for any file delivered with JGAP.
09: */
10: package org.jgap;
11:
12: import java.io.*;
13:
14: /**
15: * Natural selectors are responsible for actually selecting a specified number
16: * of Chromosome specimens from a population, using the fitness values as a
17: * guide. Usually fitness is treated as a statistic probability of survival,
18: * not as the sole determining factor. Therefore, Chromosomes with higher
19: * fitness values are more likely to survive than those with lesser fitness
20: * values, but it's not guaranteed.
21: *
22: * @author Neil Rotstan
23: * @author Klaus Meffert
24: * @since 2.0
25: */
26: public interface INaturalSelector extends Serializable {
27: /** String containing the CVS revision. Read out via reflection!*/
28: final static String CVS_REVISION = "$Revision: 1.13 $";
29:
30: /**
31: * Select a given number of Chromosomes from the pool that will move on
32: * to the next generation population. This selection should be guided by
33: * the fitness values, but fitness should be treated as a statistical
34: * probability of survival, not as the sole determining factor. In other
35: * words, Chromosomes with higher fitness values should be more likely to
36: * be selected than those with lower fitness values, but it should not be
37: * guaranteed.
38: *
39: * @param a_howManyToSelect the number of Chromosomes to select
40: * @param a_from_population the population the Chromosomes will be
41: * selected from
42: * @param a_to_population the population the Chromosomes will be added to
43: *
44: * @author Neil Rotstan
45: * @author Klaus Meffert
46: * @since 2.0 (since 1.0 with different return type)
47: */
48: void select(int a_howManyToSelect, Population a_from_population,
49: Population a_to_population);
50:
51: /**
52: * Empty out the working pool of Chromosomes. This will be invoked after
53: * each evolution cycle so that the natural selector can be reused for
54: * the next one.
55: *
56: * @author Neil Rotstan
57: * @since 1.0
58: */
59: void empty();
60:
61: /**
62: * @return true: The implementation of the NaturalSelector only returns
63: * unique Chromosome's (example: BestChromosomesSelector). false: Also
64: * doublettes could be returned (example: WeightedRouletteSelector).
65: *
66: * @author Klaus Meffert
67: * @since 2.0
68: */
69: boolean returnsUniqueChromosomes();
70: }
|