Defuzzifier createDefuzzifier(String defuzzificationMethodType, Variable variable) {
Defuzzifier defuzzifier;
if( defuzzificationMethodType.equalsIgnoreCase("COG") ) defuzzifier = new DefuzzifierCenterOfGravity(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("COGS") ) defuzzifier = new DefuzzifierCenterOfGravitySingletons(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("COGF") ) defuzzifier = new DefuzzifierCenterOfGravityFunctions(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("COA") ) defuzzifier = new DefuzzifierCenterOfArea(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("LM") ) defuzzifier = new DefuzzifierLeftMostMax(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("RM") ) defuzzifier = new DefuzzifierRightMostMax(variable);
else if( defuzzificationMethodType.equalsIgnoreCase("MM") ) defuzzifier = new DefuzzifierMeanMax(variable);
else throw new RuntimeException("Unknown/Unimplemented Rule defuzzification method '" + defuzzificationMethodType + "'");
return defuzzifier;