- All Implemented Interfaces:
BoundedChromosome<BigInteger,,BigIntegerGene> Chromosome<BigIntegerGene>,NumericChromosome<BigInteger,,BigIntegerGene> BaseSeq<BigIntegerGene>,Factory<Chromosome<BigIntegerGene>>,Verifiable,Serializable,Iterable<BigIntegerGene>,RandomAccess
public class BigIntegerChromosome
extends AbstractChromosome<BigIntegerGene>
implements NumericChromosome<BigInteger,BigIntegerGene>, Serializable
Numeric chromosome implementation which holds arbitrary sized integer numbers.
- Since:
- 3.5
- Version:
- 5.2
- See Also:
-
Field Summary
Fields inherited from class io.jenetics.AbstractChromosome
_genes, _valid -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBigIntegerChromosome(ISeq<BigIntegerGene> genes) Create a new chromosome from the given genes array.BigIntegerChromosome(BigInteger min, BigInteger max) Create a new randomDoubleChromosomeof length one.BigIntegerChromosome(BigInteger min, BigInteger max, int length) Create a new randomBigIntegerChromosomewith the givenlength. -
Method Summary
Modifier and TypeMethodDescriptionmax()Return the maximum value of thisBoundedChromosome.min()Return the minimum value of thisBoundedChromosome.Create a new instance of type T.newInstance(ISeq<BigIntegerGene> genes) A factory method which creates a newChromosomeof specific type and the givengenes.static BigIntegerChromosomeof(BigIntegerGene... genes) Create a newDoubleChromosomewith the given genes.static BigIntegerChromosomeof(BigInteger min, BigInteger max) Create a new randomDoubleChromosomeof length one.static BigIntegerChromosomeof(BigInteger min, BigInteger max, int length) Create a new randomDoubleChromosome.Methods inherited from class io.jenetics.AbstractChromosome
equals, get, hashCode, isValid, length, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.jenetics.util.BaseSeq
forEach, get, isEmpty, iterator, length, listIterator, nonEmpty, spliterator, streamMethods inherited from interface io.jenetics.Chromosome
as, gene, isValidMethods inherited from interface io.jenetics.NumericChromosome
byteValue, byteValue, doubleValue, doubleValue, floatValue, floatValue, intValue, intValue, longValue, longValue, shortValue, shortValue
-
Constructor Details
-
BigIntegerChromosome
Create a new chromosome from the given genes array.- Parameters:
genes- the genes of the new chromosome.- Throws:
IllegalArgumentException- if thegenes.length()is smaller than one.NullPointerException- if thegenesarenull.IllegalArgumentException- if the gene sequence is empty
-
BigIntegerChromosome
Create a new randomBigIntegerChromosomewith the givenlength.- Parameters:
min- the min value of theBigIntegerGenes (inclusively).max- the max value of theBigIntegerGenes (exclusively).length- the length of the chromosome.- Throws:
NullPointerException- if one of the arguments isnull.IllegalArgumentException- if thelengthis smaller than one.
-
BigIntegerChromosome
Create a new randomDoubleChromosomeof length one.- Parameters:
min- the minimal value of this chromosome (inclusively).max- the maximal value of this chromosome (exclusively).- Throws:
NullPointerException- if one of the arguments isnull.
-
-
Method Details
-
min
Description copied from interface:BoundedChromosomeReturn the minimum value of thisBoundedChromosome.- Specified by:
minin interfaceBoundedChromosome<BigInteger,BigIntegerGene> - Returns:
- the minimum value of this
BoundedChromosome.
-
max
Description copied from interface:BoundedChromosomeReturn the maximum value of thisBoundedChromosome.- Specified by:
maxin interfaceBoundedChromosome<BigInteger,BigIntegerGene> - Returns:
- the maximum value of this
BoundedChromosome.
-
newInstance
Description copied from interface:ChromosomeA factory method which creates a newChromosomeof specific type and the givengenes.- Specified by:
newInstancein interfaceChromosome<BigIntegerGene>- Parameters:
genes- the genes of the new chromosome. The given genes array is not copied.- Returns:
- A new
Chromosomeof the same type with the given genes.
-
newInstance
Description copied from interface:FactoryCreate a new instance of type T.- Specified by:
newInstancein interfaceFactory<Chromosome<BigIntegerGene>>- Returns:
- a new instance of type T
-
of
Create a newDoubleChromosomewith the given genes.- Parameters:
genes- the genes of the chromosome.- Returns:
- a new chromosome with the given genes.
- Throws:
IllegalArgumentException- if the length of the genes array is empty.NullPointerException- if the givengenesarray isnull
-
of
Create a new randomDoubleChromosome.- Parameters:
min- the min value of theDoubleGenes (inclusively).max- the max value of theDoubleGenes (exclusively).length- the length of the chromosome.- Returns:
- a new
DoubleChromosomewith the given parameter
-
of
Create a new randomDoubleChromosomeof length one.- Parameters:
min- the minimal value of this chromosome (inclusively).max- the maximal value of this chromosome (exclusively).- Returns:
- a new
DoubleChromosomewith the given parameter
-