,當我定義具有超過2的操作者(我不知道)的規則,我收到以下錯誤:模糊石材操作數編號錯誤。邏輯運算<and>需要兩個操作數,但在fuzzylite API發現<3>
03-06 17:19:49.155: W/System.err(712): java.lang.RuntimeException: [syntax error] logical operator <and> expects two operands, but found <3>
我的規則很喜歡:
RuleBlock ruleBlock = new RuleBlock();
ruleBlock.addRule(Rule.parse("if chestpain is TYPIC and restpress is MIN and serum is MINLEVEL and smoke is LOWPOSSIBILITY and sugar is LEVELNO and maxrate is MINRATE and restrate is LOWRATE then angin is MILD", engine));
ruleBlock.addRule(Rule.parse("if chestpain is ASYMPTOMATIC and restpress is MIN and serum is MAXLEVEL and smoke is LOWPOSSIBILITY and sugar is LEVELNO and maxrate is MINRATE and restrate is HIGHRATE then angin is MASSIVE", engine));
完整的錯誤消息是:
03-06 17:19:49.155: W/System.err(712): java.lang.RuntimeException: [syntax error] logical operator <and> expects two operands, but found <3>
03-06 17:19:49.155: W/System.err(712): at com.fuzzylite.rule.Antecedent.load(Unknown Source)
03-06 17:19:49.155: W/System.err(712): at com.fuzzylite.rule.Rule.parse(Unknown Source)
03-06 17:19:49.155: W/System.err(712): at com.example.trsa.RAP1$4.onClick(RAP1.java:253)
03-06 17:19:49.155: W/System.err(712): at android.view.View.performClick(View.java:2485)
03-06 17:19:49.155: W/System.err(712): at android.view.View$PerformClick.run(View.java:9080)
03-06 17:19:49.165: W/System.err(712): at android.os.Handler.handleCallback(Handler.java:587)
03-06 17:19:49.165: W/System.err(712): at android.os.Handler.dispatchMessage(Handler.java:92)
03-06 17:19:49.165: W/System.err(712): at android.os.Looper.loop(Looper.java:123)
03-06 17:19:49.165: W/System.err(712): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-06 17:19:49.165: W/System.err(712): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 17:19:49.165: W/System.err(712): at java.lang.reflect.Method.invoke(Method.java:507)
03-06 17:19:49.175: W/System.err(712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-06 17:19:49.186: W/System.err(712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-06 17:19:49.186: W/System.err(712): at dalvik.system.NativeStart.main(Native Method)