fuzzylite API で、2 つ以上の演算子を使用してルールを定義すると (よくわかりません)、以下のエラーが表示されます。
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)