KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > supergenes > Supergene


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.supergenes;
11
12 import org.jgap.*;
13
14 /**
15  * <p>Supergene represents several genes, which usually control closely
16  * related aspects of the phenotype. The Supergene mutates
17  * only in such way, that the allele combination remains valid.
18  * Mutations, that make allele combination invalid, are rejected
19  * inside {@link org.jgap.Gene#applyMutation } method. Supergene components can
20  * also be a Supergene, creating the tree-like structures in this way.
21  *</p><p>
22  * In biology, the invalid combinations
23  * represent completely broken metabolic chains, unbalanced
24  * signaling pathways (activator without supressor) and so on.
25  *</p><p>
26  * At <i>least about 5 % of the randomly generated Supergene suparallele values
27  * should be valid.</i> If the valid combinations represents too small part of
28  * all possible combinations, it can take too long to find the suitable mutation
29  * that does not brake a supergene. If you face this problem, try to split the
30  * supergene into several sub-supergenes.</p>
31  *
32  * @author Audrius Meskauskas
33  */

34 public interface Supergene
35     extends Gene, ICompositeGene {
36   /** String containing the CVS revision. Read out via reflection!*/
37   final static String JavaDoc CVS_REVISION = "$Revision: 1.12 $";
38
39   /**
40    * Test the allele combination of this supergene for validity.
41    * If a validator was previously set be calling setValidator(),
42    * the decission is delegated to this validator. The derived
43    * classes may have internal default validator for the case
44    * when no external validator is set. See note in the interface header.
45    *
46    * @return true only if the supergene allele combination is valid
47    */

48   boolean isValid();
49
50   /**
51    * Get the array of genes - components of this supergene.
52    * The supergene components may be supergenes itself.
53    */

54   Gene[] getGenes();
55
56   /**
57    * Returns the Gene at the given index (locus) within the Supergene. The
58    * first gene is at index zero and the last gene is at the index equal to
59    * the size of this Supergene - 1.
60    *
61    * @param a_index the index of the gene value to be returned
62    * @return the Gene at the given index
63    */

64   Gene geneAt(int a_index);
65
66   /**
67    * Sets an object, responsible for deciding if the Supergene allele
68    * combination is valid. If it is set to null, no validation is performed
69    * (all combinations are assumed to be valid). The derived
70    * classes may have internal default validator for the case
71    * when no external validator is set.
72    */

73   void setValidator(SupergeneValidator a_validator);
74
75   /**
76    * Gets an object, responsible for deciding if the Supergene allele
77    * combination is valid. If no external validator was set and the
78    * class uses its own internal validation method, it still must be
79    * able to return a validator, using the same method (typicallly,
80    * such classes just return <i>this</i>.
81    */

82   SupergeneValidator getValidator();
83 }
84
Popular Tags