public class Chromosome
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
double |
antsSupport |
double |
CF |
double |
confidence |
double |
consSupport |
double |
conv |
Gene[] |
genes
It is used for representing and handling a Chromosome throughout the evolutionary learning
|
double |
lift |
int |
nAnts |
int |
nCons |
double |
netConf |
int |
numObjectives |
double[] |
objectives |
double |
support |
double |
yulesQ |
Constructor and Description |
---|
Chromosome(Gene[] genes,
int numObjectives)
It creates a new chromosome by setting up its genes
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object chr) |
void |
computeFitness(int max_rank) |
void |
computeObjetives(myDataset dataset) |
Chromosome |
copy()
It allows to clone correctly a chromosome
|
boolean |
equals(Chromosome chr)
It indicates whether some other chromosome is "equal to" this one
|
void |
forceConsistency()
It checks whether a chromosome always contains at least one antecedent gene as well as at least one consequent gene.
|
double |
getAntsSupport()
It returns the support of the association rule represented by a chromosome
|
double |
getCF() |
double |
getConfidence()
It returns the confidence of the association rule represented by a chromosome
|
double |
getConsSupport() |
double |
getConv() |
java.util.ArrayList<java.lang.Integer> |
getCoveredTIDs(myDataset dataset)
It compares a chromosome with another one in order to accomplish ordering later.
|
double |
getFitness_rank() |
Gene |
getGene(int i)
It returns the "i-th" gene of a chromosome
|
Gene[] |
getGenes()
It returns the genes of a chromosome
|
double |
getLift() |
int |
getnAnts() |
int |
getnCons() |
double |
getNetConf() |
double |
getObjective(int num) |
double[] |
getObjectives()
It returns the objectives of a chromosome
|
int |
getRank() |
double |
getSupport()
It returns the support of the association rule represented by a chromosome
|
double |
getYulesQ() |
int |
isBetter(Chromosome chromo) |
boolean |
isCovered(double[] example)
It adds a dataset records to the list of records being covered by a chromosome
|
boolean |
isNew() |
void |
setCF(double cf) |
void |
setConfidence(double confidence)
It sets the confidence of the association rule represented by a chromosome
|
void |
setConsSupport(double consSupport) |
void |
setConv(double conv) |
void |
setFitness_rank(double fitness_rank) |
void |
setLift(double lift) |
void |
setnAnts(int value) |
void |
setNetConf(double netConf) |
void |
setNew(boolean value) |
void |
setObjetives(double[] objectives)
It sets the objectives for a chromosome
|
void |
setSupport(double support)
It sets the support of the association rule represented by a chromosome
|
java.lang.String |
toString()
It returns a string representation of a chromosome
|
public Gene[] genes
It is used for representing and handling a Chromosome throughout the evolutionary learning
public double[] objectives
public int numObjectives
public double antsSupport
public double consSupport
public double support
public double confidence
public double lift
public double conv
public double CF
public double netConf
public double yulesQ
public int nAnts
public int nCons
public Chromosome(Gene[] genes, int numObjectives)
It creates a new chromosome by setting up its genes
genes
- The array of genes that the chromosome must handlepublic Chromosome copy()
It allows to clone correctly a chromosome
public void setObjetives(double[] objectives)
It sets the objectives for a chromosome
objectives
- The objectives value of the chromosomepublic double[] getObjectives()
It returns the objectives of a chromosome
public void setSupport(double support)
It sets the support of the association rule represented by a chromosome
support
- The value representing the rule supportpublic double getSupport()
It returns the support of the association rule represented by a chromosome
public double getAntsSupport()
It returns the support of the association rule represented by a chromosome
public void setConfidence(double confidence)
It sets the confidence of the association rule represented by a chromosome
confidence
- The value representing the rule confidencepublic double getConfidence()
It returns the confidence of the association rule represented by a chromosome
public Gene[] getGenes()
It returns the genes of a chromosome
public Gene getGene(int i)
It returns the "i-th" gene of a chromosome
i
- The index of the genepublic void forceConsistency()
It checks whether a chromosome always contains at least one antecedent gene as well as at least one consequent gene. If not, it forces this constraint by randomly altering some of its genes
public boolean equals(Chromosome chr)
It indicates whether some other chromosome is "equal to" this one
obj
- The reference object with which to comparepublic java.lang.String toString()
It returns a string representation of a chromosome
toString
in class java.lang.Object
public double getObjective(int num)
public int isBetter(Chromosome chromo)
public int compareTo(java.lang.Object chr)
compareTo
in interface java.lang.Comparable
public int getnCons()
public boolean isCovered(double[] example)
It adds a dataset records to the list of records being covered by a chromosome
tid
- The ID of the covered record in the datasetpublic void setNew(boolean value)
public boolean isNew()
public void computeObjetives(myDataset dataset)
public void computeFitness(int max_rank)
public int getnAnts()
public void setnAnts(int value)
public int getRank()
public java.util.ArrayList<java.lang.Integer> getCoveredTIDs(myDataset dataset)
It compares a chromosome with another one in order to accomplish ordering later. The comparison is achieved by only considering objectives values. For this reason, note that this method provides a natural ordering that is inconsistent with equals
obj
- The object to be comparedpublic double getFitness_rank()
public void setFitness_rank(double fitness_rank)
public double getLift()
public void setLift(double lift)
public double getCF()
public void setCF(double cf)
public double getConv()
public void setConv(double conv)
public double getNetConf()
public void setNetConf(double netConf)
public double getConsSupport()
public void setConsSupport(double consSupport)
public double getYulesQ()