On Wednesday 02 April 2003 15:10, [EMAIL PROTECTED] wrote: > I think Xavier Noria wrote: > > I'm reading Jess' manual to get an idea about how it works and > > whether it would be of interest in an agent-based simulation we are > > developing. > > You could also do a web search on "JADE and Jess" as many people have > already used Jess with that popular agent framework.
We are using RePast but I'll check it, maybe I learn things that do not depend on the framework. > > We are writing a prototype in Java, the idea is that Jess would be > > used to implement part of the behavior of agents somehow. > > Everything is new for me and don't see clearly if one can program > > this way: > > > > Market music = new Market(); > > // code that fills market with products, participants, etc. > > > > Consumer consumer = new Consumer(); > > consumer.setIncome(1500); > > > > Now fire a Jess rule on those instances like this > > > > if consumer's income is > 1200 then invoke > > invoke consumer.buyInMarket(music) > > You have lots of choices for implementing this, but one version of > this, making liberal assumptions, might look something like > > (bind ?consumer (new Consumer)) > (?consumer setIncome 1500) > (defclass consumer Consumer) I've seen examples like this in the manual, but unless I am wrong a new instance of the class Consumer is being created there, isn't it? The situation would be that objects _created in the Java-side of the application_ would be "used" in the rules, that includes method calls. In my example external objects were consumer and market. Since I don't know whether this is relevant, let's add the complexity that we are iterating over a collection of consumer agents in the Java code and firing that rule in each iteration. Could the corresponding Jess variables be instantiated with each corresponding JavaBean in each iteration? -- fxn -------------------------------------------------------------------- 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] --------------------------------------------------------------------