|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number orbital.algorithm.evolutionary.Gene.Number orbital.algorithm.evolutionary.Gene.Float
public static class Gene.Float
Floating point gene data.
This implementation uses a floating-point Double
as gene data.
Double.NaN
, Double.NEGATIVE_INFINITY
and
Double.POSITIVE_INFINITY
are immune to mutation and
thus fixed points (apart from recombination).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface orbital.algorithm.evolutionary.Gene |
---|
Gene.BitSet, Gene.BoundedFloat, Gene.BoundedInteger, Gene.Fixed, Gene.Float, Gene.Integer, Gene.List, Gene.Number |
Constructor Summary | |
---|---|
Gene.Float()
Construct a non-initialized Float. |
|
Gene.Float(double data)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this gene. |
double |
doubleValue()
|
java.lang.Object |
get()
Get the gene interpretation value. |
Gene[] |
recombine(Gene[] parents,
int childrenCount,
double recombinationProbability)
Genetically recombine gene data of parents to their children via reproduction. |
void |
set(double n)
|
void |
set(java.lang.Object n)
Set the gene value. |
Methods inherited from class orbital.algorithm.evolutionary.Gene.Number |
---|
distanceMeasure, equals, floatValue, hashCode, intValue, inverse, longValue, mutate, toString |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Gene.Float(double data)
public Gene.Float()
Note: non-initialized (that is Double.NaN
) Floats are immune to mutation
which is no good starting-point for creating a population.
Method Detail |
---|
public java.lang.Object clone()
Gene
clone
in interface Gene
clone
in class Gene.Number
public java.lang.Object get()
Gene
Useful for interpreting a gene for fitness evaluation and interpretation of solutions.
public double doubleValue()
doubleValue
in class java.lang.Number
public void set(java.lang.Object n)
Gene
Consider setting fitness to Double.NaN
due to the change to remind evaluator.
n
- the Object this gene should represent.
Encodes the value such that this gene represents the given object.public void set(double n)
public Gene[] recombine(Gene[] parents, int childrenCount, double recombinationProbability)
Gene
a a = direct ancestors to be used n * --- ; n = number of children to be produced p p = probability for each part of parent's Gene to be inherited a/p = elongation of Gene length n/a = growth of population size if n/a < 1 the population is contracting. if n/a = 1 the population size is fixed. if n/a > 1 the population is growing.Usually it is p=n/a.
parents
- the Genes to be used as parents for the children.
a
is the number of parents (direct ancestors).
parents are readonly.childrenCount
- the number of Gene children to produce and return.
n
is the number of children to be produced.recombinationProbability
- the probability with that parts of the inherited gene data
is recombined.
This does not necessarily imply an exchange of data, Genes might as well
realign or repair at random. But it makes a data recombination possible.
childrenCount
children produced.
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |