public class Individual
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Individual()
Default Constructor
|
Individual(double wCAR,
double wV,
int lengthSC)
Constructor with parameters.
|
Individual(int[] chromosome,
double wCAR,
double wV,
int lengthSC)
Constructor with parameters
|
Modifier and Type | Method and Description |
---|---|
Individual |
clone()
Clone Function
|
int |
compareTo(java.lang.Object a)
Function to compare objects of the Individual class
Necessary to be able to use "sort" function
It sorts in an increasing order of fitness
|
void |
evaluate(Apriori apriori,
double n1,
double n2,
int Jmax)
Evaluates this individual
|
RuleBase |
generateRB(Apriori apriori,
double n1,
double n2,
int Jmax)
Generates the Rule Base with adjusted fuzzy confidences
|
double |
getAccuracy()
Function to return the accuracy of the individual
|
double |
getFitness()
Function to return the fitness of the individual
|
double |
getMinFC()
Function to return the minimum confidence of the individual
|
double |
getMinFS()
Function to return the minimum support of the individual
|
void |
interchangeValues(Individual indiv,
int pointCross1,
int pointCross2)
It interchanges the values between the position pointCross1 and pointCross2
|
boolean |
isNew()
Function to return if this individual is new in the population
|
void |
mutation(double prob)
It applies the mutation operator
|
void |
randomValues()
Initialization of the individual with random values
|
int |
size()
It returns the number of rules in the rule base
|
public Individual()
public Individual(int[] chromosome, double wCAR, double wV, int lengthSC)
chromosome
- int[] Chromosome to build the individualwCAR
- double relative weight of the classification accuracy ratewV
- double relative weight of the number of fuzzy ruleslengthSC
- int total length of the individualpublic Individual(double wCAR, double wV, int lengthSC)
wCAR
- double relative weight of the classification accuracy ratewV
- double relative weight of the number of fuzzy ruleslengthSC
- int total length of the individualpublic void randomValues()
Initialization of the individual with random values
public void interchangeValues(Individual indiv, int pointCross1, int pointCross2)
It interchanges the values between the position pointCross1 and pointCross2
indiv
- Inidividual an individualpointCross1
- int left posotionpointCross2
- int right posotionpublic int size()
It returns the number of rules in the rule base
public void mutation(double prob)
It applies the mutation operator
prob
- Probability that a chromosome has to mutate.public Individual clone()
Clone Function
clone
in class java.lang.Object
public boolean isNew()
Function to return if this individual is new in the population
public double getAccuracy()
Function to return the accuracy of the individual
public double getFitness()
Function to return the fitness of the individual
public double getMinFS()
Function to return the minimum support of the individual
public double getMinFC()
Function to return the minimum confidence of the individual
public RuleBase generateRB(Apriori apriori, double n1, double n2, int Jmax)
Generates the Rule Base with adjusted fuzzy confidences
apriori
- Apriori Apriori objectn1
- double learning rate (Nozaki method)n2
- double learning rate (Nozaki method)Jmax
- int number of iterations (Nozaki method)public void evaluate(Apriori apriori, double n1, double n2, int Jmax)
Evaluates this individual
apriori
- Apriori rules used to evaluates the individualn1
- double learning rate (Nozaki method)n2
- double learning rate (Nozaki method)Jmax
- int number of iterations (Nozaki method)public int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Individual to be compared.