public class Individual
extends java.lang.Object
implements java.lang.Comparable
Title: Individual
Description: This class contains the representation of the individuals of the population (CHC Algorithm)
Copyright: Copyright KEEL (c) 2007
Company: KEEL
Constructor and Description |
---|
Individual()
Default constructor.
|
Individual(RuleBase ruleBase,
DataBase dataBase,
double w1)
Builder
|
Modifier and Type | Method and Description |
---|---|
Individual |
clone()
Clone
|
int |
compareTo(java.lang.Object a) |
int |
distHamming(Individual ind,
int BITS_GEN)
Computes the Hamming distance with the Individual given as a argument.
|
void |
evaluate()
Evaluate this individual (fitness function)
|
RuleBase |
generateRB()
Generates the Rule Base with adjusted to the optimization done.
|
double |
getAccuracy()
Function to return the accuracy of the individual
|
double |
getFitness()
Function to return the fitness of the individual
|
int |
getnSelected()
Returns the number of genes selected.
|
void |
Hux(Individual indiv)
Crosses the individuals using the HUX operator.
|
boolean |
isNew()
Function to return if this individual is new in the population
|
void |
offNew()
Modifies the new flag to false.
|
void |
onNew()
Modifies the new flag to true.
|
void |
randomValues()
Initialization of the individual with random values.
|
void |
reset()
Resets the gene with the same value.
|
void |
setw1(double value)
Sets the value of w1 with the given argument.
|
int |
size()
It returns the number of rules in the rule base
|
void |
xPC_BLX(Individual indiv,
double d)
Crosses the individuals using the BLX operator.
|
public Individual()
public Individual clone()
Clone
clone
in class java.lang.Object
public void reset()
public void randomValues()
Initialization of the individual with random values.
public int size()
It returns the number of rules in the rule base
public int getnSelected()
public boolean isNew()
Function to return if this individual is new in the population
public void onNew()
public void offNew()
public void setw1(double value)
value
- value given to set w1.public double getAccuracy()
Function to return the accuracy of the individual
public double getFitness()
Function to return the fitness of the individual
public int distHamming(Individual ind, int BITS_GEN)
ind
- Individual given to compute the distance.BITS_GEN
- Number of bits to guide the transformation of representation.public void Hux(Individual indiv)
indiv
- Individual to cross with.public void xPC_BLX(Individual indiv, double d)
indiv
- Individual to cross with.d
- proportion of the diference of each gene that BLX will allow to exceed.public RuleBase generateRB()
Generates the Rule Base with adjusted to the optimization done.
public void evaluate()
Evaluate this individual (fitness function)
public int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable