public class Rule
extends java.lang.Object
Constructor and Description |
---|
Rule()
Default builder.
|
Rule(double[] instance,
int out)
Builder.
|
Modifier and Type | Method and Description |
---|---|
Rule |
clone()
Clone method
|
double |
distance(double[] instance)
Computes the distance between a given instance and the rule.
|
double |
distanceRule(Rule another)
Computes the distance between two rules.
|
boolean |
equals(java.lang.Object rul)
Equals method
|
double |
getArea()
Returns the area of the rule
|
int |
getOutput()
Returns the output class of the rule
|
void |
loadRule(double[] instance,
int out)
Reinitialices a rule, loading it with the contents of a single instance
|
void |
merge(Rule another)
Merge two rules
|
boolean |
overlap(Rule another)
Test if two rules are overlapped
|
static void |
setAttributes(Attribute[] inputs)
Test which attributes are nominal
|
static void |
setNumValue(int value,
int pos)
Sets the number of different values for an attribute
|
static void |
setSize(int value)
Sets the size of the rule
|
java.lang.String |
toString()
To String method
|
public Rule()
public Rule(double[] instance, int out)
instance
- Basic instanceout
- Ouput of the instancepublic static void setSize(int value)
value
- Number of attributes of the rulepublic static void setAttributes(Attribute[] inputs)
inputs
- Attributes' descriptionspublic static void setNumValue(int value, int pos)
value
- Number of valuespos
- Index of the attributepublic void loadRule(double[] instance, int out)
instance
- Basic instanceout
- Ouput of the instancepublic Rule clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object rul)
equals
in class java.lang.Object
rul
- Another rulepublic java.lang.String toString()
toString
in class java.lang.Object
public int getOutput()
public double getArea()
public double distance(double[] instance)
instance
- Instance to be testedpublic double distanceRule(Rule another)
another
- Second rule to be testedpublic boolean overlap(Rule another)
another
- Second rule to testpublic void merge(Rule another)
another
- Second rule to merge