public class Population
extends java.lang.Object
Population of candidate rules
Modifier and Type | Field and Description |
---|---|
boolean[] |
ej_cubiertos
Covered examples of the population
|
int |
num_used
Number or individuals really used
|
int |
ult_cambio_eval
Last change in the population
|
Constructor and Description |
---|
Population(int numind,
int numgen,
int nobj,
int neje,
java.lang.String RulRep,
TableVar Variables)
Creates a population of Individual
|
Modifier and Type | Method and Description |
---|---|
void |
BsdInitPob(TableVar Variables,
float porcVar,
float porcPob,
int neje,
java.lang.String nFile)
Biased random population initialization
|
void |
CopyIndiv(int pos,
int neje,
int nobj,
Individual a)
Copy the individual in the Individual otro
|
int |
evalPop(Genetic AG,
TableVar Variables,
TableDat Examples)
Evaluates non-evaluated individuals
|
void |
examplesCoverPopulation(int neje,
int trials)
This function marks the examples covered by the actual population.
|
int |
getCromElem(int num_indiv,
int pos,
int elem,
java.lang.String RulRep)
Returns the indicated gene of the Chromosome
|
Individual |
getIndiv(int pos)
Returns the indicated individual of the population
|
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
|
int |
getLastChangeEval()
Return the number of the evaluation with the last change
|
int |
getNumIndiv()
Return the number of individuals of the population
|
void |
Print(java.lang.String nFile,
java.util.Vector v)
Prints population individuals
|
void |
setCromElem(int num_indiv,
int pos,
int elem,
int val,
java.lang.String RulRep)
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
|
public int num_used
public boolean[] ej_cubiertos
public int ult_cambio_eval
public Population(int numind, int numgen, int nobj, int neje, java.lang.String RulRep, TableVar Variables)
Creates a population of Individual
numind
- Number of individualsnumgen
- Number of variablesnobj
- Number of objectivesneje
- Number of examplesRulRep
- Rules representationVariables
- Variables structurepublic void BsdInitPob(TableVar Variables, float porcVar, float porcPob, int neje, java.lang.String nFile)
Biased random population initialization
Variables
- Variables structureporcVar
- Percentage of variables to form the rulesporcPob
- Percentage of population with biased initialisationneje
- Number of examplesnFile
- File to write the populationpublic int evalPop(Genetic AG, TableVar Variables, TableDat Examples)
Evaluates non-evaluated individuals
AG
- Genetic algorithmVariables
- Variables structureExamples
- Examples structurepublic Individual getIndiv(int pos)
Returns the indicated individual of the population
pos
- Position of the individualpublic int getNumIndiv()
Return the number of individuals of the population
public void CopyIndiv(int pos, int neje, int nobj, Individual a)
Copy the individual in the Individual otro
pos
- Position of the individual to copyneje
- Number of examplesnobj
- Number of objectivesa
- Individual to copypublic int getCromElem(int num_indiv, int pos, int elem, java.lang.String RulRep)
Returns the indicated gene of the Chromosome
num_indiv
- Position of the individualpos
- Position of the variableelem
- Position of the gene of the variableRulRep
- Rules representationpublic void setCromElem(int num_indiv, int pos, int elem, int val, java.lang.String RulRep)
Sets the value of the indicated gene of the Chromosome
num_indiv
- Position of the individualpos
- Position of the variableelem
- Position of the gene of the variableval
- Value for the geneRulRep
- Rules representationpublic 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 individualpublic CromCAN getIndivCromCAN(int num_indiv)
Returns de hole cromosoma of the selected individual
num_indiv
- Position of the individualpublic CromDNF getIndivCromDNF(int num_indiv)
Returns de hole cromosoma of the selected individual
num_indiv
- Position of the individualpublic int getLastChangeEval()
Return the number of the evaluation with the last change
public void examplesCoverPopulation(int neje, int trials)
This function marks the examples covered by the actual population.
neje
- Number of examplestrials
- Number of trials performedpublic void Print(java.lang.String nFile, java.util.Vector v)
Prints population individuals
nFile
- File to write the populationv
- Vector which indicates if the individual if repeated