Hi all:
I am getting a strange error in my programming:
==========
Jess reported an error in routine modify
while executing (modify ?one (priority (- ?priority 10)))
while executing (if (> ?random 32768) then (modify ?two
(priority (- ?pr
iority 10))) (call ?logger rules (str-cat "dropping priority of \""
?t2 "\" to "
(- ?priority 1) " at the expense of \"" ?t1 "\"")) else (modify ?one
(priority
(- ?priority 10))) (call ?logger rules (str-cat "dropping priority of
\"" ?t1 "\
" to " (- ?priority 1) " at the expense of \"" ?t2 "\"")))
while executing defrule MAIN::among-equals.
Message: Fact object not in working memory (MAIN::candidate
(timestamp -30) (p
riority 0) (forward-centers race stakes) (conveys <Fact-8> <Fact-5>
<Fact-6> <Fa
ct-7> <Fact-10>) (text "text text text")).
at jess.FactList.modifyRegularFact(FactList.java:344)
at jess.FactList.modify(FactList.java:276)
at jess.Rete.modify(Rete.java:549)
at jess.Modify.call(Modify.java:35)
at jess.FunctionHolder.call(FunctionHolder.java:35)
at jess.Funcall.execute(Funcall.java:320)
at jess.FuncallValue.resolveValue(FuncallValue.java:29)
at jess.If.call(ControlFunctions.java:283)
at jess.FunctionHolder.call(FunctionHolder.java:35)
at jess.Funcall.execute(Funcall.java:320)
at jess.Defrule.fire(Defrule.java:322)
at jess.Activation.fire(Activation.java:97)
at jess.Agenda.run(Agenda.java:280)
at jess.Agenda.run(Agenda.java:256)
at jess.Rete.run(Rete.java:1505)
at jess.Rete.run(Rete.java:1500)
at de.dfki.racereporter.jess.JessThread.runJess(JessThread.java:95)
at
de.dfki.racereporter.jess.JessThread.processQueue(JessThread.java:163
)
at de.dfki.racereporter.jess.JessThread.run(JessThread.java:128)
at java.lang.Thread.run(Unknown Source)
Jess reported an error in routine modify
while executing (modify ?one (priority (- ?priority 10)))
while executing (if (> ?random 32768) then (modify ?two
(priority (- ?pr
iority 10))) (call ?logger rules (str-cat "dropping priority of \""
?t2 "\" to "
(- ?priority 1) " at the expense of \"" ?t1 "\"")) else (modify ?one
(priority
(- ?priority 10))) (call ?logger rules (str-cat "dropping priority of
\"" ?t1 "\
" to " (- ?priority 1) " at the expense of \"" ?t2 "\"")))
while executing defrule MAIN::among-equals.
Message: Fact object not in working memory (MAIN::candidate
(timestamp -30) (p
riority 0) (forward-centers race stakes) (conveys <Fact-8> <Fact-5>
<Fact-6> <Fa
ct-7> <Fact-10>) (text "text text text")).
================
I have a number of (currently 3, but variable) Rete engines, each
running in its own thread, and passing facts to each other; the
passing is always in one direction and always asserts new facts. In
this case, the thread is receiving (say) facts and then processing:
=========
;; remove utterances that contain known information
(defrule remove-redundant
"Remove an utterance that conveys known information"
(known ?fact)
?candidate <- (candidate {priority > 0} (conveys
$?conveys&:(member$ ?fact $?conveys)) (text ?text))
=>
(bind ?logger (get-member de.dfki.racereporter.util.Logger log))
(?logger rules (str-cat "retracting \"" ?text "\" : redundant."))
(retract ?candidate)
)
;; if there's two utterances of equal priority, randomly lower the
priority of one
(defrule among-equals
"Randomly select one utterance of a pair of equal-priority ones"
;(declare (salience -50))
(time ?t)
?one <- (candidate (timestamp ?t) {priority > 0} (text ?t1))
?two <- (candidate (timestamp ?t) {priority > 0} (text ?t2))
(test (neq ?one ?two))
=>
(bind ?random (random))
(bind ?logger (get-member de.dfki.racereporter.util.Logger log))
(if (> ?random 32768) then
(modify ?two (priority (- ?priority 10)))
(?logger rules (str-cat "dropping priority of \"" ?t2 "\" to
" (- ?priority 1) " at the expense of \"" ?t1 "\""))
else
(modify ?one (priority (- ?priority 10)))
(?logger rules (str-cat "dropping priority of \"" ?t1 "\" to
" (- ?priority 1) " at the expense of \"" ?t2 "\""))
)
)
=========
I'm a little perplexed by why the facts aren't in working memory! Any
suggestions would be most appreciated.
Martin
(p.s. please CC replies to me, I'm not subscribed to this list.)
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------