| | |
Anyone familiar with Jess?
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2006
Posts: 2
Reputation:
Solved Threads: 0
Hello to all!
I've been parusing this site for awhile now, must say that its very helpful for tips and learning about coding in general.
Anyways, here is my first foray into posting and of course, it begins with a question.
I have to emulate a blood bank in Jess and i'm running into some problems with the output. Here's what I have so far:
I'm having major problems understanding what's going on because our professor's material on Jess is quite sparse and useless. I can get the facts to load properly, but for some reason it's not printing out who is compatible with who based on blood type.
Any help would be great!
- Indy
I've been parusing this site for awhile now, must say that its very helpful for tips and learning about coding in general.
Anyways, here is my first foray into posting and of course, it begins with a question.
I have to emulate a blood bank in Jess and i'm running into some problems with the output. Here's what I have so far:
(deftemplate person "the person template"
(slot name)
(slot blood)
)
(deftemplate blood "the blood type template"
(slot kind)
(slot is-compatible-with)
(slot not-compatible)
)
(deffacts blood-bank-clients
(person (name John)(blood O))
(person (name Paul)(blood A))
(person (name George)(blood B))
(person (name Ringo)(blood AB))
(blood (kind O) (is-compatible-with O)
(kind O)(not-compatible A)
(kind O)(not-compatible B)
(kind O)(not-compatible AB) )
(blood (kind A) (is-compatible-with O)
(kind O)(is-compatible-with A)
(kind A)(not-compatible B)
(kind A)(not-compatible AB) )
(blood (kind B) (is-compatible-with O)
(kind B)(is-compatible-with B)
(kind B)(not-compatible A)
(kind B)(not-compatible AB) )
(blood (kind AB) (is-compatible-with O)
(kind AB)(is-compatible-with A)
(kind AB)(is-compatible-with B)
(kind AB)(is-compatible-with AB) )
)
(defrule compatible
(person (name ?person1) (blood ?kind1))
(person (name ?person2) (blood ?kind2))
(blood (kind ?kind1) (is-compatible-with ?kind2))
=>
(assert (compatible ?person1 ?person2))
)
(defrule match
(compatible ?person1 ?person2)
(compatible ?person2 ?person1)
(test (neq ?person1 ?person2))
=>
(printout t " is compatible with " ?person1 " to " ?person2 crlf)
)Any help would be great!
- Indy
Last edited by Indymaestro; Nov 29th, 2006 at 7:24 pm.
Welcome out of the world of the lurkers and into the world of the posters! Never heard of Jess but kinda looks like scheme to me.
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
![]() |
Similar Threads
- Good books on Shell Programming/Perl (Perl)
- learning php (PHP)
- I need to read a website. familiar with CA infogetter ?? (C)
- Familiar with language translation & artificial intelligent? (C#)
- Anyone familiar with Website tonight? (Site Layout and Usability)
- Add Familiar Icons Back to Your Desktop (Windows tips 'n' tweaks)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Prolog permutation
- Next Thread: float 2 binary help
Views: 2118 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Legacy and Other Languages






