Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jess Question

 
Ranch Hand
Posts: 492
Firefox Browser VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Do not threaten THIS beaver! Not even with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic