KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > INaturalSelector


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

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 (previously named "NaturalSelector")
25  */

26 public interface INaturalSelector
27     extends Serializable {
28   /** String containing the CVS revision. Read out via reflection!*/
29   final static String JavaDoc CVS_REVISION = "$Revision: 1.11 $";
30
31   /**
32    * Select a given number of Chromosomes from the pool that will move on
33    * to the next generation population. This selection should be guided by
34    * the fitness values, but fitness should be treated as a statistical
35    * probability of survival, not as the sole determining factor. In other
36    * words, Chromosomes with higher fitness values should be more likely to
37    * be selected than those with lower fitness values, but it should not be
38    * guaranteed.
39    *
40    * @param a_howManyToSelect the number of Chromosomes to select
41    * @param a_from_population the population the Chromosomes will be
42    * selected from
43    * @param a_to_population the population the Chromosomes will be added to
44    *
45    * @author Neil Rotstan
46    * @author Klaus Meffert
47    * @since 2.0 (since 1.0 with different return type)
48    */

49   void select(int a_howManyToSelect, Population a_from_population,
50               Population a_to_population);
51
52   /**
53    * Empty out the working pool of Chromosomes. This will be invoked after
54    * each evolution cycle so that the natural selector can be reused for
55    * the next one.
56    *
57    * @author Neil Rotstan
58    * @since 1.0
59    */

60   void empty();
61
62   /**
63    * @return true: The implementation of the NaturalSelector only returns
64    * unique Chromosome's (example: BestChromosomesSelector). false: Also
65    * doublettes could be returned (example: WeightedRouletteSelector).
66    *
67    * @author Klaus Meffert
68    * @since 2.0
69    */

70   boolean returnsUniqueChromosomes();
71 }
72
Popular Tags