public class Cromosoma
extends java.lang.Object
Constructor and Description |
---|
Cromosoma(int Genes)
Creates a new chromosome with the size given.
|
Modifier and Type | Method and Description |
---|---|
int |
entrado()
Returns the flag value that carry the information about if this chromosome has been selected to be crossed or not.
|
double[] |
Gene()
Returns the values of all genes
|
double |
gene(int pos)
Get the value of a gene
|
double |
perf()
Get the performance of a chromosome
|
void |
set_entrado(int value)
Sets the flag value that carry the information about if this chromosome has been selected to be crossed or not.
|
void |
set_gene(int pos,
double value)
Set the value given to a given gene
|
void |
set_perf(double value)
Set the performance of a chromosome
|
public Cromosoma(int Genes)
Genes
- number of genes or size of the chromosome representation.public double gene(int pos)
pos
- Index of the genepublic double perf()
public double[] Gene()
public void set_perf(double value)
value
- the performance to be set.public int entrado()
public void set_entrado(int value)
value
- the flag value to set (1 = has been selected for the crossover, 0 = not selected yet)public void set_gene(int pos, double value)
pos
- position of the gene to be modified.value
- given value to be set