|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.Genotype
Genotypes are fixed-length populations of chromosomes. As an instance of a Genotype is evolved, all of its Chromosomes are also evolved. A Genotype may be constructed normally, whereby an array of Chromosomes must be provided, or the static randomInitialGenotype() method can be used to generate a Genotype with a randomized Chromosome population.
| Constructor Summary | |
Genotype(Configuration a_activeConfiguration,
Chromosome[] a_initialChromosomes)
Deprecated. use Genotype(Configuration, Population) instead |
|
Genotype(Configuration a_activeConfiguration,
Population a_population)
Constructs a new Genotype instance with the given array of Chromosomes and the given active Configuration instance. |
|
| Method Summary | |
boolean |
equals(java.lang.Object other)
Compares this Genotype against the specified object. |
void |
evolve()
Evolve the population of Chromosomes within this Genotype. |
void |
evolve(int a_numberOfEvolutions)
Evolves this Genotype the specified number of times. |
Chromosome[] |
getChromosomes()
Deprecated. uses getPopulation() instead |
static Configuration |
getConfiguration()
|
Chromosome |
getFittestChromosome()
Retrieves the Chromosome in the population with the highest fitness value. |
Population |
getPopulation()
|
static Genotype |
randomInitialGenotype(Configuration a_activeConfiguration)
Convenience method that returns a newly constructed Genotype instance configured according to the given Configuration instance. |
void |
setActiveConfiguration(Configuration a_activeConfiguration)
Sets the active Configuration object on this Genotype and its member Chromosomes. |
static void |
setConfiguration(Configuration a_configuration)
|
java.lang.String |
toString()
Return a string representation of this Genotype instance, useful for display purposes. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Genotype(Configuration a_activeConfiguration,
Chromosome[] a_initialChromosomes)
throws InvalidConfigurationException
a_activeConfiguration - The current active Configuration object.a_initialChromosomes - The Chromosome population to be
managed by this Genotype instance.
java.lang.IllegalArgumentException - if either the given Configuration object
or the array of Chromosomes is null, or if any of the Genes
in the array of Chromosomes is null.
InvalidConfigurationException - if the given Configuration object
is in an invalid state.
public Genotype(Configuration a_activeConfiguration,
Population a_population)
throws InvalidConfigurationException
a_activeConfiguration - The current active Configuration object.a_population - The Chromosome population to be managed by this
Genotype instance.
InvalidConfigurationException| Method Detail |
public void setActiveConfiguration(Configuration a_activeConfiguration)
throws InvalidConfigurationException
a_activeConfiguration - The current active Configuration object
that is to be referenced internally by
this Genotype and its member Chromosome
instances.
InvalidConfigurationException - if the Configuration object is
null or cannot be locked because it is in an invalid or
incomplete state.public Chromosome[] getChromosomes()
public Population getPopulation()
public Chromosome getFittestChromosome()
public void evolve()
public void evolve(int a_numberOfEvolutions)
a_numberOfEvolutions - The number of times to evolve this Genotype
before returning.public java.lang.String toString()
public static Genotype randomInitialGenotype(Configuration a_activeConfiguration)
throws InvalidConfigurationException
Note that the given Configuration instance must be in a valid state at the time this method is invoked, or an InvalidConfigurationException will be thrown.
a_activeConfiguration - The current active Configuration object.
java.lang.IllegalArgumentException - if the given Configuration object is
null.
InvalidConfigurationException - if the given Configuration
instance not in a valid state.public boolean equals(java.lang.Object other)
other - The object to compare against.
public static Configuration getConfiguration()
public static void setConfiguration(Configuration a_configuration)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||