private void MultiParticipate_Defazzificator(FuzzyRules[] Rules, double[] Input1, double[] Input2, double[] Input3, double[] ResultTable) { int RuleActivation = -1; for (int i = 0; i < Rules.Length; i++) { if ((Input1[Rules[i].Input1] > 0) && (Input2[Rules[i].Input2] > 0) && (Input3[Rules[i].Input3] > 0)) { RuleActivation = Rules[i].Output; double Min = 0; Min = Math.Min(Input1[Rules[i].Input1], Math.Min(Input2[Rules[i].Input2], Input3[Rules[i].Input3])); ResultTable[RuleActivation] += Min; } } }
private void MultiParticipate_Equal_Defazzificator(FuzzyRules[] Rules, double[] Input1, double[] Input2, double[] Input3, double[] ResultTable) { int RuleActivation = -1; for (int i = 0; i < Rules.Length; i++) { if ((Input1[Rules[i].Input1] > 0) && (Input2[Rules[i].Input2] > 0) && (Input3[Rules[i].Input3] > 0)) { RuleActivation = Rules[i].Output; ResultTable[RuleActivation]++; } } }
private void LOM_Defazzificator(FuzzyRules[] Rules, double[] Input1, double[] Input2, double[] Input3, double[] ResultTable) { int RuleActivation = -1; double LOM_MAXofMIN = 0; for (int i = 0; i < Rules.Length; i++) { if ((Input1[Rules[i].Input1] > 0) && (Input2[Rules[i].Input2] > 0) && (Input3[Rules[i].Input3] > 0)) { double Min = 0; Min = Math.Min(Input1[Rules[i].Input1], Math.Min(Input2[Rules[i].Input2], Input3[Rules[i].Input3])); if (Min > LOM_MAXofMIN) { LOM_MAXofMIN = Min; RuleActivation = Rules[i].Output; } } } ResultTable[RuleActivation]++; }