Hi,
I need to write a rule which iterates on 2 sets of facts of different
templates,
below the code
(defrule Compute-Queries-Weights
(declare (no-loop TRUE))
?I <- (Interaction (name ?Iname) (queries $?Iqueries) (w-browsing ?Iwb)
(w-shopping ?Iws) (w-ordering ?Iwo))
(test (<> (length$ $?Iqueries) 0))
?Q <-(Query (name ?Qname) (w-browsing ?Qwb) (w-shopping ?Qws) (w-ordering
?Qwo))
(test (member$ ?Qname $?Iqueries))
=>
(printout t ?Iname " " ?Qname crlf)
(modify ?Q (w-browsing (+ ?Qwb ?Iwb)) (w-shopping (+ ?Qws ?Iws))
(w-ordering (+ ?Qwo ?Iwo)))
)
the problem is the following,
without (declare (no-loop TRUE)) there'is a loop on one combination
and with (declare (no-loop TRUE)) once used a fact query is not used again
in the problem specification a fact 'query' belongs to many facts
'intercation' and needs to be updated from all of them,
thanks and happy new year
--
View this message in context:
http://www.nabble.com/iterations-tf2898209.html#a8097199
Sent from the Jess mailing list archive at Nabble.com.
--------------------------------------------------------------------
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]
--------------------------------------------------------------------