0
我爲一個項目創建了一個模糊規則庫。我目前正在測試以查看規則是否有效。我試圖從下面給出的規則中明確地測試規則7(儘管模糊控制器具有寫在其中的所有規則)。爲什麼我的模糊規則不會觸發?
RULE 7 : IF hotelClass IS aboveAverage AND travellerType IS familyMan AND room IS poor THEN trustWeight IS medium;
我打算保持「hotelClass」,「travllerType」不變,而只改變「房間」的價值觀,以檢查如何輸出的行爲。該代碼是:
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()));
}
但似乎當我有我的所有規則到位,規則不被打到,留下輸出模糊集合值維持在0。但我沒有問題,當我的模糊控制器只有有這個規則。
這些是從原來的控制文件,我的規矩:
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;
其他信息:
- 我正在使用的「中心重力」去模糊化方法 obtainvalues爲「trustweight」
- 我的模糊變量和集合也在下面給出
任何人都可以告訴我什麼或我要去哪裏出錯嗎?任何評論,指針,解釋等都會真正起作用。