public class Individual
extends java.lang.Object
Title: Individual
Description: Chromosome Definition
Constructor and Description |
---|
Individual(int numGenes,
int numReglas)
Builder
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decodificaBR(int reglas,
int atributos,
java.lang.String[] nombreAtributos,
java.lang.String[] nombreClases)
It decodifies the Rule Base stored in the chromosome into an string for its visualization
|
int[] |
getExitos()
It gets the number of classified instances for each rule
|
int[] |
getFracasos()
It gets the number of misclassified instances for each rule
|
double |
getGene(int pos)
It returns the value of the gene at position i
|
boolean |
getN_e()
It checks if the chromosome has been evaluated
|
double |
getPerf()
It gets the fitness value for the chromosome
|
double[] |
getTodo()
It returns the whole chromosome
|
void |
setExitos(int pos,
int valor)
Sets the number of correctly classified instances for a rule of the chromosome
|
void |
setFracasos(int pos,
int valor)
Sets the number of correctly misclassified instances for a rule of the chromosome
|
void |
setGene(int pos,
double valor)
Sets a value for a specific gene
|
void |
setN_e(boolean valor)
Sets the chromosome as non-evaluated
|
void |
setPerf(double perf)
Sets the performance for the chromosome
|
public Individual(int numGenes, int numReglas)
numGenes
- number of genesnumReglas
- number of rulespublic double getGene(int pos)
pos
- the specific positionpublic void setGene(int pos, double valor)
pos
- the gene position inside the chromosomevalor
- the new valuepublic void setExitos(int pos, int valor)
pos
- rule idvalor
- new valuepublic void setFracasos(int pos, int valor)
pos
- rule idvalor
- new valuepublic void setN_e(boolean valor)
valor
- boolean valuepublic boolean getN_e()
public void setPerf(double perf)
perf
- fitness valuepublic double getPerf()
public double[] getTodo()
public int[] getExitos()
public int[] getFracasos()
public java.lang.String decodificaBR(int reglas, int atributos, java.lang.String[] nombreAtributos, java.lang.String[] nombreClases)
reglas
- int Total number of rulesatributos
- int Total number of attributesnombreAtributos
- String[] Attribute NamesnombreClases
- String[] Class names