Basically I wondered if someone could help me with a problem I have as I'm new to Jess and unsure of what to do - as a University assessment I must implement a set of rules (listed on this site http://www.patient.co.uk/showdoc/23069022) using Jess. So far I'm doing Ok and have written my rules but when it comes to creating a function which asks a question such as "How old are you?" and then getting Jess to compare the integer entered with the criteria specified in my rule(s) I'm stumped. I've tried using (assert (age (read))) where age is specified in a template then linking to the rule with phase but to no avail. Here is my first rule: (defrule eligibility-rule1 (Patient (rule ?rule) (age ?age& < ?age 16))) => (printout t "You are eligible for free prescriptions. (Rule: " ?rule ")" crlf) )
Here is the beginning of my first function: (deffunction under-16 () (printout t "How old are you?") (assert (age (read))))
Hopefully I'm making sense. Thanks in advance.
[ December 01, 2005: Message edited by: Jonathan Goode ]
[ December 01, 2005: Message edited by: Jonathan Goode ] [ December 01, 2005: Message edited by: Jonathan Goode ]