(speculate (event-horizon ?end)) only firing for one defrule

I've got two CLIPS files imported in the instrpkg as follows:


<production-system>
        <rule-path>reasonForWaitingToPlay.clp</rule-path>
        <rule-path>timeControlStatus.clp</rule-path>
</production-system>


All the rules in there are working fine, I've just added a 'speculate' defrule in each, for some reason only one will fire. If I comment it out, then the other one works:


(defrule RECORDER::speculatively-record-reasonForWaitingToPlay-interval
    (speculate (event-horizon ?end))
    (table (table-id ?output) (side append))
    (table-attribute (table-id ?output) (has schema reason-for-waiting-to-play-interval))
    (reasonForWaitingToPlay-update (time ?start) (state ?state))
    =>
    (bind ?duration (- ?end ?start))
    (create-new-row ?output)
    (set-column start ?start)
    (set-column duration ?duration)
    (set-column state ?state)
    (set-column-narrative "recording reasonForWaitingToPlay for %start-time%, %string%" ?start ?state)
)
(defrule RECORDER::speculatively-record-timeControlStatus-interval
    (speculate (event-horizon ?end))
    (table (table-id ?output) (side append))
    (table-attribute (table-id ?output) (has schema time-control-status-interval))
    (timeControlStatus-update (time ?start) (state ?state))
    =>
    (bind ?duration (- ?end ?start))
    (create-new-row ?output)
    (set-column start ?start)
    (set-column duration ?duration)
    (set-column state ?state)
    (set-column-narrative "recording timeControlStatus for %start-time%, %string%" ?start ?state)
)


Looking at the examples, it seems like it should be possible for them to co-exist.

Accepted Reply

Hmm, oddly it turned out to be an issue with the set-column-narrative. Removing that from both fixed it.

Replies

Hmm, oddly it turned out to be an issue with the set-column-narrative. Removing that from both fixed it.

Yes. (set-column-narrative <col> <format> <args>) you had forgotten the column name. There should be an error waiting for you in your modeler's console. Was it not there?