• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jess Question

 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am working on a Jess application to advise users on which programming language to use. I wanted to ask the questions in a specific order and was wondering if that was possible without adding some condition to the rules.

Right now to get them to fire in the order i want I have to do this:



I was wondering is there was a better way of doing this.

Thanks.
Hunter.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there is a specific order in which you want to ask a set of questions, then that order has to be encoded somehow. This is one way to do it. Another way would be just to keep an explicit list of the questions in the order in which you want to ask them. Have a look at the "stack" example that comes with Jess, in which a bunch of rules all operate on a shared list structure. A third way would be to encode the dependencies as facts -- for example, each question fact might include a multislot holding the names of the questions that must be asked before it. Then the question-asking rule would just ask whatever questions had all their prerequisites met. I think I like that last one best.
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The third way you mentioned sounds like it will work perfectly for my program. Thank you for your response.

Hunter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic