|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectec.Individual
ec.vector.VectorIndividual
ec.cgp.representation.VectorIndividualCGP
ec.cgp.representation.FloatVectorIndividual
public class FloatVectorIndividual
Float-based genome representation of a Cartesian Genetic Program. Gene values are restricted to floats in the range [0,1]. During program evaluation, each float value is scaled to integers in the acceptable range that is imposed by the gene's position.
| Field Summary | |
|---|---|
float[] |
genome
the genome |
static java.lang.String |
P_FLOATVECTORINDIVIDUAL
|
| Fields inherited from class ec.cgp.representation.VectorIndividualCGP |
|---|
expression |
| Fields inherited from class ec.Individual |
|---|
evaluated, EVALUATED_PREAMBLE, fitness, P_INDIVIDUAL, species |
| Constructor Summary | |
|---|---|
FloatVectorIndividual()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Make a full copy of this individual. |
ec.util.Parameter |
defaultBase()
Returns the default base for this prototype. |
void |
defaultCrossover(ec.EvolutionState state,
int thread,
ec.vector.VectorIndividual ind)
Convex (or "arithmetic") crossover for real-valued genomes. |
void |
defaultCrossover2(ec.EvolutionState state,
int thread,
ec.vector.VectorIndividual ind)
Any-point crossover. |
void |
defaultMutate(ec.EvolutionState state,
int thread)
Mutate the genome. |
boolean |
equals(java.lang.Object ind)
Adapted from FloatVectorIndividual. |
long |
genomeLength()
Return the length of the genome |
java.lang.String |
genotypeToString()
Print to a string the genotype of the Individual in a fashion intended to be parsed in again via parseGenotype(...). |
java.lang.String |
genotypeToStringForHumans()
Generate the human-readable text of the genotype, including the program's expression. |
java.lang.Object |
getGenome()
Get the genome |
int |
hashCode()
Copied from FloatVectorIndividual |
static void |
main(java.lang.String[] args)
|
static float |
randGaussian(ec.util.MersenneTwisterFast rand,
float mean,
float std)
Generate a random value with a Gaussian distribution. |
void |
reset(ec.EvolutionState state,
int thread)
Initializes the individual by randomly choosing float values uniformly from mingene to maxgene. |
void |
setGenome(java.lang.Object gen)
Set the genome |
void |
setup(ec.EvolutionState state,
ec.util.Parameter base)
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. |
static void |
testGaussian()
|
| Methods inherited from class ec.vector.VectorIndividual |
|---|
join, reset, setGenomeLength, size, split |
| Methods inherited from class ec.Individual |
|---|
parseGenotype, printIndividual, printIndividual, printIndividualForHumans, readGenotype, readIndividual, readIndividual, toString, writeGenotype, writeIndividual |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String P_FLOATVECTORINDIVIDUAL
public float[] genome
| Constructor Detail |
|---|
public FloatVectorIndividual()
| Method Detail |
|---|
public ec.util.Parameter defaultBase()
ec.Prototype
public java.lang.Object clone()
clone in interface ec.Prototypeclone in class ec.Individual
public void defaultMutate(ec.EvolutionState state,
int thread)
defaultMutate in class ec.vector.VectorIndividual
public void defaultCrossover2(ec.EvolutionState state,
int thread,
ec.vector.VectorIndividual ind)
public void defaultCrossover(ec.EvolutionState state,
int thread,
ec.vector.VectorIndividual ind)
defaultCrossover in class ec.vector.VectorIndividual
public void reset(ec.EvolutionState state,
int thread)
reset in class ec.vector.VectorIndividualpublic int hashCode()
hashCode in class ec.Individualpublic java.lang.String genotypeToStringForHumans()
genotypeToStringForHumans in class ec.Individualpublic java.lang.String genotypeToString()
ec.Individual
genotypeToString in class ec.Individualpublic boolean equals(java.lang.Object ind)
equals in class ec.Individual
public static float randGaussian(ec.util.MersenneTwisterFast rand,
float mean,
float std)
rand - The RNG to use.mean - The mean we want for our random values.std - The standard deviation we want for our random values.
public java.lang.Object getGenome()
getGenome in class VectorIndividualCGPpublic void setGenome(java.lang.Object gen)
setGenome in class ec.vector.VectorIndividualpublic long genomeLength()
genomeLength in class ec.vector.VectorIndividual
public void setup(ec.EvolutionState state,
ec.util.Parameter base)
ec.PrototypeFor prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.
setup in interface ec.Prototypesetup in interface ec.Setupsetup in class ec.Individualpublic static void testGaussian()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||