I have created a fuzzy rulebase for a project.I am currently testing to see if the rules work. I am trying to explicitly test Rule 7 from the below given rules (though the fuzzy controller has all the rules written in them).
RULE 7 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND room IS poor THEN trustWeight IS medium;
I am planning to keep the "hotelClass", "travllerType" constant while only changing the "room" values to check how the output behaves. The code for that is:
for (double room = 0.0; room <= 10; room += 0.1) {
fis.getVariable("room").setValue(room);
fis.getVariable("hotelClass").setValue(5);
fis.getVariable("travellerType").setValue(travellerType);
fis.evaluate();
// Print result & update plot
System.out.println(String.format("Room: %2.2f\t=> tweight: %2.2f ", room, fis.getVariable("trustWeight").getValue()));
}
But it seems that when I have all my rules in place, the rules dont get hit, leaving the output fuzzy set values to remain at 0. But I have no problem, when my fuzzy controller only has that one rule.
These are my rules from the original controller file:
RULE 1 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND room IS poor THEN trustWeight IS high;
RULE 2 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND service IS poor THEN trustWeight IS high;
RULE 3 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND room IS excellent THEN trustWeight IS less;
RULE 4 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND service IS excellent THEN trustWeight IS less;
RULE 5 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND room IS good THEN trustWeight IS medium;
RULE 6 : IF hotelClass IS aboveAverage AND travellerType IS businessMan AND service IS good THEN trustWeight IS medium;
RULE 7 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND room IS poor THEN trustWeight IS medium;
RULE 8 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND service IS poor THEN trustWeight IS medium;
RULE 9 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND room IS excellent THEN trustWeight IS medium;
RULE 10 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND service IS excellent THEN trustWeight IS medium;
RULE 11 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND room IS good THEN trustWeight IS high;
RULE 12 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND service IS good THEN trustWeight IS high;
Additional information :
- I am making use of "Center Of Gravity" defuzzification method to obtainvalues for the "trustweight"
- My fuzzy variables and sets are given below as well
Can anyone tell me what or where I am going wrong? Any comments, pointers, explanations etc, will really help.