public class IndCAN extends Individual
Defines an individual composed by a Canonical cromosome.
Modifier and Type | Field and Description |
---|---|
CromCAN |
cromosoma
Individual contents (Canonical cromosome).
|
Constructor and Description |
---|
IndCAN(Genetic AG,
int length,
int numExamples,
int numObjectives)
Creates new instance of IndCAN
|
Modifier and Type | Method and Description |
---|---|
void |
copyIndiv(Individual otro)
Copy the indicaded individual in "this" individual
|
boolean |
equalTo(Individual otro)
Returns if the indicated individual is equal to "this"
Used to know if two individuals describe the same rule
|
void |
evalInd(Genetic AG,
TableVar Variables,
TableDat Examples)
Evaluate a individual.
|
int |
getCromElem(int pos)
Returns the indicated gene of the Chromosome
|
int |
getCromElemGene(int pos,
int elem)
Returns the value of the indicated gene for the variable
|
CromCAN |
getIndivCromCAN()
Returns the Chromosome
|
CromDNF |
getIndivCromDNF()
Returns the Chromosome
|
void |
InitIndBsd(TableVar Variables,
float porcVar)
Creates biased random instance of Canonical individual
|
void |
InitIndRnd(TableVar Variables)
Creates random instance of Canonical individual
|
void |
Print(java.lang.String nFile)
Method to print the contents of the individual
|
void |
setCromElem(int pos,
int val)
Sets the value of the indicated gene of the Chromosome
|
void |
setCromElemGene(int pos,
int elem,
int val)
Sets the value of the indicated gene of the Chromosome
|
calcDist, dominate, dominated, getIndivCubre, getIndivDom, getIndivEvaluated, getIndivFitness, getIndivOSup, getMedidas, NumInterv, setIndivDom, setIndivEvaluated, setIndivFitness, setIndivOSup
public CromCAN cromosoma
public IndCAN(Genetic AG, int length, int numExamples, int numObjectives)
Creates new instance of IndCAN
AG
- Instance of the genetic algorithmlength
- Length of the chromosomenumExamples
- Number of examples of the data setnumObjectives
- Number of objectives of the algorithmpublic boolean equalTo(Individual otro)
Returns if the indicated individual is equal to "this"
Used to know if two individuals describe the same rule
equalTo
in class Individual
otro
- Individual to compare with thispublic void InitIndRnd(TableVar Variables)
Creates random instance of Canonical individual
InitIndRnd
in class Individual
Variables
- Variables structurepublic void InitIndBsd(TableVar Variables, float porcVar)
Creates biased random instance of Canonical individual
InitIndBsd
in class Individual
Variables
- Variables structureporcVar
- percentage of variables to appear in the biased initializationpublic void copyIndiv(Individual otro)
Copy the indicaded individual in "this" individual
copyIndiv
in class Individual
otro
- Individual to be copiedpublic CromCAN getIndivCromCAN()
Returns the Chromosome
getIndivCromCAN
in class Individual
public CromDNF getIndivCromDNF()
Returns the Chromosome
getIndivCromDNF
in class Individual
public int getCromElem(int pos)
Returns the indicated gene of the Chromosome
getCromElem
in class Individual
pos
- Position of the genepublic int getCromElemGene(int pos, int elem)
Returns the value of the indicated gene for the variable
getCromElemGene
in class Individual
pos
- Position of the variableelem
- Position of the genepublic void setCromElem(int pos, int val)
Sets the value of the indicated gene of the Chromosome
setCromElem
in class Individual
pos
- Position of the variableval
- Value of the variablepublic void setCromElemGene(int pos, int elem, int val)
Sets the value of the indicated gene of the Chromosome
setCromElemGene
in class Individual
pos
- Position of the variableelem
- Position of the geneval
- Value of the variablepublic void evalInd(Genetic AG, TableVar Variables, TableDat Examples)
Evaluate a individual. This function evaluates an individual.
evalInd
in class Individual
AG
- Genetic algorithmVariables
- Variables structureExamples
- Ejemplos structurepublic void Print(java.lang.String nFile)
Method to print the contents of the individual
Print
in class Individual
nFile
- File to write the individual