更新的代码:在哪里添加检查?f<-(practice-is-on-off OFF)
(defrule no-practice "Rules for when practice cannot be held"
(or ?f <- (practice (number-of-paddlers ?p&:(< ?p 6)))
?f <- (practice (number-of-coaches ?c&:(< ?c 1))))
=>
(modify ?f (practice-is-on-off OFF)))
;end
我在 CLIPS 中定义了一个模板,并且我正在使用逻辑运算符 OR。但是,当我加载模板时,它会抛出一个错误说
[TMPLTDEF1] Invalid slot or not defined in corresponding deftemplate practice.
ERROR:
(defrule MAIN::no-practice "Rules for when practice cannot be held"
?f <- (practice (or
这就是我所拥有的:提前感谢您的任何见解。谢谢
(deftemplate practice "structure of a practice"
(slot number-of-paddlers (type NUMBER))
(slot number-of-coaches (type NUMBER))
(slot practice-is-on-off (type SYMBOL) (default ON))
(slot practice-id (type NUMBER))
)
(defrule no-practice "Rules for when practice cannot be held"
?f <- (practice
(or
(number-of-paddlers
?v_number-of-paddlers&:(
< ?v_number-of-paddlers 6))
(number-of-coaches
?v_number-of-coaches&:(
< ?v_number-of-coaches 1))
)
)
=>
(modify ?f (practice-is-on-off OFF)
)
)