slitayem / fuxi

Automatically exported from code.google.com/p/fuxi
0 stars 0 forks source link

Not all built-ins moved to end #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Current implementation isn't moving all builtins to the end

Diff of Network.py that *should* fix problem - but introduces performance drop

{{{
diff -r 4f1111ec2d4d lib/Rete/Network.py
--- a/lib/Rete/Network.py       Fri Oct 02 15:11:36 2009 -0400
+++ b/lib/Rete/Network.py       Thu Oct 29 22:57:47 2009 -0400
@@ -657,10 +658,11 @@
                     self._resetinstanciationStats()                        
                 #self.checkDuplicateRules()
                 return
+            isaBuiltin = self.ruleStore.filters.get(currentPattern[PREDICATE])
             if HashablePatternList([currentPattern]) in self.nodes:
                 #Current pattern matches an existing alpha node
                 matchedPatterns.append(currentPattern)
-            elif matchedPatterns in self.nodes:
+            elif not isaBuiltin and matchedPatterns in self.nodes:
                 #preceding patterns match an existing join/beta node
                 newNode = self.createAlphaNode(currentPattern)
                 if len(matchedPatterns) == 1 and HashablePatternList([None])+matchedPatterns in 
self.nodes:

}}}

Original issue reported on code.google.com by chime...@gmail.com on 30 Oct 2009 at 3:03

GoogleCodeExporter commented 8 years ago

Original comment by chime...@gmail.com on 7 Sep 2010 at 11:27