On Nov 15, 2007, at 6:48 AM, Mohd. Noor wrote:

dear jess
how to make a rule from this scenario

Computer A:
           CPu =100
           RAM = 1GB
           s/w = c++
Computer B:
          CPU =20
          RAM = 512M
          S/w =spps
Computer C
          CPU =12
          RAM = 2GB
          s/w = mathlab


OK, so we need to define what a computer is:

(deftemplate computer (slot name) (slot CPU) (slot RAM) (slot sw))

Then we need to tell Jess about the available computers:

(deffacts computers
    (computer (name A) (CPU 100) (RAM 1GB) (sw c++))
    (computer (name B) (CPU 20) (RAM 512MB) (sw spps))
    (computer (name C) (CPU 12) (RAM 2GB) (sw matlab)))

The user will request to run a software mathlab

So maybe they assert a fact like

(user-wants matlab)

- how do the rules look like


Given the above, you could write

(defrule recommend-computer
    (computer (name ?n) (sw ?s))
    (user-wants ?s)
    =>
(printout t "Your software " ?s " is available on computer " ?n crlf))

cHEERS

On Nov 15, 2007 11:44 AM, Mohd. Noor < [EMAIL PROTECTED]> wrote:
dear jess
how to make a rule from this scenario

Computer A:



---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

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