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 |
---|---|
boolean |
equals(Object obj) |
A |
getMax()
Return the maximum value of this
BoundedChromosome . |
A |
getMin()
Return the minimum value of this
BoundedChromosome . |
int |
hashCode() |
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 . |
static LongChromosome |
of(LongRange range)
Create a new random
LongChromosome of length one. |
static LongChromosome |
of(LongRange range,
int length)
Create a new random
LongChromosome . |
long[] |
toArray()
Returns an long array containing all of the elements in this chromosome
in proper sequence.
|
long[] |
toArray(long[] array)
Returns an long array containing all of the elements in this chromosome
in proper sequence.
|
getGene, 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
getMax, getMin
isValid
forEach, iterator, spliterator
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
.IllegalArgumentException
- if the length
is smaller than
one.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 long[] toArray(long[] array)
array
- the array into which the elements of this chromosomes are to
be stored, if it is big enough; otherwise, a new array is
allocated for this purpose.NullPointerException
- if the given array
is null
public long[] toArray()
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.NullPointerException
- if the given genes
are null
public static LongChromosome of(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.LongChromosome
with the given gene parameters.IllegalArgumentException
- if the length
is smaller than
one.public static LongChromosome of(LongRange range, int length)
LongChromosome
.range
- the long range of the chromosome.length
- the length of the chromosome.LongChromosome
NullPointerException
- if the given range
is null
IllegalArgumentException
- if the length
is smaller than
one.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).LongChromosome
with the given gene parameters.public static LongChromosome of(LongRange range)
LongChromosome
of length one.range
- the long range of the chromosome.LongChromosome
of length oneNullPointerException
- if the given range
is null
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 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-2016 Franz Wilhelmstötter (2016-04-24 10:25)