Catalano.Evolutionary.Genetic.Chromosome
Class DoubleChromosome
- java.lang.Object
-
- Catalano.Evolutionary.Genetic.Chromosome.ChromosomeBase
-
- Catalano.Evolutionary.Genetic.Chromosome.DoubleChromosome
-
- All Implemented Interfaces:
- IChromosome, java.lang.Cloneable, java.lang.Comparable
public class DoubleChromosome extends ChromosomeBase
Double Chromosome.
-
-
Constructor Summary
Constructors Constructor and Description DoubleChromosome(double[] values, double minValue, double maxValue)Initializes a new instance of the DoubleChromosome class.DoubleChromosome(int size, double minValue, double maxValue)Initializes a new instance of the DoubleChromosome class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IChromosomeClone()IChromosomeCreateNew()voidGenerate()double[]getData()Get values.java.lang.ObjectgetGene(int index)intgetLength()doublegetMaxValue()Get maximum value.doublegetMinValue()Get minimum value.voidsetGene(int index, java.lang.Object gene)java.lang.StringtoString()-
Methods inherited from class Catalano.Evolutionary.Genetic.Chromosome.ChromosomeBase
compareTo, Evaluate, getFitness
-
-
-
-
Constructor Detail
-
DoubleChromosome
public DoubleChromosome(double[] values, double minValue, double maxValue)Initializes a new instance of the DoubleChromosome class.- Parameters:
values- Values.minValue- Minimum value.maxValue- Maximum value.
-
DoubleChromosome
public DoubleChromosome(int size, double minValue, double maxValue)Initializes a new instance of the DoubleChromosome class.- Parameters:
size- Size of the chromosome.minValue- Minimum value.maxValue- Maximum value.
-
-
Method Detail
-
getMinValue
public double getMinValue()
Get minimum value.- Returns:
- Minimum value.
-
getMaxValue
public double getMaxValue()
Get maximum value.- Returns:
- Maximum value.
-
getData
public double[] getData()
Get values.- Returns:
- Values.
-
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