Hi, I'm working on a school project using JESS 6.1 and using the "JESS in
action" as my manual.
I got 3 "gym-machine" facts, each with 2 slots they are "ident" and
"purpose"
I'm trying to write a rule that checks all 3 facts's "purpose" slot for the
existent of "arms-upperfront"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftemplate gym-station (slot ident) (multislot purpose))
(deffacts gym-station-data
(station (ident s1) (purpose arms-upperfront back))
(station (ident s2) (purpose legs abs))
(station (ident s3) (purpose abs shoulders arms-upperfront)))
(defrule detect-arms-upperfront
(gym-station (ident ?any) (purpose ?alist) )
=>
(if (member$ arms-upperfront ?alist) then
(printout t " Found arms-upperfront " ?any )
else
(printout t " None found " )))
(reset)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I'm having trouble at the defrule (gym-station (ident ?any)
it seems I can't use ?any to represent all 3 facts. I'm trying to get the
rule to cycle through all 3 facts. I have try to remove (ident ?any) but it
still wont cycle through the 3 facts. Please help me, am I writing it the
wrong way?
Thank you very much for your time
Rick
--
View this message in context:
http://www.nabble.com/Compare-the-2nd-slot-of-all-facts-tf3401443.html#a9472201
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]
--------------------------------------------------------------------