I have the following CLIPS construct below and I'm interested in tallying up how many times a particular rule fired so the output will be a series of the rules fired followed by their count (see picture for example). So it would be all those rules followed by:
temperature: (times fired) seconds
pressure: (times fired) seconds
(deftemplate oil-measure
(slot utc-time (type STRING))
(slot temperature (type INTEGER))
(slot pressure (type INTEGER)))
(defrule oil-is-hot
(oil-measure (temperature ?temp) (utc-time ?time))
(test (> ?temp 32))
=>
(printout t ?time tab "temperature:" tab ?temp crlf))
(defrule pressure-is-high
(oil-measure (pressure ?press&:(> ?press 0)) (utc-time ?time))
=>
(printout t ?time tab "pressure:" tab ?press crlf))