tag:blogger.com,1999:blog-8366702.post4857822395625280331..comments2009-04-25T09:23:27.261+02:00Comments on // comments are lies!: Experimental Rete implementationJohan Lindberghttp://www.blogger.com/profile/13455767001846504270noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8366702.post-634171891812912392007-08-06T11:24:00.000+02:002007-08-06T11:24:00.000+02:00Hi Mark,and thanks for the comment. I've looked at...Hi Mark,<BR/><BR/>and thanks for the comment. I've looked at your implementation quite a bit (as well as Jamocha's). I can imagine that your OO-design really have made your life simpler and allows for an easy way to add functionality.<BR/><BR/>However, the reason I even started to think about alternatives to OO was because I'm worried about performance. What I really want is a way to inline all of the activations in the Nodes of the Rete Network into one large function (function calls are expensive in Python).<BR/><BR/>Anyway, this is all largely experimental and should not be taken too seriously unless it actually outperforms my current design of course ;-)Johan Lindberghttps://www.blogger.com/profile/13455767001846504270noreply@blogger.comtag:blogger.com,1999:blog-8366702.post-89417065386055946032007-07-31T01:42:00.000+02:002007-07-31T01:42:00.000+02:00What we did to make things clean is work with Abst...What we did to make things clean is work with Abstract implementations and Interfaces, not objects. <BR/><BR/>We have two abstract classes - ObjectSource and TupleSource. ObjectSource propagates Objects to its Sink and TupleSource propagates Tuples to its sink.<BR/><BR/>We then have two interfaces ObjectSink and TupleSink - a source progates to a sink. <BR/><BR/>An AlphaNode will extend ObjectSource and implement ObjectSink while a BetaNode such as a JoinNode will extend TupleSource but it implements both TupleSink and ObjectSink. As a JoinNode receives Tuples on the left and Objects on the right.<BR/><BR/>Everything from the root Rete node to the leaf Terminal node obeys this. So that means you can traverse the entire graph with only knowledge of those 2 abstract classes and 2 interfaces.<BR/><BR/>Over all through good OO design we have a very clean Rete implementation.<BR/><BR/>Mark<BR/>http://blog.athico.comMark Proctorhttps://www.blogger.com/profile/03304277188725220501noreply@blogger.com