public abstract class Individual
extends java.lang.Object
Individual abstract class for the different types of genetic individuals.
Modifier and Type | Field and Description |
---|---|
boolean[] |
cubre
Stores if the invididual covers each example.
|
boolean |
dominado
Individual dominated or not flag.
|
boolean |
evaluado
Evaluated flag.
|
QualityMeasures |
medidas
Measurements of the individual.
|
int |
tamano
Size of the individual.
|
Constructor and Description |
---|
Individual()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
float |
calcDist(Individual other)
Computes the distance between this individual and other
NOTE: this function can not be used before the "original support" measures (if used) is computed
|
abstract void |
copyIndiv(Individual otro)
Copies an individual given.
|
boolean |
dominate(Individual other)
Calculates if "this" individual dominates "other"
NOTE: this function can not be used before the "original support" measures (if used) is computed
|
boolean |
dominated(Individual other)
Computes if this individual is dominated by other
NOTE: this function can not be used before the "original support" measures (if used) is computed
|
abstract boolean |
equalTo(Individual otro)
Checks if this individual is equal to other given.
|
abstract void |
evalInd(Genetic AG,
TableVar Variables,
TableDat Examples)
Evaluate a individual.
|
abstract int |
getCromElem(int pos)
Returns the indicated gene of the Chromosome
|
abstract int |
getCromElemGene(int pos,
int elem)
Retuns the value of the gene indicated
|
abstract CromCAN |
getIndivCromCAN()
Returns the Canonical Chromosome
|
abstract CromDNF |
getIndivCromDNF()
Returns the DNF Chromosome
|
boolean |
getIndivCubre(int pos)
Returns if the example number "pos" is covered by this individual
|
boolean |
getIndivDom()
Returns if the individual is or not dominated by other individuals
|
boolean |
getIndivEvaluated()
Returns if the individual has been evaluated
|
float |
getIndivFitness()
Returns the fitness of the individual
|
float |
getIndivOSup()
Returns the original support of the individual
|
QualityMeasures |
getMedidas(Genetic AG)
Return the quality measures of the individual
|
abstract void |
InitIndBsd(TableVar Variables,
float porcVar)
Creates biased random instance of individual
|
abstract void |
InitIndRnd(TableVar Variables)
Creates random instance of individual
|
int |
NumInterv(float valor,
int num_var,
TableVar Variables)
Returns the number of the interval of the indicated variable to which belongs
the value.
|
abstract void |
Print(java.lang.String nFile)
Method to print the contents of the individual
|
abstract void |
setCromElem(int pos,
int val)
Sets a value in a given position in the chromosome.
|
abstract void |
setCromElemGene(int pos,
int elem,
int val)
Sets the value of the indicated gene of the Chromosome
|
void |
setIndivDom(boolean val)
Sets the value for the domination value
|
void |
setIndivEvaluated(boolean val)
Sets that the individual has been evaluated
|
void |
setIndivFitness(float cd)
Sets the Fitness of the individual
|
void |
setIndivOSup(float cd)
Sets the original support of the individual
|
public int tamano
public boolean evaluado
public boolean dominado
public QualityMeasures medidas
public boolean[] cubre
public boolean getIndivCubre(int pos)
Returns if the example number "pos" is covered by this individual
pos
- example's position given.public abstract void InitIndRnd(TableVar Variables)
Creates random instance of individual
Variables
- Variables structurepublic abstract void InitIndBsd(TableVar Variables, float porcVar)
Creates biased random instance of individual
Variables
- Variables structureporcVar
- percentage of variables to appear in the biased initializationpublic boolean getIndivEvaluated()
Returns if the individual has been evaluated
public void setIndivEvaluated(boolean val)
Sets that the individual has been evaluated
val
- Value of the state of the individualpublic boolean getIndivDom()
Returns if the individual is or not dominated by other individuals
public void setIndivDom(boolean val)
Sets the value for the domination value
val
- value given.public abstract void copyIndiv(Individual otro)
otro
- given individual to be copied.public abstract boolean equalTo(Individual otro)
otro
- given individual to compare with.public float getIndivFitness()
Returns the fitness of the individual
public void setIndivFitness(float cd)
Sets the Fitness of the individual
cd
- Fitness for the individualpublic float getIndivOSup()
Returns the original support of the individual
public void setIndivOSup(float cd)
Sets the original support of the individual
cd
- Original suport for the individualpublic QualityMeasures getMedidas(Genetic AG)
Return the quality measures of the individual
AG
- Instance of the genetic algorithmpublic abstract void setCromElem(int pos, int val)
pos
- given position.val
- given value.public abstract void setCromElemGene(int pos, int elem, int val)
Sets the value of the indicated gene of the Chromosome
pos
- Position of the variableelem
- Position of the geneval
- Value of the variablepublic abstract int getCromElem(int pos)
Returns the indicated gene of the Chromosome
pos
- Position of the genepublic abstract int getCromElemGene(int pos, int elem)
Retuns the value of the gene indicated
pos
- Position of the variable in the chromosomeelem
- Position of the gene of the variablepublic abstract CromDNF getIndivCromDNF()
Returns the DNF Chromosome
public abstract CromCAN getIndivCromCAN()
Returns the Canonical Chromosome
public abstract void evalInd(Genetic AG, TableVar Variables, TableDat Examples)
Evaluate a individual. This function evaluates an individual.
AG
- Genetic algorithmVariables
- Variables structureExamples
- Examples structurepublic int NumInterv(float valor, int num_var, TableVar Variables)
Returns the number of the interval of the indicated variable to which belongs the value. It is performed seeking the greater belonging degree of the value to the fuzzy sets defined for the variable
valor
- Value to calculatenum_var
- Number of the variableVariables
- Variables structurepublic boolean dominated(Individual other)
Computes if this individual is dominated by other
NOTE: this function can not be used before the "original support" measures (if used) is computedother
- Individual to compare with "this"public boolean dominate(Individual other)
Calculates if "this" individual dominates "other"
NOTE: this function can not be used before the "original support" measures (if used) is computedother
- Individual to compare with "this"public float calcDist(Individual other)
Computes the distance between this individual and other
NOTE: this function can not be used before the "original support" measures (if used) is computedother
- Individual to compare with "this"public abstract void Print(java.lang.String nFile)
Method to print the contents of the individual
nFile
- File to write the individual