Examples of BetaNode


Examples of org.drools.core.reteoo.BetaNode

    private static void insertFacts(LeftTupleSink startNode, InternalWorkingMemory wm) {
        LeftTupleSink lts =  startNode;
        PropagationContextFactory pctxFactory = wm.getKnowledgeBase().getConfiguration().getComponentFactory().getPropagationContextFactory();
        while (!NodeTypeEnums.isTerminalNode(lts) && lts.getLeftTupleSource().getType() != NodeTypeEnums.RightInputAdaterNode ) {
            if (NodeTypeEnums.isBetaNode(lts)) {
                BetaNode bn = (BetaNode) lts;
                if (!bn.isRightInputIsRiaNode() ) {
                    final PropagationContext pctx = pctxFactory.createPropagationContext(wm.getNextPropagationIdCounter(), PropagationContext.RULE_ADDITION, null, null, null);
                    bn.getRightInput().updateSink(bn,
                                                  pctx,
                                                  wm);
                } else {
                    insertSubnetworkFacts(bn, wm);
                }
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

    public static void deleteFacts(LeftTupleSink startNode, InternalWorkingMemory wm) {
        LeftTupleSink lts = startNode;
        while (!NodeTypeEnums.isTerminalNode(lts) && lts.getLeftTupleSource().getType() != NodeTypeEnums.RightInputAdaterNode ) {
            if (NodeTypeEnums.isBetaNode(lts)) {
                BetaNode bn = (BetaNode) lts;
                if (!bn.isRightInputIsRiaNode() ) {
                    BetaMemory bm;
                    if ( bn.getType() == NodeTypeEnums.AccumulateNode ) {
                        bm = ((AccumulateMemory)wm.getNodeMemory( bn )).getBetaMemory();
                    } else {
                        bm = ( BetaMemory ) wm.getNodeMemory( bn );
                    }
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

        LeftTupleSink sink = sinks.get(i);

        if ( i == 0 ) {
            if ( insert ) {
                if ( NodeTypeEnums.isBetaNode(sink) ) {
                    BetaNode bn = ( BetaNode ) sink;
                    if ( bn.isRightInputIsRiaNode() ) {
                        // must also create and stage the LeftTuple for the subnetwork
                        SegmentMemory subSmem = smem.getPrevious(); // Subnetwork segment will be before this one
                        insertPeerLeftTuple(lt, (LeftTupleSink)subSmem.getRootNode(), subSmem);
                    }
                }
                insertPeerLeftTuple(lt, sink, smem);
            } else {
                if ( NodeTypeEnums.isBetaNode(sink) ) {
                    BetaNode bn = ( BetaNode ) sink;
                    if ( bn.isRightInputIsRiaNode() ) {
                        // must also create and stage the LeftTuple for the subnetwork
                        SegmentMemory subSmem = smem.getPrevious(); // Subnetwork segment will be before this one
                        deletePeerLeftTuple(lt, (LeftTupleSink)subSmem.getRootNode(), subSmem, wm);
                    }
                }
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

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

        BetaNode betaNode = ( BetaNode ) otn.getSinkPropagator().getSinks()[0];
       
        assertEquals( AllSetBitMask.get(), betaNode.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightInferredMask() );
    }   
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

        AlphaNode alphaNode = ( AlphaNode ) otn.getSinkPropagator().getSinks()[0];
        assertEquals( AllSetBitMask.get(), alphaNode.getDeclaredMask() );
        assertEquals( AllSetBitMask.get(), alphaNode.getInferredMask() );
       
        BetaNode betaNode = ( BetaNode ) alphaNode.getSinkPropagator().getSinks()[0];
       
        assertEquals( AllSetBitMask.get(), betaNode.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightInferredMask() );
   
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

       
        ObjectTypeNode otn = getObjectTypeNode(kbase, "InitialFactImpl" );
        assertNotNull( otn );
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
        BetaNode betaNode = ( BetaNode ) liaNode.getSinkPropagator().getSinks()[1];
       
        assertEquals( AllSetBitMask.get(), betaNode.getLeftDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getLeftInferredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightInferredMask() );
   
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

       
        ObjectTypeNode otn = getObjectTypeNode(kbase, "Person" );
        assertNotNull( otn );
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
        BetaNode betaNode = ( BetaNode ) liaNode.getSinkPropagator().getSinks()[1];
       
        assertEquals( AllSetBitMask.get(), betaNode.getLeftDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getLeftInferredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode.getRightInferredMask() );
    }   
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

        // first share
        AlphaNode alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
        assertEquals( AllSetBitMask.get(), alphaNode1_1.getDeclaredMask() );
        assertEquals( AllSetBitMask.get(), alphaNode1_1.getInferredMask() );
       
        BetaNode betaNode1 = ( BetaNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
       
        assertEquals( AllSetBitMask.get(), betaNode1.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode1.getRightInferredMask() );
       
       
        // second share
        AlphaNode alphaNode1_2 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[1];
        assertEquals( AllSetBitMask.get(), alphaNode1_2.getDeclaredMask() );
        assertEquals( AllSetBitMask.get(), alphaNode1_2.getInferredMask() );
       
        BetaNode betaNode2 = ( BetaNode ) alphaNode1_2.getSinkPropagator().getSinks()[0];
       
        assertEquals( AllSetBitMask.get(), betaNode2.getRightDeclaredMask() );
        assertEquals( AllSetBitMask.get(), betaNode2.getRightInferredMask() );
    }      
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

        ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession());

        ObjectTypeNode otn = getObjectTypeNode(kbase, "A" );
        assertNotNull( otn );

        BetaNode betaNode = ( BetaNode otn.getSinkPropagator().getSinks()[0];
        assertEquals( EmptyBitMask.get(), betaNode.getRightDeclaredMask() );
        assertEquals( EmptyBitMask.get(), betaNode.getRightInferredMask() );
       
        assertEquals( EmptyBitMask.get(), betaNode.getLeftDeclaredMask() );
        assertEquals( EmptyBitMask.get(), betaNode.getLeftInferredMask() );
    }    
View Full Code Here

Examples of org.drools.core.reteoo.BetaNode

        ObjectTypeNode otn = getObjectTypeNode(kbase, "A" );
        assertNotNull( otn );
        List<String> sp = getSettableProperties(wm, otn);
       
        BetaNode betaNode = ( BetaNode otn.getSinkPropagator().getSinks()[0];               
        assertEqualscalculatePositiveMask(list("a"), sp), betaNode.getRightDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a"), sp), betaNode.getRightInferredMask() );
       
        assertEqualscalculatePositiveMask(list("a"), sp), betaNode.getLeftDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a"), sp), betaNode.getLeftInferredMask() );       
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.