Distributed Drools

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Distributed Drools

Daniel Souza
Hi all, I'm looking for some distributed solution available with drools. I want to create a distributed Multi-agent architecture for my project using a shared working memory.

Searching for solutions, I found the DJess and Octopus solution that use the Jess inference engine.
For Drools, I found this one: http://www.plugtree.com/making-a-non-persistent-ha-knowledge-session/
It seems that Kie is flexible enough to distribute the knowledge session in local ksessions, but I think that the ha-ksession doesn't provide a shared working memory to different kbases. Seeing the sample project, there's just one rule set (drl) with only one rule. I can use as a sample model to do what I want to do. This project showed me how I can extend the Kie and implement my own.
I'm not familiar with Drools 6 yet, but I'm reading papers about distributed Rule-Based Systems concerning Multi-Agent Systems solutions and I didn't find any solution using Drools. The majority solutions were provided using a shared working memory with local copies.

Than, it gives me a question: is it possible to create a shared working memory with Drools?

To refresh What I mean, there's an old paper showing differences between Blackboard Systems and Rule-Based Systems (see Figure 1).



In Figure 1, the Blackboard is a shared working memory to insert facts, where each knowledge source (KS) is activated according with the facts inserted. Each KS is a specific expert with your own rules set that look for the blackboard to produce partial solutions that can be seen as new facts to be inserted in the blackboard. These partial solutions can activate more KS to produce new partial solutions until the final solution be reached. In contrast, in production systems, we build a knowledge base with a set o rules that can be activated according with facts inserted in a local working memory (there's no shared working memory between others kbases with their own rules set).

In DJess, the authors introduce a model for distributing rule-based inference systems called Web of Inference Systems (WoIS). Each member of WoIS is composed of an inference system (IS) and a rule base, while all ISs operate on a single Shared Working Memory (SWM). WoIS is controlled by a dedicated
component called manager (M). Each IS holds a copy of a part of the SWM in its local working memory, while all ISs run independently in parallel. This model was utilized to implement a distributed version of Jess called DJess. Synchronization between interfering rules is achieved by means of shadow facts and ghost facts. A shadow fact is a Jess fact linked to a Java bean object. Each shared fact is implemented as a shadow fact, and thus an associated Java bean object is created. All the proxies corresponding to the same shared fact are linked together by means of a Java remote object called ghost fact. Access of the ISs to the ghost facts are synchronized by acquiring locks during the transition from the conflict resolution stage to the act stage of an inference cycle.

If not were done yet, I want to implement my own approach using Drools. I don't know if I can reach the final solution using Drools, but it seems the the Kie is flexible enough to be extend and I implement something. I'm planning to use the FIPA Subscribe protocol to synchronize the Shared Working Memory with a local working memory for each agent.

"The FIPA Subscribe Interaction Protocol (IP) allows an agent to request a receiving agent to perform an action on subscription and subsequently when the referenced object changes"

Regards,
Daniel Souza
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

Davide Sottara
Daniel, this is a really timely message.
In the past, we did an initial experiment, creating a drools-5.x
based agent compatible with the FIPA spec.
The code is here
https://github.com/droolsjbpm/drools-mas

We are now planning to migrate to 6.x/KIE, probably over summer.
We may want to join efforts.
I'm bcc-ing Mauricio and Esteban, who worked on the initial implementation,
and of course Mark who may provide more information.

As far as I know, there is some independent work going on
regarding the creation of an "execution container". I don't know the specs,
but maybe it could also be exploited as an underlying platform.

We may try to arrange a moment to get together, in IRC or hangout.

I am definitely interested in seeing this move forward
Best
Davide


On 04/23/2014 04:53 PM, Daniel Souza wrote:

> Hi all, I'm looking for some distributed solution available with drools. I
> want to create a distributed Multi-agent architecture for my project using a
> shared working memory.
>
> Searching for solutions, I found the DJess and Octopus solution that use the
> Jess inference engine.
> For Drools, I found this one:
> http://www.plugtree.com/making-a-non-persistent-ha-knowledge-session/
> It seems that Kie is flexible enough to distribute the knowledge session in
> local ksessions, but I think that the ha-ksession doesn't provide a shared
> working memory to different kbases. Seeing the sample project, there's just
> one rule set (drl) with only one rule. I can use as a sample model to do
> what I want to do. This project showed me how I can extend the Kie and
> implement my own.
> I'm not familiar with Drools 6 yet, but I'm reading papers about distributed
> Rule-Based Systems concerning Multi-Agent Systems solutions and I didn't
> find any solution using Drools. The majority solutions were provided using a
> shared working memory with local copies.
>
> *Than, it gives me a question: is it possible to create a shared working
> memory with Drools?*
>
> To refresh What I mean, there's an old paper showing differences between
> Blackboard Systems and Rule-Based Systems (see Figure 1).
>
> <http://drools.46999.n3.nabble.com/file/n4029338/production_systems_vs_blackboard_systems.png>
>
> In Figure 1, the Blackboard is a shared working memory to insert facts,
> where each knowledge source (KS) is activated according with the facts
> inserted. Each KS is a specific expert with your own rules set that look for
> the blackboard to produce partial solutions that can be seen as new facts to
> be inserted in the blackboard. These partial solutions can activate more KS
> to produce new partial solutions until the final solution be reached. In
> contrast, in production systems, we build a knowledge base with a set o
> rules that can be activated according with facts inserted in a local working
> memory (there's no shared working memory between others kbases with their
> own rules set).
>
> In DJess, the authors introduce a model for distributing rule-based
> inference systems called Web of Inference Systems (WoIS). Each member of
> WoIS is composed of an inference system (IS) and a rule base, while all ISs
> operate on a single Shared Working Memory (SWM). WoIS is controlled by a
> dedicated
> component called manager (M). Each IS holds a copy of a part of the SWM in
> its local working memory, while all ISs run independently in parallel. This
> model was utilized to implement a distributed version of Jess called DJess.
> Synchronization between interfering rules is achieved by means of shadow
> facts and ghost facts. A shadow fact is a Jess fact linked to a Java bean
> object. Each shared fact is implemented as a shadow fact, and thus an
> associated Java bean object is created. All the proxies corresponding to the
> same shared fact are linked together by means of a Java remote object called
> ghost fact. Access of the ISs to the ghost facts are synchronized by
> acquiring locks during the transition from the conflict resolution stage to
> the act stage of an inference cycle.
>
> If not were done yet, I want to implement my own approach using Drools. I
> don't know if I can reach the final solution using Drools, but it seems the
> the Kie is flexible enough to be extend and I implement something. I'm
> planning to use the FIPA Subscribe protocol to synchronize the Shared
> Working Memory with a local working memory for each agent.
>
> "The FIPA Subscribe Interaction Protocol (IP) allows an agent to request a
> receiving agent to perform an action on subscription and subsequently when
> the referenced object changes"
> <http://fipa.org/specs/fipa00035/SC00035H.html>  
>
> Regards,
> Daniel Souza
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

Daniel Souza
Hy Davide, thanks for reply.
I was planning to do this on top of JADE framework and my deadline is to finish this architecture in July.
I have a hard work to do in a little time, because it will be used for me to build the agents' knowledge in my specific application and reused for another person, merging the knowledge used by another multi-agent project. Our projects is very similar. We used the biologists knowledge simulated in a multi-agent environment to support a specific step done in genome projects.

However, I can try to run the drools-mas and see how it works. There is a paper (2011) published in Rule-ML that explain the role of rules applied in multi-agent systems, explained in different agent architectures (reactive, hybrid and deliberative).

First of all, I need to talk to my advisor, because it's a MSc work. I have only this year to conclude my work. I will read the drools-mas sources and try to run the samples.

I usually use the hangout: dssouzadan@gmail.com. We can talk there. By the way, I will try to create a shared working memory using Drools.

Regards,
Daniel Souza
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

profversaggi
Hi Daniel,

Do you happen to have a URL top that paper you referenced ... it sounds like a good read.

-matt



On Wed, Apr 23, 2014 at 8:53 PM, Daniel Souza <[hidden email]> wrote:
Hy Davide, thanks for reply.
I was planning to do this on top of JADE framework and my deadline is to
finish this architecture in July.
I have a hard work to do in a little time, because it will be used for me to
build the agents' knowledge in my specific application and reused for
another person, merging the knowledge used by another multi-agent project.
Our projects is very similar. We used the biologists knowledge simulated in
a multi-agent environment to support a specific step done in genome
projects.

However, I can try to run the drools-mas and see how it works. There is a
paper (2011) published in Rule-ML that explain the role of rules applied in
multi-agent systems, explained in different agent architectures (reactive,
hybrid and deliberative).

First of all, I need to talk to my advisor, because it's a MSc work. I have
only this year to conclude my work. I will read the drools-mas sources and
try to run the samples.

I usually use the hangout: [hidden email]. We can talk there. By the
way, I will try to create a shared working memory using Drools.

Regards,
Daniel Souza



--
View this message in context: http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338p4029340.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
#########################################################
Matthew R. Versaggi, President & CEO
Versaggi Information Systems, Inc.
Adjunct Professor of eBusiness DePaul University
Email: mailto:[hidden email], [hidden email]
M: 630-292-8422 
LinkedIn:  http://www.linkedin.com/in/versaggi
About Me: http://www.matt-versaggi.com/resume/
#########################################################

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

Daniel Souza
Hi Matt,

This is the paper url available free from google: Rule-based Distributed and Agent Systems

It's around 27 pages.

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

Esteban
Matthew, regarding drools-mas, I would use this other repo: https://github.com/SocraticGrid/drools-mas . I did some changes there that are not present in droolsjbpm's one (I have to merge them back). 
I do think, though, that drools-mas is (currently) more suitable for a multi-agent scenario where each of the agents has a private and local working memory that is not shared among the others. drools-mas uses FIPA messages to handle the communication between the agents, but no real shared working memory is never used. Previous implementation of drools-mas used drools-grid to try to do something like this (distributed working memories), but this implementation was discarded after drools-grid was discontinued (it actually never passed the incubation period).

Regards, 


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Thu, Apr 24, 2014 at 4:39 AM, Daniel Souza <[hidden email]> wrote:
Hi Matt,

This is the paper url available free from google:  Rule-based Distributed
and Agent Systems
<http://vsis-www.informatik.uni-hamburg.de/getDoc.php/publications/431/intro.pdf>
It's around 27 pages.

Daniel



--
View this message in context: http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338p4029342.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

salaboy
Daniel, that sounds as a really good project, as Esteban and Davide mention we should work together to at least share experiences and cons and pros over the two different implementations (drools only vs jade + drools). 
Keep us posted about your progress!


On Thu, Apr 24, 2014 at 8:07 AM, Esteban Aliverti <[hidden email]> wrote:
Matthew, regarding drools-mas, I would use this other repo: https://github.com/SocraticGrid/drools-mas . I did some changes there that are not present in droolsjbpm's one (I have to merge them back). 
I do think, though, that drools-mas is (currently) more suitable for a multi-agent scenario where each of the agents has a private and local working memory that is not shared among the others. drools-mas uses FIPA messages to handle the communication between the agents, but no real shared working memory is never used. Previous implementation of drools-mas used drools-grid to try to do something like this (distributed working memories), but this implementation was discarded after drools-grid was discontinued (it actually never passed the incubation period).

Regards, 


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Thu, Apr 24, 2014 at 4:39 AM, Daniel Souza <[hidden email]> wrote:
Hi Matt,

This is the paper url available free from google:  Rule-based Distributed
and Agent Systems
<http://vsis-www.informatik.uni-hamburg.de/getDoc.php/publications/431/intro.pdf>
It's around 27 pages.

Daniel



--
View this message in context: http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338p4029342.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


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



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Distributed Drools

Daniel Souza
This post was updated on .
Hi Salaboy, It's ok.
I'm starting to think in some initial possibilities, but I don't know if I can reach a good reliability in cases which some agent crashes and if I can ensure persistence.

For now, I'm studying more the code for distributed CEP approach and how they extended the drools classes using the Kie. They used the JMS to exchange message between a centralized ksession and its nodes. In this part I can use the JADE ACLMessage class and use a subscription protocol to notify changes.

I'm planning to advance by trial and error creating some samples to clarify me what to do after, because I'm newbie looking inside drools sources.

Regards,
Daniel Souza