public class Population
extends java.lang.Object
Population of candidate rules
Constructor and Description |
---|
Population(int numind,
int numgen,
TypeVar[] TVar)
Creates a new instance of Population
|
Modifier and Type | Method and Description |
---|---|
void |
CalcPob(java.lang.String nameFichQua)
Evaluates the population
|
void |
CalcPobOutput(java.lang.String nameFileOutputTra)
Evaluates the population to obtain the output files of training and test for classification
|
boolean |
Compare(int primero,
int segundo)
Method to Compare two individuals of the population
|
int |
getCromElem(int num_indiv,
int pos,
int elem)
Returns the indicated gene of the Chromosome
|
Chromosome |
getIndivCrom(int num_indiv)
Returns de hole cromosoma of the selected individual
|
boolean |
getIndivEvaluated(int num_indiv)
Returns if the individual of the population has been evaluated
|
java.lang.String |
getIndivNameClass(int num_indiv)
Returns the class name of the individual of the population
|
int |
getIndivNumClass(int num_indiv)
Returns the class number of the individual of the population
|
int |
getIndivNvar(int num_indiv)
Returns the number of variables of the indicated individual (including the consequent)
|
float |
getIndivPerf(int num_indiv)
Returns fitness of the indicated inidividual of the population
|
int |
getIndivTotalClass(int num_indiv)
Returns the number of examples of the DB belonging to the class of the individual
|
float |
getPobBestPerf()
Gets the fitness of the best individual of the population
|
int |
getPopBestGuy()
Gets the position of the best individual of the population
|
void |
initIndEmp(int pos)
Individual of the Population initialisation
|
void |
initPopEmp()
Population initialisation (calling individual inicialisation)
|
void |
Print(java.lang.String nFile)
Prints population individuals
|
void |
setCromElem(int num_indiv,
int pos,
int elem,
int val)
Sets the value of the indicated gene of the Chromosome
|
void |
setIndivEvaluated(int num_indiv,
boolean val)
Sets the value for de evaluated attribute of the individual
|
void |
setIndivNameClass(int num_indiv,
java.lang.String val)
Sets the class name of the class of the individual
|
void |
setIndivNumClass(int num_indiv,
int val)
Sets the value for the number of the class of the individual
|
void |
setIndivNvar(int num_indiv,
int val)
Sets the number of variables of the indicated individual
|
void |
setIndivPerf(int num_indiv,
float val)
Sets the value of fitnes for the the indicated individual
|
void |
setIndivTotalClass(int num_indiv,
int val)
Sets the number of examples of the DB belonging to the class of the individual
|
void |
setPopBestGuy(int value)
Sets the position of the best individual of the population
|
public Population(int numind, int numgen, TypeVar[] TVar)
Creates a new instance of Population
numind
- Number of individuals in the populationnumgen
- Number of genes for the individualsTVar
- Contents the type of the variable, and the number of labels.public void initPopEmp()
Population initialisation (calling individual inicialisation)
public void initIndEmp(int pos)
Individual of the Population initialisation
pos
- Position of the individual to initialisepublic int getPopBestGuy()
Gets the position of the best individual of the population
public void setPopBestGuy(int value)
Sets the position of the best individual of the population
value
- The position of the best individualpublic float getPobBestPerf()
Gets the fitness of the best individual of the population
public void CalcPob(java.lang.String nameFichQua)
Evaluates the population
nameFichQua
- Output quality filepublic void CalcPobOutput(java.lang.String nameFileOutputTra)
Evaluates the population to obtain the output files of training and test for classification
nameFileOutputTra
- Output quality filepublic int getIndivNvar(int num_indiv)
Returns the number of variables of the indicated individual (including the consequent)
num_indiv
- Position of the individualpublic void setIndivNvar(int num_indiv, int val)
Sets the number of variables of the indicated individual
num_indiv
- Position of the individualval
- Number of variablespublic int getCromElem(int num_indiv, int pos, int elem)
Returns the indicated gene of the Chromosome
num_indiv
- Position of the individualpos
- Position of the variable of the individualelem
- Position of the gen of the variablepublic void setCromElem(int num_indiv, int pos, int elem, int val)
Sets the value of the indicated gene of the Chromosome
num_indiv
- Position of the individualpos
- Position of the variable of the individualelem
- Position of the gen of the variableval
- Value of the gene indicated
public float getIndivPerf(int num_indiv)
Returns fitness of the indicated inidividual of the population
num_indiv
- Position of the individualpublic void setIndivPerf(int num_indiv, float val)
Sets the value of fitnes for the the indicated individual
num_indiv
- Position of the individualval
- Fitness of the individualpublic boolean getIndivEvaluated(int num_indiv)
Returns if the individual of the population has been evaluated
num_indiv
- Position of the individualpublic void setIndivEvaluated(int num_indiv, boolean val)
Sets the value for de evaluated attribute of the individual
num_indiv
- Position of the individualval
- Value of the state of the individualpublic int getIndivNumClass(int num_indiv)
Returns the class number of the individual of the population
num_indiv
- Position of the individualpublic void setIndivNumClass(int num_indiv, int val)
Sets the value for the number of the class of the individual
num_indiv
- Position of the individualval
- Number of the class of the individualpublic java.lang.String getIndivNameClass(int num_indiv)
Returns the class name of the individual of the population
num_indiv
- Position of the individualpublic void setIndivNameClass(int num_indiv, java.lang.String val)
Sets the class name of the class of the individual
num_indiv
- Position of the individualval
- Name of the classpublic int getIndivTotalClass(int num_indiv)
Returns the number of examples of the DB belonging to the class of the individual
num_indiv
- Position of the individualpublic void setIndivTotalClass(int num_indiv, int val)
Sets the number of examples of the DB belonging to the class of the individual
num_indiv
- Position of the individualval
- Number of total examplespublic Chromosome getIndivCrom(int num_indiv)
Returns de hole cromosoma of the selected individual
num_indiv
- Position of the individualpublic boolean Compare(int primero, int segundo)
Method to Compare two individuals of the population
primero
- Position of an individualsegundo
- Position of an individualpublic void Print(java.lang.String nFile)
Prints population individuals
nFile
- File to write the population