public class ruleset
extends java.lang.Object
It contains the methods for handling the set of learned rules
Modifier and Type | Method and Description |
---|---|
void |
Add_Weight(int rule,
double weight)
Associates the weight "weight" to the rule "rule"
|
void |
Add(genetcode x,
double weight)
Add a new rule "x" to the last position of the set of learned rules
with its weight associated "weight".
|
void |
AddDomain(vectorvar x) |
int |
Conditions_per_RB()
Returns the number of conditions per rule base.
|
double |
Frecuence_each_Variables(int[] frec)
Returns in "frec" the times that each variable appears in the rule base.
|
double |
Get_Weight(int rule) |
int |
InferenceC(vectordouble v,
Double_t grado,
Int_t regla_disparada)
Returns the class of the rule that better adapts to the example "v", the adaptation
degree "grado" and the ordinal of the fired rule "regla_disparada".
|
int |
N_rule()
Returns the number of rules of the ruleset
|
void |
Remove()
Removes the last rule of the set of learned rules.
|
void |
SaveRuleInterpreted_append(java.io.OutputStream fich)
Writes each rule of the rule base in file "fich".
|
void |
SaveRuleInterpreted_append(java.lang.String fich)
Writes each rule of the rule base in file "fich".
|
java.lang.String |
SPrint(int i) |
double |
Variables_per_rule()
Returns the average number of variables per rule.
|
double |
Variables_Used()
Returns the rate of variables used in rules related to all variables involved.
|
public void AddDomain(vectorvar x)
public void Add(genetcode x, double weight)
Add a new rule "x" to the last position of the set of learned rules with its weight associated "weight".
x
- genetcode The genetic information of the rule which is going to be addedweight
- double The weight of the rulepublic void Add_Weight(int rule, double weight)
Associates the weight "weight" to the rule "rule"
rule
- int The selected ruleweight
- double The weight of the rulepublic double Get_Weight(int rule)
public void Remove()
Removes the last rule of the set of learned rules.
public int N_rule()
Returns the number of rules of the ruleset
public double Variables_per_rule()
Returns the average number of variables per rule.
public double Variables_Used()
Returns the rate of variables used in rules related to all variables involved.
public double Frecuence_each_Variables(int[] frec)
Returns in "frec" the times that each variable appears in the rule base.
frec
- int[] Vector with the information requiredpublic int Conditions_per_RB()
Returns the number of conditions per rule base.
public int InferenceC(vectordouble v, Double_t grado, Int_t regla_disparada)
Returns the class of the rule that better adapts to the example "v", the adaptation degree "grado" and the ordinal of the fired rule "regla_disparada".
v
- vectordouble The selected examplegrado
- Double_t The adaptation degreeregla_disparada
- Int_t The ordinal of the fired rulepublic java.lang.String SPrint(int i)
public void SaveRuleInterpreted_append(java.io.OutputStream fich) throws java.io.IOException
Writes each rule of the rule base in file "fich".
fich
- OutputStream Output filejava.io.IOException
- the file can not be written.public void SaveRuleInterpreted_append(java.lang.String fich) throws java.io.IOException
Writes each rule of the rule base in file "fich".
fich
- String Name of the output filejava.io.IOException
- the file can not be written.