Yes, rules can be manipulated at runtime.  The class org.drools.RuleBase has 
methods for adding Packages and removing Packages and individual rules, and can 
be called at runtime as demonstrated by Mark in this jira post:

https://jira.jboss.org/jira/browse/JBRULES-1431

I haven't tried it myself, but now that the subject has come up I probably 
will. :)

As for the best approach to do this, I'd suggest that you have your own rule 
representation that generates DRL, then compile that DRL in the standard way 
using the PackageBuilder.  On first blush it may seem best or more elegant to 
try creating Rule objects directly, circumventing the PackageBuilder, but 
that's a waste of time in my opinion. (The main focus for support from the 
drools team is the language and other "external" parts of the system.)

So, how will agents interact in your system?  Will each have it's own rete 
network?  Or will several agents share a rete? 

--- On Sat, 8/22/09, Russ Abbott <[email protected]> wrote:

> From: Russ Abbott <[email protected]>
> Subject: Re: [rules-users] Using Drools for modeling with rule-driven agents
> To: "Greg Barton" <[email protected]>
> Cc: [email protected], "Antony W. Iorio" <[email protected]>, 
> "HusseinAbbass" <[email protected]>
> Date: Saturday, August 22, 2009, 10:15 PM
> That's a possibility. But the
> underlying capability comes first. Can we do it in Drools?
> Has anyone done it, and if so would you be willing to share
> your experience?
> 
> -- Russ
> 
> 
> 
> On Sat, Aug 22, 2009 at 6:50 PM,
> Greg Barton <[email protected]>
> wrote:
> 
> 
> This wouldn't happen to involve evolutionary pressures
> altering rules, would it?
> 
> 
> 
> --- On Sat, 8/22/09, Russ Abbott <[email protected]>
> wrote:
> 
> 
> 
> > From: Russ Abbott <[email protected]>
> 
> > Subject: [rules-users] Using Drools for modeling with
> rule-driven agents
> 
> > To: [email protected]
> 
> > Cc: "Antony W. Iorio" <[email protected]>,
> "Abbass, Hussein" <[email protected]>
> 
> > Date: Saturday, August 22, 2009, 5:52 PM
> 
> >
> 
> > Hi,
> 
> >
> 
> > I'm interested in developing (if it doesn't
> already
> 
> > exist) and then using a framework for agent-based
> modeling
> 
> > in which the agents are rule driven. An important
> feature is
> 
> > that the agents and their rules must be dyanically
> 
> > manipulable. That is, both the agents and the rules
> must be
> 
> > first class objects that can be manipulated as the
> system is
> 
> > running. Can Drools support that?
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > As someone not familiar with Drools I did my best to
> find
> 
> > out by looking at the Drools
> 
> > Expert User's Manual. From what I could tell, the
> Template
> 
> > feature in which one uses Java objects as Template
> data
> 
> > sources comes close.  I'd like your advice
> before
> 
> > putting too much development effort into attempting to
> use
> 
> > it for that purpose.
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > In particular, would it be possible to set up a
> mechanism
> 
> > that could: create and delete agents on the fly;
> associate
> 
> > rule sets with agents on the fly; and modify the
> rules
> 
> > associated with an agent on the fly?  After each
> such
> 
> > action the system would change to reflect the change
> in
> 
> > agents and rules.
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > Thanks for your help.
> 
> >
> 
> > -- Russ Abbott
> 
> >
> 
> > P.S. If Drools would not be a good choice, is there
> some
> 
> > other system that you could recommend?
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > -----Inline Attachment Follows-----
> 
> >
> 
> > _______________________________________________
> 
> > rules-users mailing list
> 
> > [email protected]
> 
> > https://lists.jboss.org/mailman/listinfo/rules-users
> 
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


      

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to