public class Genetic
extends java.lang.Object
Methods to define the genetic algorithm and to apply operators and reproduction schema
Constructor and Description |
---|
Genetic() |
Modifier and Type | Method and Description |
---|---|
void |
CrossMultipoint(TableVar Variables,
int dad,
int mom,
int contador,
int neje)
Cross operator for the genetic algorithm
|
Population |
GeneticAlgorithm(TableVar Variables,
TableDat Examples,
java.lang.String nFile)
Composes the genetic algorithm applying the operators
|
java.lang.String |
getDiversity()
Gets the type of diversity of the algorithm
|
int |
getGen()
Gets the value of a gene
|
int |
getLengthPopulation()
Gets the lenght of the population
|
float |
getMinCnf()
Gets the minimum confidence
|
int |
getNEval()
Gets the number of evalutions of the algorithms
|
java.lang.String |
getNObjectives(int pos)
Gets the name of the objective
|
int |
getNumObjectives()
Gets the number of objectives
|
float |
getPorcCob()
Gets the percentage of biased initialisation in the re-initialisation based on coverage
|
float |
getProbCross()
Gets the cross probability
|
float |
getProbMutation()
Gets the mutation probability
|
java.lang.String |
getReInitCob()
Gets if the algorithm uses re-initialisation based on coverage
|
java.lang.String |
getRulesRep()
Gets the rules representation of the algorithm
|
java.lang.String |
getStrictDominance()
Gets if the algorithm considers strict dominance
|
int |
getTrials()
Gets the number of trials in the algorithm
|
void |
iniNObjectives()
Initialises the structure for the name of the objectives
|
void |
JoinTemp(int neje)
Joins two populations
|
void |
Mutation(TableVar Variables,
int pos)
Mutates an individual
|
java.util.Vector |
RemoveRepeatedCAN(Population original)
Eliminates the repeated individuals for canonical representation
|
java.util.Vector |
RemoveRepeatedDNF(Population original,
TableVar Variables)
Eliminates the repeated individuals for DNF representation
|
int |
Select()
Applies the selection schema of the genetic algorithm.
|
void |
setDiversity(java.lang.String value)
Sets the type of diversity of the algorithm
|
void |
setGen(int value)
Sets the value of a gene
|
void |
setLengthPopulation(int value)
Sets the lenght of the population
|
void |
setMinCnf(float value)
Sets the minimum confidence
|
void |
setNEval(int value)
Sets the number of evaluations of the algorithm
|
void |
setNObjectives(int pos,
java.lang.String value)
Sets the name of an objective
|
void |
setNumObjectives(int nobj)
Sets the number of objectives
|
void |
setPorcCob(float value)
Sets the percentage of biased initialisation in the re-initialisation based on coverage
|
void |
setProbCross(float value)
Sets the cross probability in the algorithm
|
void |
setProbMutation(float value)
Sets the mutation probability
|
void |
setReInitCob(java.lang.String value)
Sets the value of re-initialisation based on coverage
|
void |
setRulesRep(java.lang.String value)
Sets the rules representation of the algorithm
|
void |
setStrictDominance(java.lang.String value)
Sets if the algorithm considers strict dominance
|
void |
setTrials(int value)
Sets the number of trials in the algorithm
|
public void setNumObjectives(int nobj)
Sets the number of objectives
nobj
- Number of objectivespublic int getNumObjectives()
Gets the number of objectives
public void setNObjectives(int pos, java.lang.String value)
Sets the name of an objective
pos
- Position of the objectivevalue
- Name of the objectivepublic void iniNObjectives()
Initialises the structure for the name of the objectives
public java.lang.String getNObjectives(int pos)
Gets the name of the objective
pos
- Position of the objectivepublic void setLengthPopulation(int value)
Sets the lenght of the population
value
- Lenght of the populationpublic int getLengthPopulation()
Gets the lenght of the population
public void setNEval(int value)
Sets the number of evaluations of the algorithm
value
- Number of evaluationspublic int getNEval()
Gets the number of evalutions of the algorithms
public void setProbCross(float value)
Sets the cross probability in the algorithm
value
- Cross probabilitypublic float getProbCross()
Gets the cross probability
public void setProbMutation(float value)
Sets the mutation probability
value
- Mutation probabilitypublic float getProbMutation()
Gets the mutation probability
public void setGen(int value)
Sets the value of a gene
value
- Value of the genepublic int getGen()
Gets the value of a gene
public void setTrials(int value)
Sets the number of trials in the algorithm
value
- Number of trialspublic int getTrials()
Gets the number of trials in the algorithm
public java.lang.String getDiversity()
Gets the type of diversity of the algorithm
public void setDiversity(java.lang.String value)
Sets the type of diversity of the algorithm
value
- Type of diversitypublic java.lang.String getReInitCob()
Gets if the algorithm uses re-initialisation based on coverage
public void setReInitCob(java.lang.String value)
Sets the value of re-initialisation based on coverage
value
- Value of the re-inisitalisation based on coveragepublic float getPorcCob()
Gets the percentage of biased initialisation in the re-initialisation based on coverage
public void setPorcCob(float value)
Sets the percentage of biased initialisation in the re-initialisation based on coverage
value
- Value of the percentagepublic float getMinCnf()
Gets the minimum confidence
public void setMinCnf(float value)
Sets the minimum confidence
value
- Minimum confidencepublic java.lang.String getRulesRep()
Gets the rules representation of the algorithm
public void setRulesRep(java.lang.String value)
Sets the rules representation of the algorithm
value
- Representation of the rulepublic java.lang.String getStrictDominance()
Gets if the algorithm considers strict dominance
public void setStrictDominance(java.lang.String value)
Sets if the algorithm considers strict dominance
value
- The value of strict dominancepublic void JoinTemp(int neje)
Joins two populations
neje
- Number of examplespublic int Select()
Applies the selection schema of the genetic algorithm. Binary tournament selection from elite to inter
public void CrossMultipoint(TableVar Variables, int dad, int mom, int contador, int neje)
Cross operator for the genetic algorithm
Variables
- Variables structuredad
- Position of the daddymom
- Position of the mummycontador
- Position to insert the sonneje
- Number of examplespublic void Mutation(TableVar Variables, int pos)
Mutates an individual
Variables
- Variables structurepos
- Position of the individual to mutatepublic Population GeneticAlgorithm(TableVar Variables, TableDat Examples, java.lang.String nFile)
Composes the genetic algorithm applying the operators
Variables
- Variables structureExamples
- Examples structurenFile
- Fichero to write the processpublic java.util.Vector RemoveRepeatedCAN(Population original)
Eliminates the repeated individuals for canonical representation
original
- A populationpublic java.util.Vector RemoveRepeatedDNF(Population original, TableVar Variables)
Eliminates the repeated individuals for DNF representation
original
- A populationVariables
- Variables structure