public class Gene
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ANTECEDENT |
static int |
CONSEQUENT |
static int |
NOT_INVOLVED
It is used for representing and handling a Gene throughout the evolutionary learning
|
Constructor and Description |
---|
Gene()
It creates a new gene
|
Modifier and Type | Method and Description |
---|---|
Gene |
copy()
It allows to clone correctly a gene
|
boolean |
equals(Gene g)
It indicates whether some other gene is "equal to" this one
|
int |
getActAs()
It returns whether a gene is involved in the chromosome being considered.
|
int |
getAttr() |
boolean |
getIsPositiveInterval()
It returns if a gene treats a positive or negative interval
|
double |
getLowerBound()
It returns the lower bound of the interval stored in a gene
|
double |
getMax_attr() |
double |
getMin_attr() |
int |
getType() |
double |
getUpperBound()
It returns the upper bound of the interval stored in a gene
|
void |
invert(int type,
double min_attr,
double max_attr)
It does inversions for each part of a gene which were specifically designed for this algorithm
|
boolean |
isCover(int var,
double value) |
boolean |
isSubGen(Gene g) |
int |
randAct() |
void |
setActAs(int ac)
It sets whether a gene is involved in the chromosome being considered.
|
void |
setAttr(int var) |
void |
setIsPositiveInterval(boolean pn)
It sets if a gene treats positive or negative interval
|
void |
setLowerBound(double lb)
It sets the lower bound of the interval stored in a gene
|
void |
setMax_attr(double max_attr) |
void |
setMin_attr(double min_attr) |
void |
setType(int type) |
void |
setUpperBound(double ub)
It sets the upper bound of the interval stored in a gene
|
java.lang.String |
toString()
It returns a string representation of a gene
|
void |
tuneInterval(myDataset dataset,
int[] covered) |
public static final int NOT_INVOLVED
It is used for representing and handling a Gene throughout the evolutionary learning
public static final int ANTECEDENT
public static final int CONSEQUENT
public int getType()
public void setType(int type)
public Gene copy()
It allows to clone correctly a gene
public void invert(int type, double min_attr, double max_attr)
It does inversions for each part of a gene which were specifically designed for this algorithm
type
- The domain type of genemin_attr
- The minimum domain value depending on the type of genemax_attr
- The maximum domain value depending on the type of genepublic int getActAs()
It returns whether a gene is involved in the chromosome being considered. In case it is involved, returns if it acts as antecedent or consequent
public void setActAs(int ac)
It sets whether a gene is involved in the chromosome being considered. In case it is involved, the user must specify if it acts as antecedent or consequent
ac
- The constant value indicating the "role" played by the genepublic boolean getIsPositiveInterval()
It returns if a gene treats a positive or negative interval
public void setIsPositiveInterval(boolean pn)
It sets if a gene treats positive or negative interval
pn
- The value indicating whether the interval must be considered as positivepublic double getLowerBound()
It returns the lower bound of the interval stored in a gene
public void setLowerBound(double lb)
It sets the lower bound of the interval stored in a gene
lb
- The value indicating the lower bound of the intervalpublic double getUpperBound()
It returns the upper bound of the interval stored in a gene
public void setUpperBound(double ub)
It sets the upper bound of the interval stored in a gene
lb
- The value indicating the upper bound of the intervalpublic boolean equals(Gene g)
It indicates whether some other gene is "equal to" this one
obj
- The reference object with which to comparepublic java.lang.String toString()
It returns a string representation of a gene
toString
in class java.lang.Object
public int getAttr()
public void setAttr(int var)
public int randAct()
public void tuneInterval(myDataset dataset, int[] covered)
public boolean isCover(int var, double value)
public boolean isSubGen(Gene g)
public double getMax_attr()
public void setMax_attr(double max_attr)
public double getMin_attr()
public void setMin_attr(double min_attr)