if( mf.isDiscrete() ) {
//---
// Discrete case
//---
DefuzzifierDiscrete defuzzifierDiscrete = (DefuzzifierDiscrete) defuzzifier;
MembershipFunctionDiscrete mfd = (MembershipFunctionDiscrete) mf;
// Add membershipfunction to deffuzifier
int i, size = mfd.size();
for( i = 0; i < size; i++ ) {
// Get 'x' value
x = mfd.valueX(i);
// Is term negated?
if( fuzzyRuleTerm.isNegated() ) membership = 1 - mf.membership(x);
else membership = mf.membership(x);
y = imply(degreeOfSupport, membership); // Call to abstract implication method described above
// Aggregate value
aggregated = variable.getRuleAggregationMethod().aggregate(defuzzifierDiscrete.getDiscreteValue(x), y);
defuzzifierDiscrete.setPoint(x, aggregated);
}
} else {
//---
// Continuous case
//---