JESS: Creating identical independent engines in Java

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

JESS: Creating identical independent engines in Java

Theodore Patkos
Hey all,

I was wondering if there is a way to make an exact, yet independent,
copy of a Rete engine's instance in Java (i.e., including the ruleset,
working memory, agenda, activation order etc).

Peering an engine only copies the ruleset; if, afterwards, one attempts
to copy each fact from the initial engine to the peer, apart from
matters of efficiency, there exists the possibility of activating rules
that have already been activated in the initial engine before the peering.

Thanx!
Theodore


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Creating identical independent engines in Java

Friedman-Hill, Ernest
You can use Rete.bsave() to write a copy of an engine to a stream, and  
then use Rete.bload() on a new instance of jess.Rete to turn it into a  
copy of the original.

On May 7, 2011, at 4:04 PM, Theodore Patkos wrote:

> Hey all,
>
> I was wondering if there is a way to make an exact, yet independent,  
> copy of a Rete engine's instance in Java (i.e., including the  
> ruleset, working memory, agenda, activation order etc).
>
> Peering an engine only copies the ruleset; if, afterwards, one  
> attempts to copy each fact from the initial engine to the peer,  
> apart from matters of efficiency, there exists the possibility of  
> activating rules that have already been activated in the initial  
> engine before the peering.
>
> Thanx!
> Theodore
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users  
> [hidden email]'
> in the BODY of a message to [hidden email], NOT to the list
> (use your own address!) List problems? Notify [hidden email]
> .
> --------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Creating identical independent engines in Java

Theodore Patkos
Right, thank you for your answer, it seems to accurately capture the
solution needed. What I still can’t figure out is how to preserve the
connection to the shadow facts.

When I created different peers, instead of copying the shadow facts I
asserted them the same way they were asserted in the original engine.
This way, whatever change occurred in a shadow fact instance, it was
seen by all peers.

This is not the case with the engine that is populated with
Rete.bload(). I studied the “JESS: Problems with copying shadow facts
via bsave and bload” thread, but I can’t see how to re-register the
listeners.. Any suggestions there?

Regards,

Theodore



Στις 8/5/2011 3:44 μμ, ο/η Ernest Friedman-Hill έγραψε:

> You can use Rete.bsave() to write a copy of an engine to a stream, and
> then use Rete.bload() on a new instance of jess.Rete to turn it into a
> copy of the original.
>
> On May 7, 2011, at 4:04 PM, Theodore Patkos wrote:
>
>> Hey all,
>>
>> I was wondering if there is a way to make an exact, yet independent,
>> copy of a Rete engine's instance in Java (i.e., including the
>> ruleset, working memory, agenda, activation order etc).
>>
>> Peering an engine only copies the ruleset; if, afterwards, one
>> attempts to copy each fact from the initial engine to the peer, apart
>> from matters of efficiency, there exists the possibility of
>> activating rules that have already been activated in the initial
>> engine before the peering.
>>
>> Thanx!
>> Theodore
>>
>>
>> --------------------------------------------------------------------
>> To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
>> in the BODY of a message to [hidden email], NOT to the list
>> (use your own address!) List problems? Notify
>> [hidden email].
>> --------------------------------------------------------------------
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Informatics & Decision Sciences, Sandia National Laboratories
> PO Box 969, MS 9012, Livermore, CA 94550
> http://www.jessrules.com
>
>
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
> in the BODY of a message to [hidden email], NOT to the list
> (use your own address!) List problems? Notify
> [hidden email].
> --------------------------------------------------------------------
>





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------