public class Chromosome extends Object implements Comparable
Constructor and Description |
---|
Chromosome(Double[] doubles) |
Chromosome(int size) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(@NotNull Object o) |
Chromosome |
copy()
Creates chromosome copy.
|
Double |
getFitness()
Returns the fitness value.
|
double |
getGene(int idx)
Returns the gene value by index.
|
void |
setFitness(Double fitness)
Sets the fitness value.
|
void |
setGene(int idx,
double geneValue)
Sets gene value by index.
|
int |
size()
Returns the amount of genes in chromosome.
|
Double[] |
toDoubleArray()
Returns the double array chromosome representation.
|
public Chromosome(int size)
size
- Size.public Chromosome(Double[] doubles)
doubles
- Doubles.public Double[] toDoubleArray()
public Double getFitness()
public void setFitness(Double fitness)
fitness
- Fitness.public int size()
public double getGene(int idx)
idx
- Index.public void setGene(int idx, double geneValue)
idx
- Index.geneValue
- Gene value.public Chromosome copy()
public int compareTo(@NotNull @NotNull Object o)
compareTo
in interface Comparable
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024