Package org.drools.reteoo

Examples of org.drools.reteoo.LeftInputAdapterNode$RightTupleSinkAdapter


        // first share
        AlphaNode alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
        assertEquals( calculatePositiveMask(list("b"), sp), alphaNode1_1.getDeclaredMask( ) );
        assertEquals( calculatePositiveMask(list("a", "b"), sp), alphaNode1_1.getInferredMask() )
       
        LeftInputAdapterNode liaNode1 = ( LeftInputAdapterNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
        RuleTerminalNode rtNode1 = ( RuleTerminalNode ) liaNode1.getSinkPropagator().getSinks()[0];
       
        assertEquals( 0, rtNode1.getDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a", "b"), sp), rtNode1.getInferredMask() );
       
       
        // second share
        AlphaNode alphaNode1_2 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[1];
        assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
        assertEquals( calculatePositiveMask(list("a", "i"), sp), alphaNode1_2.getInferredMask() );
       
        LeftInputAdapterNode liaNode2 = ( LeftInputAdapterNode ) alphaNode1_2.getSinkPropagator().getSinks()[0];
        RuleTerminalNode rtNode2 = ( RuleTerminalNode ) liaNode2.getSinkPropagator().getSinks()[0];
       
        assertEquals( 0, rtNode2.getDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a", "i"), sp), rtNode2.getInferredMask() );
       
        // test rule removal       
View Full Code Here


        // first share
        AlphaNode alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
        assertEquals( calculatePositiveMask(list("b"), sp), alphaNode1_1.getDeclaredMask( ) );
        assertEquals( calculatePositiveMask(list("a", "b", "c"), sp), alphaNode1_1.getInferredMask() )
       
        LeftInputAdapterNode liaNode1 = ( LeftInputAdapterNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
        RuleTerminalNode rtNode1 = ( RuleTerminalNode ) liaNode1.getSinkPropagator().getSinks()[0];
       
        assertEqualscalculatePositiveMask(list("c"), sp), rtNode1.getDeclaredMask() );
        assertEqualscalculatePositiveMask(list("b", "c"), sp), rtNode1.getInferredMask() );
        assertEqualscalculateNegativeMask(list("!a"), sp), rtNode1.getNegativeMask() );

       
        // second share
        AlphaNode alphaNode1_2 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[1];
        assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
        assertEquals( calculatePositiveMask(list("a", "i", "s"), sp), alphaNode1_2.getInferredMask() )
       
        LeftInputAdapterNode liaNode2 = ( LeftInputAdapterNode ) alphaNode1_2.getSinkPropagator().getSinks()[0];
        RuleTerminalNode rtNode2 = ( RuleTerminalNode ) liaNode2.getSinkPropagator().getSinks()[0];
       
        assertEqualscalculatePositiveMask(list("s"), sp), rtNode2.getDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a", "s"), sp), rtNode2.getInferredMask() );
        assertEqualscalculateNegativeMask(list("!i"), sp), rtNode2.getNegativeMask() );
View Full Code Here

                    }
                    context.setRootObjectTypeNode((ObjectTypeNode) source);

                    // adapt it to a Tuple source                   
                    context.setTupleSource((LeftTupleSource) utils.attachNode( context,
                                                                               new LeftInputAdapterNode( context.getNextId(),
                                                                                                         context.getObjectSource(),
                                                                                                         context) ) );
                    context.setObjectSource(null);
                }
View Full Code Here

        wm.fireAllRules();
       
       
        ObjectTypeNode otnInit = getObjectTypeNode(kbase, "InitialFactImpl" );
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otnInit.getSinkPropagator().getSinks()[0];
       
        LeftTupleSink[] sinks = liaNode.getSinkPropagator().getSinks();
       
        assertEquals(0, sinks[0].getLeftInputOtnId() );
        assertEquals(1, sinks[1].getLeftInputOtnId() );
        assertEquals(2, sinks[2].getLeftInputOtnId() );
        assertEquals(3, sinks[3].getLeftInputOtnId() );
View Full Code Here

        wm.fireAllRules();
       
       
        ObjectTypeNode otnInit = getObjectTypeNode(kbase, "InitialFactImpl" );
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otnInit.getSinkPropagator().getSinks()[0];
       
        LeftTupleSink[] sinks = liaNode.getSinkPropagator().getSinks();
       
        assertEquals(0, sinks[0].getLeftInputOtnId() );
        assertEquals(1, sinks[1].getLeftInputOtnId() );
        assertEquals(2, sinks[2].getLeftInputOtnId() );
        assertEquals(3, sinks[3].getLeftInputOtnId() );
View Full Code Here

    @Override
    protected void doVisit(NetworkNode node,
                           Stack<NetworkNode> nodeStack,
                           StatefulKnowledgeSessionInfo info) {
        LeftInputAdapterNode an = (LeftInputAdapterNode) node;
        DefaultNodeInfo ni = (DefaultNodeInfo) info.getNodeInfo( node );
        ni.setMemoryEnabled( false );
    }
View Full Code Here

            }
        }
       
        ReteooWorkingMemory wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        LeftInputAdapterNode liaNode = (LeftInputAdapterNode) node.getSinkPropagator().getSinks()[0];
        JoinNode j2 = ( JoinNode ) liaNode.getSinkPropagator().getSinks()[0]; // $p2
        JoinNode j3 = ( JoinNode ) j2.getSinkPropagator().getSinks()[0]// $p3
        JoinNode j4 = ( JoinNode ) j3.getSinkPropagator().getSinks()[0]// $p4
        JoinNode j5 = ( JoinNode ) j4.getSinkPropagator().getSinks()[0]// $p5
        //JoinNode j6 = ( JoinNode ) j5.getSinkPropagator().getSinks()[0];  // $p6 // won't compile
        JoinNode j7 = ( JoinNode ) j5.getSinkPropagator().getSinks()[0]// $p7
View Full Code Here

        }   
       
        ReteooWorkingMemory wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        AlphaNode alphanode = ( AlphaNode ) node.getSinkPropagator().getSinks()[0];
        LeftInputAdapterNode liaNode = (LeftInputAdapterNode) alphanode.getSinkPropagator().getSinks()[0];
        JoinNode j = ( JoinNode ) liaNode.getSinkPropagator().getSinks()[0]; // $p2
       
        TripleNonIndexSkipBetaConstraints c = ( TripleNonIndexSkipBetaConstraints ) j.getRawConstraints();
        //assertEquals( "$name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
        assertTrue( c.isIndexed() );       
        BetaMemory bm = ( BetaMemory ) wm.getNodeMemory( j );
View Full Code Here

        ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        ObjectTypeNode otn = getObjectTypeNode(kbase, "InitialFactImpl" );
        assertNotNull( otn );

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( Long.MAX_VALUE, rtNode.getDeclaredMask() );
        assertEquals( Long.MAX_VALUE, rtNode.getInferredMask() );
    }  
View Full Code Here

        ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        ObjectTypeNode otn = getObjectTypeNode(kbase, "Person" );
        assertNotNull( otn );

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( Long.MAX_VALUE, rtNode.getDeclaredMask() );
        assertEquals( Long.MAX_VALUE, rtNode.getInferredMask() );
    }  
View Full Code Here

TOP

Related Classes of org.drools.reteoo.LeftInputAdapterNode$RightTupleSinkAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.