public class Genetic
extends java.lang.Object
Methods to define the genetic algorithm and to apply operators and reproduction schema
Constructor and Description |
---|
Genetic()
Creates a new instance of Genetic
|
Modifier and Type | Method and Description |
---|---|
void |
BinTournSelect()
BinTournSelect
Applies the selection schema of the genetic algorithm
Binary tournament selection from elite to inter
|
void |
CompletaElite()
CompletaElite
Stores in elite the better individuals of temporal
It is suposed here there that are at last the number of individulas that fit on elite
|
void |
createObj(int num)
Method to create the Obj array with num (+1) elements
|
void |
evalEliteIndiv(int pos,
Genetic AG,
TableVar Variables,
TableDat Examples)
Evaluates an individual of the elite population
|
void |
evalIndiv(int pos,
Genetic AG,
TableVar Variables,
TableDat Examples)
Evaluates an individual of the main population
|
void |
GeneticAlgorithm(TableVar Variables,
TableDat Examples,
int NumObjectives,
java.lang.String nFile)
Composes the genetic algorithm applying the operators
|
CromCAN |
getEliteIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual of the elite population
|
CromDNF |
getEliteIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual iof the elite pupulation
|
CromCAN |
getIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual of the main population
|
CromDNF |
getIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual of the main population
|
int |
getLenghtElite()
Methods to get the lenght of the elite population
|
int |
getLenghtPop()
Methods to get the lenght of the population
|
float |
getMinConf()
Methods to get the value for the minimum confidence of the rules to be generated
|
int |
getNEval()
Methods to get the number of evaluation to perform in an iteration of the GA
|
java.lang.String |
getObj(int pos)
Method to get the name of the quality measure in position pos
|
float |
getProbCross()
Methods to get the value for the crossover probability
|
float |
getProbMut()
Methods to get the value for the mutation probability
|
QualityMeasures |
getQualityMeasures(int pos,
java.lang.String nFile)
Get the measurements of a single rule of the main population
|
QualityMeasures |
getQualityMeasuresElite(int pos,
java.lang.String nFile)
Get the measurements of a single rule of the elite population
|
java.lang.String |
getRulesRep()
Gets the representation of the rules
|
int |
getUsedElite()
Method to get the number of different individuals in the final elite population
|
void |
JoinTemp()
JoinTemp
Joins Elite population with Population into temporal population
Previous contents are lost
|
int |
MultipointCrossover(TableVar Variables)
Multipoint cross operator for the genetic algorithm
Better chromosomes of Inter are at the first positions
as the cross individual, stored in Des
|
void |
Reproduccion(TableVar Variables)
Reproductdion schema
Replaces the worst individuals with the generated by cross and mutation
|
void |
setLenghtElite(int value)
Methods to set the lenght of the elite population
|
void |
setLenghtPop(int value)
Methods to set the lenght of the population
|
void |
setMinConf(float value)
Methods to set the value for the minimum confidence of the rules to be generated
|
void |
setMuNext(int value)
Sets the value for indicating the position of the next mutation
|
void |
setNEval(int value)
Methods to set the number of evaluation to perform in an iteration of the GA
|
void |
setObj(int pos,
java.lang.String value)
Method to set the name of the quality measure in position pos
|
void |
setProbCross(float value)
Methods to set the value for the crossover probability
|
void |
setProbMut(float value)
Methods to set the value for the mutation probability
|
void |
setRulesRep(java.lang.String value)
Sets the representation of the rules
|
void |
SteadyStepReproduction(TableVar Variables)
Reproductdion schema - Modified steady step
Not used
|
void |
TruncaElite()
TruncaElite
Stores in elite part of the non-dominated individuals of temporal
This is because temporal contains more non-dominated that fits in elite
|
void |
UniformBiasedMutation(TableVar Variables)
Applies the mutation operator.
|
public void JoinTemp()
JoinTemp
Joins Elite population with Population into temporal population Previous contents are lost
public void CompletaElite()
CompletaElite
Stores in elite the better individuals of temporal It is suposed here there that are at last the number of individulas that fit on elite
public void TruncaElite()
TruncaElite
Stores in elite part of the non-dominated individuals of temporal This is because temporal contains more non-dominated that fits in elite
public int getLenghtPop()
Methods to get the lenght of the population
public void setLenghtPop(int value)
Methods to set the lenght of the population
value
- Length of the populationpublic int getLenghtElite()
Methods to get the lenght of the elite population
public void setLenghtElite(int value)
Methods to set the lenght of the elite population
value
- Length of the elite populationpublic int getUsedElite()
Method to get the number of different individuals in the final elite population
public void setMuNext(int value)
Sets the value for indicating the position of the next mutation
value
- Value of the variable Mu_nextpublic int getNEval()
Methods to get the number of evaluation to perform in an iteration of the GA
public void setNEval(int value)
Methods to set the number of evaluation to perform in an iteration of the GA
value
- Number of evaluationspublic float getMinConf()
Methods to get the value for the minimum confidence of the rules to be generated
public void setMinConf(float value)
Methods to set the value for the minimum confidence of the rules to be generated
value
- Minimum confidencepublic java.lang.String getRulesRep()
Gets the representation of the rules
public void setRulesRep(java.lang.String value)
Sets the representation of the rules
value
- Representation of the rulespublic float getProbCross()
Methods to get the value for the crossover probability
public void setProbCross(float value)
Methods to set the value for the crossover probability
value
- Crossover probabilitypublic float getProbMut()
Methods to get the value for the mutation probability
public void setProbMut(float value)
Methods to set the value for the mutation probability
value
- Mutation probabilitypublic void createObj(int num)
Method to create the Obj array with num (+1) elements
num
- Num of elementospublic java.lang.String getObj(int pos)
Method to get the name of the quality measure in position pos
pos
- Position of the quality measurepublic void setObj(int pos, java.lang.String value)
Method to set the name of the quality measure in position pos
pos
- Postion of the quality measurevalue
- Name of the quality measure in position pospublic QualityMeasures getQualityMeasures(int pos, java.lang.String nFile)
Get the measurements of a single rule of the main population
pos
- Position of the individualnFile
- Name of the file to write the valuespublic QualityMeasures getQualityMeasuresElite(int pos, java.lang.String nFile)
Get the measurements of a single rule of the elite population
pos
- Position of the individualnFile
- Name of the file to write the valuespublic void evalIndiv(int pos, Genetic AG, TableVar Variables, TableDat Examples)
Evaluates an individual of the main population
pos
- Position of the invidivualAG
- Genetic algorithm objectVariables
- Structure of the VariablesExamples
- Structure of the Examplespublic void evalEliteIndiv(int pos, Genetic AG, TableVar Variables, TableDat Examples)
Evaluates an individual of the elite population
pos
- Position of the invidivualAG
- Genetic algorithm objectVariables
- Structure of the VariablesExamples
- Structure of the Examplespublic CromCAN getIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual of the main population
pos
- Position of the individualpublic CromDNF getIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual of the main population
pos
- Position of the individualpublic CromCAN getEliteIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual of the elite population
pos
- Position of the individualpublic CromDNF getEliteIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual iof the elite pupulation
pos
- Position of the individualpublic void BinTournSelect()
BinTournSelect Applies the selection schema of the genetic algorithm
Binary tournament selection from elite to interpublic int MultipointCrossover(TableVar Variables)
Multipoint cross operator for the genetic algorithm
Better chromosomes of Inter are at the first positions as the cross individual, stored in DesVariables
- Structure of Variablespublic void UniformBiasedMutation(TableVar Variables)
Applies the mutation operator. Uniform biased operator
Variables
- Structure of Variablespublic void Reproduccion(TableVar Variables)
Reproductdion schema
Replaces the worst individuals with the generated by cross and mutationVariables
- Structure of Variablespublic void SteadyStepReproduction(TableVar Variables)
Reproductdion schema - Modified steady step
Not usedVariables
- Structure of Variablespublic void GeneticAlgorithm(TableVar Variables, TableDat Examples, int NumObjectives, java.lang.String nFile)
Composes the genetic algorithm applying the operators
Variables
- Structure of VariablesExamples
- Structure of ExamplesNumObjectives
- Number of objectives usednFile
- File to write the process of the genetic algorithm