public class DoubleChromosome extends AbstractChromosome<G> implements NumericChromosome<Double,DoubleGene>, Serializable
_genes, _valid
Modifier | Constructor and Description |
---|---|
|
DoubleChromosome(Double min,
Double max)
Create a new random
DoubleChromosome of length one. |
|
DoubleChromosome(Double min,
Double max,
int length)
Create a new random
DoubleChromosome . |
protected |
DoubleChromosome(ISeq<DoubleGene> genes) |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Return the byte value of this
NumericChromosome at the
index 0. |
byte |
byteValue(int index)
Return the byte value of this
NumericChromosome at the given
index . |
double |
doubleValue()
Return the double value of this
NumericChromosome at the
index 0. |
double |
doubleValue(int index)
Return the double value of this
NumericChromosome at the given
index . |
boolean |
equals(Object o) |
float |
floatValue()
Return the float value of this
NumericChromosome at the
index 0. |
float |
floatValue(int index)
Return the float value of this
NumericChromosome at the given
index . |
A |
getMax()
Return the maximum value of this
BoundedChromosome . |
A |
getMin()
Return the minimum value of this
BoundedChromosome . |
int |
hashCode() |
int |
intValue()
Return the int value of this
NumericChromosome at the
index 0. |
int |
intValue(int index)
Return the int value of this
NumericChromosome at the given
index . |
long |
longValue()
Return the long value of this
NumericChromosome at the
index 0. |
long |
longValue(int index)
Return the long value of this
NumericChromosome at the given
index . |
DoubleChromosome |
newInstance()
Create a new instance of type T.
|
DoubleChromosome |
newInstance(ISeq<DoubleGene> genes)
A factory method which creates a new
Chromosome of specific type
and the given genes . |
static DoubleChromosome |
of(double min,
double max)
Create a new random
DoubleChromosome of length one. |
static DoubleChromosome |
of(double min,
double max,
int length)
Create a new random
DoubleChromosome . |
static DoubleChromosome |
of(DoubleGene... genes)
Create a new
DoubleChromosome with the given genes. |
short |
shortValue()
Return the short value of this
NumericChromosome at the
index 0. |
short |
shortValue(int index)
Return the short value of this
NumericChromosome at the given
index . |
getGene, getGene, indexOf, isValid, iterator, length, toSeq, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
byteValue, byteValue, doubleValue, doubleValue, floatValue, floatValue, intValue, intValue, longValue, longValue, shortValue, shortValue
getGene, getGene, length, toSeq
isValid
protected DoubleChromosome(ISeq<DoubleGene> genes)
public DoubleChromosome(Double min, Double max, int length)
DoubleChromosome
.min
- the min value of the DoubleGene
s (inclusively).max
- the max value of the DoubleGene
s (exclusively).length
- the length of the chromosome.NullPointerException
- if one of the arguments is null
.public DoubleChromosome(Double min, Double max)
DoubleChromosome
of length one.min
- the minimal value of this chromosome (inclusively).max
- the maximal value of this chromosome (exclusively).NullPointerException
- if one of the arguments is null
.public static DoubleChromosome of(DoubleGene... genes)
DoubleChromosome
with the given genes.genes
- the genes of the chromosome.IllegalArgumentException
- if the length of the genes array is
empty.public static DoubleChromosome of(double min, double max, int length)
DoubleChromosome
.min
- the min value of the DoubleGene
s (inclusively).max
- the max value of the DoubleGene
s (exclusively).length
- the length of the chromosome.public static DoubleChromosome of(double min, double max)
DoubleChromosome
of length one.min
- the minimal value of this chromosome (inclusively).max
- the maximal value of this chromosome (exclusively).public DoubleChromosome newInstance(ISeq<DoubleGene> genes)
Chromosome
Chromosome
of specific type
and the given genes
.newInstance
in interface Chromosome<DoubleGene>
genes
- the genes of the new chromosome. The given genes array is
not copied.Chromosome
of the same type with the given genes.public DoubleChromosome newInstance()
Factory
newInstance
in interface Factory<Chromosome<DoubleGene>>
public int hashCode()
public byte byteValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.byteValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public byte byteValue()
NumericChromosome
NumericChromosome
at the
index
0.byteValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public short shortValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.shortValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public short shortValue()
NumericChromosome
NumericChromosome
at the
index
0.shortValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public int intValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.intValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public int intValue()
NumericChromosome
NumericChromosome
at the
index
0.intValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public long longValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.longValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public long longValue()
NumericChromosome
NumericChromosome
at the
index
0.longValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public float floatValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.floatValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public float floatValue()
NumericChromosome
NumericChromosome
at the
index
0.floatValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public double doubleValue(int index)
NumericChromosome
NumericChromosome
at the given
index
.doubleValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
index
- the index of the NumericGene
.Gene
with the given index
.public double doubleValue()
NumericChromosome
NumericChromosome
at the
index
0.doubleValue
in interface NumericChromosome<N extends Number & Comparable<? super N>,G extends org.jenetics.AbstractNumericGene<N,G>>
Gene
with index
0.public A getMin()
BoundedChromosome
BoundedChromosome
.getMin
in interface BoundedChromosome<A extends Comparable<? super A>,G extends org.jenetics.AbstractBoundedGene<A,G>>
BoundedChromosome
.public A getMax()
BoundedChromosome
BoundedChromosome
.getMax
in interface BoundedChromosome<A extends Comparable<? super A>,G extends org.jenetics.AbstractBoundedGene<A,G>>
BoundedChromosome
.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)