Catalano.Evolutionary.Genetic.Chromosome
Class IntegerChromosome
- java.lang.Object
-
- Catalano.Evolutionary.Genetic.Chromosome.ChromosomeBase
-
- Catalano.Evolutionary.Genetic.Chromosome.IntegerChromosome
-
- All Implemented Interfaces:
- IChromosome, java.lang.Cloneable, java.lang.Comparable
public class IntegerChromosome extends ChromosomeBase
Integer Chromosome.
-
-
Constructor Summary
Constructors Constructor and Description IntegerChromosome(int[] values, int maxValue)Initializes a new instance of the IntegerChromosome class.IntegerChromosome(int size, int maxValue)Initializes a new instance of the PermutationChromosome class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IChromosomeClone()IChromosomeCreateNew()voidGenerate()int[]getData()Get values.java.lang.ObjectgetGene(int index)intgetLength()intgetMaxValue()Get maximum value of the chromosome.voidsetGene(int index, java.lang.Object gene)java.lang.StringtoString()-
Methods inherited from class Catalano.Evolutionary.Genetic.Chromosome.ChromosomeBase
compareTo, Evaluate, getFitness
-
-
-
-
Constructor Detail
-
IntegerChromosome
public IntegerChromosome(int[] values, int maxValue)Initializes a new instance of the IntegerChromosome class.- Parameters:
values- Values.maxValue- Maximum value.
-
IntegerChromosome
public IntegerChromosome(int size, int maxValue)Initializes a new instance of the PermutationChromosome class.- Parameters:
size- Size of the chromosome.maxValue- Maximum value.
-
-
Method Detail
-
getData
public int[] getData()
Get values.- Returns:
- Values.
-
getMaxValue
public int getMaxValue()
Get maximum value of the chromosome.- Returns:
- Maximum value of the chromosome.
-
getGene
public java.lang.Object getGene(int index)
- Specified by:
getGenein interfaceIChromosome- Specified by:
getGenein classChromosomeBase
-
setGene
public void setGene(int index, java.lang.Object gene)- Specified by:
setGenein interfaceIChromosome- Specified by:
setGenein classChromosomeBase
-
Generate
public void Generate()
- Specified by:
Generatein interfaceIChromosome- Specified by:
Generatein classChromosomeBase
-
CreateNew
public IChromosome CreateNew()
- Specified by:
CreateNewin interfaceIChromosome- Specified by:
CreateNewin classChromosomeBase
-
Clone
public IChromosome Clone()
- Specified by:
Clonein interfaceIChromosome- Specified by:
Clonein classChromosomeBase
-
getLength
public int getLength()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG