aspose file tools*
The moose likes Beginning Java and the fly likes Jess Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jess Query" Watch "Jess Query" New topic
Author

Jess Query

Jonathan Goode
Greenhorn

Joined: Dec 01, 2005
Posts: 12
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 ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

Let's go talk about this in the Other Java Products and Servers forum. I'm going to move this thread there; come find it and we'll continue the discussion.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jess Query