i am creating a simple online personal trainer and have used the example from the JESS in action book help me, but i am having problem running it, this is the code:

(deffacts question-data
"The questions the system can ask."
(question (ident male) (type (yes-no)
(text "Are you male?"))
(question (ident female) (type (yes-no)
(text "Are you female?"))
(question (ident pregnant) (type (yes-no)
(text "Are you pregnant?"))
(question (ident more6) (type (yes-no)
(text "Are you more than 6 months?"))
(question (ident meds) (type (yes-no)
(text "Any medical problem including history?"))
(question (ident heart) (type (yes-no)
(text "Any history to do with the Heart?"))
(question (ident chestpain) (type (yes-no)
(text "History of Chest Pain?"))
(question (ident stroke) (type (yes-no)
(text "History of Stroke?"))
(question (ident epilepsy) (type (yes-no)
(text "History of Epilepsy?"))
(question (ident diabetes) (type (yes-no)
(text "History of Diabetes?"))
(question (ident bloodpressure) (type (yes-no)
(text "History of problems with Blood Pressure?"))
(question (ident medication) (type (yes-no)
(text "Are you taking any Medication?"))
(question (ident painkillers) (type (yes-no)
(text "Are you taking Pain Killers?"))
(question (ident othermedication) (type (yes-no)
(text "Are you taking other Medication?"))
(question (ident diet) (type (yes-no)
(text "Are you on a Diet?"))
(question (ident fooddiet) (type (yes-no)
(text "Are you on a Food Diet?"))
(question (ident exercisediet) (type (yes-no)
(text "Are you on an Exercise Diet?"))
(question (ident exercising) (type (yes-no)
(text "Are you currently exercising?"))
(question (ident legs) (type (yes-no)
(text "Do you exercise your Legs?"))
(question (ident body) (type (yes-no)
(text "Do you exercise your Body?"))
(question (ident arms) (type (yes-no)
(text "Do you exercise your Arms?"))
(question (ident loseweight) (type (yes-no)
(text "Do you want to Lose Weight?"))
(question (ident toneup) (type (yes-no)
(text "Do you want to Tone Up?"))
(question (ident gainstrength) (type (yes-no)
(text "Do you want to Gain Strength?"))
(question (ident increasestamina) (type (yes-no)
(text "Do you want to increase your stamina and cardiovascular performance?")))

(defmodule interview)

(defrule request-male
=>
(assert (ask male)))

(defrule request-female
=>
(assert (ask female)))

(defrule request-pregnant
=>
(assert (ask pregnant)))

(defrule request-more6
=>
(assert (ask more6)))

(defrule request-meds
=>
(assert (ask meds)))

(defrule request-heart
=>
(assert (ask-heart)))

(defrule request-chestpain
=>
(assert (ask-chestpain)))

(defrule request-stroke
=>
(assert (ask-stroke)))

(defrule request-epilepsy
=>
(assert (ask-epilepsy)))

(defrule request-diabetes
=>
(assert (ask-diabetes)))

(defrule request-bloodpressure
=>
(assert (ask-bloodpressure)))

(defrule request-medication
=>
(assert (ask-medication)))

(defrule request-painkillers
=>
(assert (ask-painkillers)))

(defrule request-othermedication
=>
(assert (ask-othermedication)))

(defrule request-diet
=>
(assert (ask-diet)))

(defrule request-fooddiet
=>
(assert (ask-fooddiet)))

(defrule request-exercisediet
=>
(assert (ask-exercisediet)))

(defrule request-exercise
=>
(assert (ask-exercise)))

(defrule request-legs
=>
(assert (ask-legs)))

(defrule request-body
=>
(assert (ask-body)))

(defrule request-arms
=>
(assert (ask-arms)))

(defrule (request-loseweight
=>
(assert (ask-loseweight)))

(defrule (request-toneup
=>
(assert (ask-toneup)))

(defrule (request-gainstrength
=>
(assert (ask-gainstrength)))

(defrule (request-increasestamina
=>
(assert (ask-increasestamina)))

(defmodule recommend)

(defrule loseweight
        (answer (ident male) (text yes))
        (answer (ident meds) (text yes))
        (answer (ident heart) (text no))
        (answer (ident chestpain) (text no))
        (answer (ident stroke) (text no))
        (answer (ident epilepsy) (text yes))
        (answer (ident diabetes) (text no))
        (answer (ident bloodpressure) (text no))
        (answer (ident medication) (text no))
        (answer (ident diet) (text no))
        (answer (ident exercising) (text no))
        (answer (ident loseweight) (text no))
        (answer (ident tone up) (text yes))
        =>
        (assert (recommendation
(You want to tone up, please see your doctor for medical advise to exercise because of your condition) (Day 1 = warm up and gentle stretching, 15mins on treadmill, easy walking pace, 10mins cycling on the bike and 10mins of easystepping on the stepper. This should be repeated for 2day then rest for 1 day, again exercise for 2 days and then rest for 2days. Please see the website for a rough estimate of what your heart rate should be))))

(defrule pregnant6
        (answer (ident male) (text no))
        (answer (ident female) (text yes))
        (answer (ident pregnant) (text yes))
        (answer (ident more6) (text (yes))
        =>
        (assert (recommendation
        (We do not advise you to exercise in your condition)
        (Please see your doctor for more advise))))

(defrule pregnant0
        (answer (ident male) (text no))
        (answer (ident female) (text yes))
        (answer (ident pregnant) (text yes))
        (answer (ident more6) (text no))
        =>
        (assert (recommendation
(As of your conditition, there are a few things to consider when doing any type of exercising) (Avoid exercising flat on your back for a long time, it may reduce the blood flow to your heart. Check heart rate at each session to make sure everything is ok....it is about 140 beats per minute. Any experince of discomfort stop exercisinf immediately. You should be doing exercises like cycling (non-moving bike), playing golf, swimming, yoga, walking. All these exercises should be done regular, about 3 times a week and a warm up and stretch should be done before hand.))))

(defrule toneup
        (answer (ident male) (text yes))
        (answer (ident meds) (text no))
        (answer (ident diet) (text yes))
        (answer (ident fooddiet) (text yes))
        (answer (ident exercisediet) (text yes))
        (answer (ident legs) (text no))
        (answer (ident body) (text yes))
        (answer (ident body) (text yes))
        (answer (ident loseweight) (text no))
        (answer (ident tone up) (text yes))
        =>
        (assert (recommendation
(You would like to tone up and are currently partaking in exercise for your body and arm) (Always warm up and stretch before exercising. For your stomach do 8-10 reps of crunches, situps and side bends. Complete 10 mins of medium rowing and 25mins of running on the treadmill. Do 12 squats and 12 chinups. Do these regular 3 times a week for a month, then increase to 4 times a week. To also increase yourself, check your ideal heart rate on the website and make sure you keep in that range.))))

(defrule gainstrength
        (answer (ident male) (text no))
        (answer (ident female) (text yes))
        (answer (ident pregnant) (text no))
        (answer (ident meds) (text no))
        (answer (ident diet) (text no))
        (answer (ident exercising) (text no))
        (answer (ident loseweight) (text no))
        (answer (ident toneup) (text no))
        (answer (ident gainstrength) (text yes))
        =>
        (assert (recommendation
        (You would like to gain strength and have not exercised recently)
(Start off slowly and relaxed, Circuit training would be good to start with cardio circuit, which takes place on a Monday and Thursday. Along with this on those days, complete 8-10 reps of bench presses, leg presses, chest press and sit ups. Do this for 2 months regular and you will definately see an improverment. You can also see your ideal heart rate range on the website.))))

(deffunction run-system ()
        (reset)
        (focus startup interview recommend report)
        (run))
(while TRUE
        (run-system))



some one please help!!!

thanx!!
kusum

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