Post not yet marked as solved
This doesn't seem to work anymore in iOS 13, has anyone figured out another way?
Hmm, oddly it turned out to be an issue with the set-column-narrative. Removing that from both fixed it.
Post not yet marked as solved
So it seems that the CLIPS IDE doesn't quite work the same way as Instruments. After a few tweaks I had the following working:(deftemplate state-update
(slot time (type INTEGER))
(slot state (type STRING))
)
(deftemplate state-interval
(slot start (type INTEGER))
(slot duration (type INTEGER))
(slot state (type STRING))
)
(defrule MODELER::update-state
?signpost <- (os-signpost
(subsystem "com.hudl.magician")
(category "LoggingAVPlayer")
(name "reasonForWaitingToPlay")
(event-type "Event")
(message$ ?state)
(time ?time)
(identifier ?identifier)
)
(not (state-update (time ?) (state ?)))
=>
(retract ?signpost)
(assert (state-update (time ?time) (state ?state)))
(log-narrative "update-state %string%" state)
)
(defrule MODELER::pair-state
?signpost <- (os-signpost
(subsystem "com.hudl.magician")
(category "LoggingAVPlayer")
(name "reasonForWaitingToPlay")
(event-type "Event")
(message$ ?state)
(time ?time)
(identifier ?identifier)
)
?update <- (state-update (time ?time1) (state ?state1))
=>
(modify ?update (time ?time) (state ?state))
(retract ?signpost)
(bind ?duration (- ?time ?time1))
(assert (state-interval (start ?time1) (duration ?duration) (state ?state1)))
(log-narrative "Paired between %string% and %string%" ?state1 ?state)
)
(defrule RECORDER::record-reason-interval
(table (table-id ?output) (side append))
(table-attribute (table-id ?output) (has schema reason-interval))
?interval <- (state-interval (start ?start) (duration ?duration) (state ?state))
=>
(create-new-row ?output)
(set-column start ?start)
(set-column duration ?duration)
(set-column state ?state)
(set-column-narrative "recording for %start-time%, %string%" ?start ?state)
(retract ?interval)
)I'm curious as to how I could have better iterated on this in the CLIPS IDE & also if there's a better way I could have done this?