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 |
evalIndiv(int pos,
Genetic AG,
TableVar Variables,
TableDat Examples,
boolean marcar)
Evaluates an individual of the main population
|
void |
GeneticAlgorithm(TableVar Variables,
TableDat Examples,
java.lang.String nFile)
Composes the genetic algorithm applying the operators
|
int |
getBestGuy()
Return the position of the best individual of the main population
|
CromCAN |
getIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual
|
CromDNF |
getIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual
|
int |
getLenghtPop()
Methods to get the lenght of the population
|
boolean |
getLSearch()
Methods to get if local search must be performed
|
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)
Methods to get the name of the quality measure as objective in a position
|
java.lang.String |
getObj1()
Methods to get the name of the quality measure as objective 1
|
java.lang.String |
getObj2()
Methods to get the name of the quality measure as objective 2
|
java.lang.String |
getObj3()
Methods to get the name of the quality measure as objective 3
|
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 measures of a single rule of the main population
|
java.lang.String |
getRulesRep()
Gets the representation of the rules
|
float |
getW(int pos)
Methods to get the value for the weight of the objective in a position
|
float |
getW1()
Methods to get the value for the weight of the objective 1
|
float |
getW2()
Methods to get the value for the weight of the objective 2
|
float |
getW3()
Methods to get the value for the weight of the objective 3
|
boolean |
LocalImprovementCAN(TableVar Variables,
TableDat Examples)
Locally improves the rule generated.
|
boolean |
LocalImprovementDNF(TableVar Variables,
TableDat Examples)
Locally improves the rule generated.
|
void |
MultipointCrossoverCAN(TableVar Variables)
Cross operator for the genetic algorithm, where
only cross the two better individuals
|
void |
MultipointCrossoverDNF(TableVar Variables)
Cross operator for the genetic algorithm, where
only cross the two better individuals
|
void |
MutationCAN(TableVar Variables)
Applies the mutation operator.
|
void |
MutationDNF(TableVar Variables)
Applies the mutation operator.
|
void |
SelectCAN(TableVar Variables)
Applies the selection schema of the genetic algorithm
|
void |
SelectDNF(TableVar Variables)
Applies the selection schema of the genetic algorithm
|
void |
setLenghtPop(int value)
Methods to set the lenght of the population
|
void |
setLSearch(boolean value)
Methods to set if local search must be performed
|
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 |
setObj1(java.lang.String value)
Methods to set the value for the quality measures as objective 1
|
void |
setObj2(java.lang.String value)
Methods to set the value for the quality measures as objective 2
|
void |
setObj3(java.lang.String value)
Methods to set the value for the quality measures as objective 3
|
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 |
setW1(float value)
Methods to set the value for the weight of the objective 1
|
void |
setW2(float value)
Methods to set the value for the weight of the objective 2
|
void |
setW3(float value)
Methods to set the value for the weight of the objective 3
|
void |
SteadyStepReproductionCAN(TableVar Variables)
Uses a Steady Step method
|
void |
SteadyStepReproductionDNF(TableVar Variables)
Uses a Steady Step method
|
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 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 float getW1()
Methods to get the value for the weight of the objective 1
public float getW2()
Methods to get the value for the weight of the objective 2
public float getW3()
Methods to get the value for the weight of the objective 3
public float getW(int pos)
Methods to get the value for the weight of the objective in a position
pos
- of the objectivepublic void setW1(float value)
Methods to set the value for the weight of the objective 1
value
- Weight of the objective 1public void setW2(float value)
Methods to set the value for the weight of the objective 2
value
- Weight of the objective 2public void setW3(float value)
Methods to set the value for the weight of the objective 3
value
- Weight of the objective 3public java.lang.String getObj1()
Methods to get the name of the quality measure as objective 1
public java.lang.String getObj2()
Methods to get the name of the quality measure as objective 2
public java.lang.String getObj3()
Methods to get the name of the quality measure as objective 3
public java.lang.String getObj(int pos)
Methods to get the name of the quality measure as objective in a position
pos
- Position of the quality measurepublic void setObj1(java.lang.String value)
Methods to set the value for the quality measures as objective 1
value
- Quality measure as objetive 1public void setObj2(java.lang.String value)
Methods to set the value for the quality measures as objective 2
value
- Quality measure as objetive 2public void setObj3(java.lang.String value)
Methods to set the value for the quality measures as objective 3
value
- Quality measure as objetive 3public boolean getLSearch()
Methods to get if local search must be performed
public void setLSearch(boolean value)
Methods to set if local search must be performed
value
- Value of local searchpublic int getBestGuy()
Return the position of the best individual of the main population
public QualityMeasures getQualityMeasures(int pos, java.lang.String nFile)
Get the measures of a single rule of the main population
pos
- Position of the individualnFile
- Name of the file to write the valuespublic void evalIndiv(int pos, Genetic AG, TableVar Variables, TableDat Examples, boolean marcar)
Evaluates an individual of the main population
pos
- Position of the invidivualAG
- Genetic algorithm objectVariables
- Structure of the VariablesExamples
- Structure of the Examplesmarcar
- Indicates to mark the covered examplespublic CromCAN getIndivCromCAN(int pos)
Returns de hole chromosome of the selected individual
pos
- Position of the individualpublic CromDNF getIndivCromDNF(int pos)
Returns de hole chromosome of the selected individual
pos
- Position of the individualpublic void SelectCAN(TableVar Variables)
Applies the selection schema of the genetic algorithm
Variables
- Structure of Variablespublic void SelectDNF(TableVar Variables)
Applies the selection schema of the genetic algorithm
Variables
- Structure of Variablespublic void MultipointCrossoverCAN(TableVar Variables)
Cross operator for the genetic algorithm, where only cross the two better individuals
Variables
- Structure of Variablespublic void MultipointCrossoverDNF(TableVar Variables)
Cross operator for the genetic algorithm, where only cross the two better individuals
Variables
- Structure of Variablespublic void MutationCAN(TableVar Variables)
Applies the mutation operator. Uniform biased operator
Variables
- Structure of Variablespublic void MutationDNF(TableVar Variables)
Applies the mutation operator. Uniform biased operator
Variables
- Structure of Variablespublic void SteadyStepReproductionDNF(TableVar Variables)
Uses a Steady Step method
Variables
- Structure of Variablespublic void SteadyStepReproductionCAN(TableVar Variables)
Uses a Steady Step method
Variables
- Structure of Variablespublic boolean LocalImprovementCAN(TableVar Variables, TableDat Examples)
Locally improves the rule generated. This method locally optimizes on support.
Variables
- Structure of VariablesExamples
- Structure of Examplespublic boolean LocalImprovementDNF(TableVar Variables, TableDat Examples)
Locally improves the rule generated. This method locally optimizes on support.
Variables
- Structure of VariablesExamples
- Structure of Examplespublic void GeneticAlgorithm(TableVar Variables, TableDat Examples, java.lang.String nFile)
Composes the genetic algorithm applying the operators
Variables
- Structure of VariablesExamples
- Structure of ExamplesnFile
- File to write the process of the genetic algorithm