在不修改现有规则的情况下计算触发的规则

Count fired rules without modifying existing rules

您如何计算在 CLIPS 中执行程序期间触发了多少条规则?但是我不想修改现有的规则,比如在每个规则中添加一个计数器。

使用(观看统计)命令:

CLIPS> (clear)
CLIPS> (defrule rule-1 (data ?) =>)
CLIPS> (assert (data 1) (data 2) (data 3))
<Fact-3>
CLIPS> (watch statistics)
CLIPS> (run)
3 rules fired        Run time is 1.60000054165721e-05 seconds.
187499.936524567 rules per second.
4 mean number of facts (4 maximum).
1 mean number of instances (1 maximum).
2 mean number of activations (3 maximum).
CLIPS>