public class LongChromosome extends AbstractChromosome<G> implements NumericChromosome<Long,LongGene>, Serializable
_genes, _valid
Modifier | Constructor and Description |
---|---|
protected |
LongChromosome(ISeq<LongGene> genes) |
|
LongChromosome(Long min,
Long max)
Create a new random
LongChromosome of length one. |
|
LongChromosome(Long min,
Long max,
int length)
Create a new random
LongChromosome . |
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 . |
LongChromosome |
newInstance()
Create a new instance of type T.
|
LongChromosome |
newInstance(ISeq<LongGene> genes)
A factory method which creates a new
Chromosome of specific type
and the given genes . |
static LongChromosome |
of(LongGene... genes)
Create a new
LongChromosome with the given genes. |
static LongChromosome |
of(long min,
long max)
Create a new random
LongChromosome of length one. |
static LongChromosome |
of(long min,
long max,
int length)
Create a new random
LongChromosome . |
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 LongChromosome(ISeq<LongGene> genes)
public LongChromosome(Long min, Long max, int length)
LongChromosome
.min
- the min value of the LongGene
s (inclusively).max
- the max value of the LongGene
s (inclusively).length
- the length of the chromosome.NullPointerException
- if one of the arguments is null
.public LongChromosome(Long min, Long max)
LongChromosome
of length one.min
- the minimal value of this chromosome (inclusively).max
- the maximal value of this chromosome (inclusively).NullPointerException
- if one of the arguments is null
.public static LongChromosome of(LongGene... genes)
LongChromosome
with the given genes.genes
- the genes of the chromosome.IllegalArgumentException
- if the length of the genes array is
empty.public static LongChromosome of(long min, long max, int length)
LongChromosome
.public static LongChromosome of(long min, long max)
LongChromosome
of length one.min
- the minimal value of this chromosome (inclusively).max
- the maximal value of this chromosome (inclusively).public LongChromosome newInstance(ISeq<LongGene> genes)
Chromosome
Chromosome
of specific type
and the given genes
.newInstance
in interface Chromosome<LongGene>
genes
- the genes of the new chromosome. The given genes array is
not copied.Chromosome
of the same type with the given genes.public LongChromosome newInstance()
Factory
newInstance
in interface Factory<Chromosome<LongGene>>
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)