public class Population
extends java.lang.Object
Population of candidate rules
Constructor and Description |
---|
Population(int numind,
int numgen,
java.lang.String RulesRep,
TableVar Variables)
Creates a population of Individual
|
Modifier and Type | Method and Description |
---|---|
void |
evalIndiv(int pos,
Genetic AG,
TableVar Variables,
TableDat Examples,
boolean marcar)
Evaluates an individual of the population
|
int |
evalPop(Genetic AG,
TableVar Variables,
TableDat Examples,
boolean marcar)
Evaluates the population
|
int |
getBestGuy()
Gets the position of the better individual of the population
|
int |
getCromElem(int num_indiv,
int pos)
Returns the indicated gene of the CromCAN
|
int |
getCromElemGene(int num_indiv,
int var,
int pos)
Returns the indicated gene of the CromCAN
|
CromCAN |
getIndivCromCAN(int num_indiv)
Returns de hole cromosoma of the selected individual
|
CromDNF |
getIndivCromDNF(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
|
float |
getIndivFitness(int num_indiv)
Returns fitness of the indicated inidividual of the population
|
QualityMeasures |
getMedidas(int pos,
java.lang.String nFile)
Get the measurements of a single rule
|
void |
print(java.lang.String nFile)
Prints population individuals
|
void |
RndInitPop(TableVar Variables)
Biased random population initialization
|
void |
setCromElem(int num_indiv,
int pos,
int val)
Sets the value of the indicated gene of the CromCAN
|
void |
setCromElemGene(int num_indiv,
int var,
int pos,
int val)
Sets the value of the indicated gene of the CromCAN
|
void |
setIndivEvaluated(int num_indiv,
boolean val)
Sets the state evaluated of the individual of the population
|
void |
setIndivFitness(int num_indiv,
float val)
Sets the value of fitnes for the the indicated individual
|
public Population(int numind, int numgen, java.lang.String RulesRep, TableVar Variables)
Creates a population of Individual
numind
- Number of individualsnumgen
- Number of variablesRulesRep
- Rules representationVariables
- Variables structurepublic void RndInitPop(TableVar Variables)
Biased random population initialization
Variables
- Variables structurepublic int getBestGuy()
Gets the position of the better individual of the population
public int evalPop(Genetic AG, TableVar Variables, TableDat Examples, boolean marcar)
Evaluates the population
AG
- Genetic algorithmVariables
- Variables structureExamples
- Examples structuremarcar
- Indicates to mark the covered examplespublic void evalIndiv(int pos, Genetic AG, TableVar Variables, TableDat Examples, boolean marcar)
Evaluates an individual of the population
pos
- Position of the individualAG
- Genetic algorithmVariables
- Variables structureExamples
- Examples structuremarcar
- Indicates to mark the covered examplespublic QualityMeasures getMedidas(int pos, java.lang.String nFile)
Get the measurements of a single rule
pos
- Position of the individualnFile
- File to write the measurespublic int getCromElem(int num_indiv, int pos)
Returns the indicated gene of the CromCAN
num_indiv
- Number of individualpos
- Position of the genepublic void setCromElem(int num_indiv, int pos, int val)
Sets the value of the indicated gene of the CromCAN
num_indiv
- Number of individualpos
- Position of the geneval
- Value of the genepublic int getCromElemGene(int num_indiv, int var, int pos)
Returns the indicated gene of the CromCAN
num_indiv
- Number of individualvar
- Position of the variablepos
- Position of the genepublic void setCromElemGene(int num_indiv, int var, int pos, int val)
Sets the value of the indicated gene of the CromCAN
num_indiv
- Number of individualvar
- Position of the variablepos
- Position of the geneval
- Value of the genepublic CromCAN getIndivCromCAN(int num_indiv)
Returns de hole cromosoma of the selected individual
num_indiv
- Number of individualpublic CromDNF getIndivCromDNF(int num_indiv)
Returns de hole cromosoma of the selected individual
num_indiv
- Number of individualpublic float getIndivFitness(int num_indiv)
Returns fitness of the indicated inidividual of the population
num_indiv
- Number of individualpublic void setIndivFitness(int num_indiv, float val)
Sets the value of fitnes for the the indicated individual
num_indiv
- Number of individualval
- Value of the fitnesspublic boolean getIndivEvaluated(int num_indiv)
Returns if the individual of the population has been evaluated
num_indiv
- Number of individualpublic void setIndivEvaluated(int num_indiv, boolean val)
Sets the state evaluated of the individual of the population
num_indiv
- Number of individualval
- Value of the state of the individualpublic void print(java.lang.String nFile)
Prints population individuals
nFile
- File to write the Population