Jonathan,

I have to ask you a trivial question:

Did you run (run) ?

defrule defines how to modify facts, but IT does not modify until you execute (run) command from the prompt.

Otherwise show us trace of execution.

BTW, If you want to modify duration only you do not need to pattern match (into variables) other slots, eg this would be sufficient (and it is easier to read what you want to match):

(defrule aax
    ?aax <- (farming-cattle (breed "AAX") (duration 0))
    =>
    (modify ?aax (duration 5)))

Dusan Sormaz

At 08:40 PM 2/15/2007, you wrote:
Just wondered what's wrong with this? I have a deftemplate and then I
assert a fact (f-1) which is below. Then I have a defrule to modify the
fact but it doesn't do anything!

f-1   (MAIN::farming-cattle (management_tag "111") (official_tag "222")
(breed "AAX") (sex "female") (dob "2006-10-10") (age 4) (comment "")
(location "cloffrickford") (weight 400) (duration 0))

(defrule aax
    ?aax <- (farming-cattle (management_tag ?m)(official_tag ?o)(breed
"AAX")(sex ?s)(dob ?dob)(age ?a)(comment ?c)(location ?l)(weight
?w)(duration 0))
    =>
    (modify ?aax (duration 5)))

I get no errors but duration stays at 0. Thanks.



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

*********************************************************************
* Dusan Sormaz PhD, Associate Professor
* Ohio University
* Industrial and Manufacturing Systems Engineering Department
* 277 Stocker Center, Athens, OH 45701-2979
* phone: (740) 593-1545
* fax:   (740) 593-0778
* e-mail: [EMAIL PROTECTED]
* url: <http://www.ent.ohiou.edu/~sormaz>http://www.ent.ohiou.edu/~sormaz
*********************************************************************

Reply via email to