public class ruleSet
extends java.lang.Object
Title: Reglas
Description: It defines a Rule-set
Company: KEEL
Constructor and Description |
---|
ruleSet()
Default Builder
|
Modifier and Type | Method and Description |
---|---|
void |
addRule(Rule regl)
It add a new rule to the set
|
ruleSet |
copyRuleSet()
It copies the rule set into a new one
|
void |
deleteRule(int i)
It removes a rule in the i-th position
|
Rule |
getLastRule()
It returns the last rule (it is supossed to be the one with less strength)
|
Rule |
getRule(int i)
It returns the i-th rule
|
java.util.LinkedList |
getRuleSet()
It returns the whole rule set
|
void |
insertion(Rule r)
Insertion operator
|
void |
print()
It prints all rules by screen
|
java.lang.String |
printString()
It prints all rules into a string
|
int |
size()
It returns the size of the rule set
|
public void addRule(Rule regl)
regl
- the rulepublic void deleteRule(int i)
i
- the position to removepublic Rule getRule(int i)
i
- rule positionpublic int size()
public java.util.LinkedList getRuleSet()
public ruleSet copyRuleSet()
public void print()
public java.lang.String printString()
public Rule getLastRule()
public void insertion(Rule r)
r
- Rule to insert
If r is in the rule set, it is not inserted again
If the size of the rule set is lower than 50, we insert the new rule
If the size of the rule set is higher than 50, we replace the last rule (less strength)