Just to be sure, since I need backtracking for my algorithm, too, I want to confirm my understanding that there is no generalized undo function for Jess. That is, e.g., there's no built-in, general way to undo the effects of an RHS firing. That right? As you might know by now, I use bsave-bload for backtracking, but I appreciate other suggestions (like this one). Thanks again,

Jonathan

Jason Morris wrote:
Hi Nan,

On 3/6/06, Nan <[EMAIL PROTECTED]> wrote:
During the questioning session, the user may change
his/her mind to a question. What is the best way to deal with that situation?

Recall that rule activations in Jess can be retracted if new facts
appear that logically contradict the actively matched patterns in the
current engine cycle.  Therefore, one simple solution would be to
provide an "interrupt" or "change answer" function that:

(1) Allows a user to interrupt the current process (if one is running
and/or a break is needed),
(2) Reverts the application to its last known stable state via an Undo
function call (if necessary)
(3) Selects a previous answer, and
(4) Re-answers the corresponding question (subsequently asserting new
facts and causing new activations and retractions).
(5) Runs the rule engine on the new fact(s).

This function can be offered as a command line option.  For example,
if all your questions were, for sake of argument, of the form (yes |
no), then you could have a command line prompt like the following:

cyberES:> Q. 34 - Do you like to dance? (y = yes | n = no | b = back-up)
cyberES:> b  [Enter]
cyberES:> Enter the question number to re-answer: (l = list all questions)
cyberES:> 32 [Enter]
cyberES:> Q. 32 - Do you like spicy food? (y = yes | n = no | b = back-up)
cyberES:> no [Enter]
cyberES:> Q. 32 changed from "yes" to "no".  Continuing...
cyberES:> Q. 34 - Do you like to dance? (y = yes | n = no | b = back-up)

Of course, this is all easy to do with your favorite GUI builder, too.

Cheers,
Jason

-----------------------------------------------------
Morris Technical Solutions LLC
www.morristechnicalsolutions.com
[EMAIL PROTECTED]
phone/fax: 503.692.1088

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to