یه کد برای نوشتن قوانین پیدا کردم اما ازش سر در نمی آرم
و این
کد:
struct rule_element_type{
int *value; /* pointer to antecedent/output strength value */
struct rule_element_type *next; /* next antecedent/output element in rule */
};
struct rule_type{
struct rule_element_type *if_side; /* list of antecedents in rule */
struct rule_element_type *then_side; /* list of outputs in rule */
struct rule_type *next; /* next rule in rule base */
};
struct rule_type *Rule_Base; /* list of all rules in rule base */
و این
کد:
structfuzzy_rule
{
struct MF_lable *input1;
struct MF_lable *output;
float f;
};
struct fuzzy_rule R[Num_rules];
For example, rule1 “If error is NEG then firing angle is Z” can be defined as follows-
R[1].input1=&NEG;
R[1].output=&Z;
R[1].f=0; //initializing