public class Rule
extends java.lang.Object
This class contains the structure of a Fuzzy Rule
Constructor and Description |
---|
Rule()
Default constructor
|
Rule(int n_variables,
int compatibilityType)
Constructor with parameters
|
Modifier and Type | Method and Description |
---|---|
void |
assingConsequent(myDataset train,
int ruleWeight)
It assigns the rule weight to the rule
|
boolean |
comparison(Rule r)
This function detects if one rule is already included in the Rule Set
|
double |
compatibility(double[] example)
It computes the compatibility of the rule with an input example
|
void |
setClass(int clas)
It assigns the class of the rule
|
public Rule()
public Rule(int n_variables, int compatibilityType)
n_variables
- intcompatibilityType
- intpublic void setClass(int clas)
clas
- intpublic void assingConsequent(myDataset train, int ruleWeight)
train
- myDataset the training setruleWeight
- int the type of rule weightpublic double compatibility(double[] example)
example
- double[] The input examplepublic boolean comparison(Rule r)
r
- Rule Rule to compare