org.apache.commons.math3.genetics
Class BinaryChromosome
- java.lang.Object
-
- org.apache.commons.math3.genetics.Chromosome
-
- org.apache.commons.math3.genetics.AbstractListChromosome<java.lang.Integer>
-
- org.apache.commons.math3.genetics.BinaryChromosome
-
- All Implemented Interfaces:
- java.lang.Comparable<Chromosome>, Fitness
public abstract class BinaryChromosome extends AbstractListChromosome<java.lang.Integer>
Chromosome represented by a vector of 0s and 1s.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor and Description BinaryChromosome(java.lang.Integer[] representation)Constructor.BinaryChromosome(java.util.List<java.lang.Integer> representation)Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.List<java.lang.Integer>randomBinaryRepresentation(int length)Returns a representation of a random binary array of lengthlength.-
Methods inherited from class org.apache.commons.math3.genetics.AbstractListChromosome
getLength, newFixedLengthChromosome, toString
-
Methods inherited from class org.apache.commons.math3.genetics.Chromosome
compareTo, getFitness, searchForFitnessUpdate
-
-
-
-
Constructor Detail
-
BinaryChromosome
public BinaryChromosome(java.util.List<java.lang.Integer> representation) throws InvalidRepresentationExceptionConstructor.- Parameters:
representation- list of {0,1} values representing the chromosome- Throws:
InvalidRepresentationException- iff therepresentationcan not represent a valid chromosome
-
BinaryChromosome
public BinaryChromosome(java.lang.Integer[] representation) throws InvalidRepresentationExceptionConstructor.- Parameters:
representation- array of {0,1} values representing the chromosome- Throws:
InvalidRepresentationException- iff therepresentationcan not represent a valid chromosome
-
-
DMelt 3.0 © DataMelt by jWork.ORG