Re: JESS: Logical dependency bug?
I'd call that a bug, yes. Thanks. I think Yura wrote: Don't know whether it's a bug but after (deffunction fun () (assert (b 2))) (defrule rule (logical (a))=(assert (b 1))) (defrule rule2 (logical (a))=(fun)) (assert (a)) (run) (retract 0) deletes only (a) and (b 1). (b 2) doesn't seem to have a logical dependency on (a). - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov 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]
JESS: change facts in a loop or something simmilar
Hello everybody, I am making an agent based model with RePast and Jess and I am a bit stuck with the following (maybe for just trivial) problem. I have 12 facts defined with (deftemplate stored (slot householdID) (slot amount) (slot age)) -- householdIDis the id of the household -- amount is the amount of crop stored in the storage container (household has 12 containers) -- ageis the age of the crop (i delete all crops which are older than 12) and one fact (feedStrategy ?householdID ?amount2eat ?resthunger) -- ?householdIDis the id of the household -- ?amount2eat is the amount of food a household will eat per cycle -- ?resthunger hunger for the next cycle (not relevant now) what I want is somehow to call all the facts from the template above and substract the amount in ?amount2eat from the slot amount. Don't think i described it well so here is an example fact 1: stored (householdID 1) (amount 4) (age 1) fact 2: stored (householdID 1) (amount 23) (age 2) ... ......... ... ... fact 11: stored (householdID 1) (amount 0) (age 11) fact 12: stored (householdID 1) (amount 8) (age 12) (feedStrategy 1 32 0) the total amount of the food the agents have to eat is 32. This should be substracted from the storage beginning with the oldest storage. I make sure before this point of time that the amount2eat is smaller than the amount stored facts all together. Cann i somehow change these 12 facts in a loop? -- Bogdan Werth Doctoral Researcher Centre for Policy Modelling The Graduate School of Business Aytoun Building Aytoun Street Manchester M1 3GH UK Tel: +44 161 247 6481 Fax: +44 161 247 6802 Email: [EMAIL PROTECTED] Web: http://cfpm.org/~bogdan ** Before acting on this email or opening any attachments you should read the Manchester Metropolitan University's email disclaimer available on its website http://www.mmu.ac.uk/emaildisclaimer *** 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]
JESS: Re: Java Date in JESS
Hello, Is there a convenient way to express rules on Java Date attributes in shadow facts? Or is it advisable to convert all dates to integers (i.e. add a getter that returns the same date in milliseconds or seconds)? More specifically, I want to fire a rule under some conditions, one of them being that the timestamp in the object is older than a given number of minutes found in another fact. I have a shadow fact for a Java object that is updated with the current time every minute. I could just convert the dates to milliseconds and compare from there, I just wondered if there is a more elegant way to deal with dates. Regards, Florian Fischer. 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]