I have several rules held in different files which I batch at different
places in the main code and yes it turned out I was missing something as
trivial as a second (run). I ended up having to swap some batches around
and use (run) after each batch to make the changes I needed. Sorry for the
silly question. I assumed it was me that was doing something wrong rather
than simply missing a (run). Never used modify before so thought I would
ask. Thank-you.

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




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