public class Rule
extends java.lang.Object
Represents one rule as specified by the OIGA Algorithm
Constructor and Description |
---|
Rule()
Default constructor.
|
Rule(int _nAtt)
Constructor with the number of attributes specified
|
Rule(Rule regla)
Deep-copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
append(Rule s)
Adds all the antecedents attributes of the rule s to this rule (to perform the IGA)
|
int |
evaluate(double[] inputs)
Evaluates the inputs and output the class if covered, -1 if not
|
boolean |
getActivation(int att)
Obtains the activation state of the attribute
|
int |
getClas()
Returns the class associated to this rule
|
double[] |
getLimits(int att)
Returns the bounds of the attribute in the rule
|
void |
setActivation(int att,
boolean act)
Sets the activation of the attribute
|
void |
setClass(int _c)
Sets the consequent of the rule
|
void |
setLength(int numAtt)
Allocates new memory for the number of attributes specified (delete
previous memory).
|
void |
setLimits(int att,
double min,
double max)
Sets the new limits of the attribute in the rule
|
public Rule()
Default constructor. Does not allocate any memory!
public Rule(int _nAtt)
Constructor with the number of attributes specified
_nAtt
- number of attributes included in this rulepublic Rule(Rule regla)
Deep-copy constructor
regla
- original rulepublic boolean getActivation(int att)
att
- selected attribute from the rulepublic double[] getLimits(int att)
att
- selected attribute from the rulepublic int getClas()
Returns the class associated to this rule
public void setActivation(int att, boolean act)
att
- attribute selected from the ruleact
- if this attribute will be used or notpublic void setLimits(int att, double min, double max)
att
- attribute selected in the rulemin
- new min limit for the attributemax
- new max limit for the attributepublic void setClass(int _c)
_c
- new class consequent of the rulepublic void setLength(int numAtt)
numAtt
- new number of attributes of the rulepublic int evaluate(double[] inputs)
inputs
- input data of the data set to be classifiedpublic void append(Rule s)
s
- all the attributes of this rule will be appended to the present one