剪辑:结合领域

时间:2021-05-15 15:58:34

标签: clips

我想检查我每天生产的产品数量,如果我生产的产品超过 1 个,我希望产品的名称出现在创建的事实上。我在以下定义模板中提供了信息,我有枚举生产天数的规则: 生产第 1 天的产品 1 生产第2天产品1 生产第3天产品1 生产第3天的产品2

我想出现生产 day3 product1 product2

(deftemplate plan
(slot planID 
(type INTEGER))
(slot orderID 
(type INTEGER))
(slot product 
(type STRING))
(slot startDate 
(type INTEGER))
(slot endDate
(type INTEGER))
(slot quantity 
(type INTEGER))
)
(defrule r3
(prodPlanSheets (planID ?pid) (product ?p) (startDate ?start) (endDate ?end))
(not (producing ?start ?p))
=>
(assert (producing ?start ?p))
)


(defrule r4
(prodPlanSheets (planID ?pid) (product ?p) (startDate ?start) (endDate ?end))
(producing ?d ?p)
(test (< ?d ?end))
=>
(assert (producing (+ ?d 1) ?p))
)

非常感谢

0 个答案:

没有答案