Examples of BeliefSet


Examples of org.drools.core.beliefsystem.BeliefSet

                       
        TruthMaintenanceSystem tms = ((NamedEntryPoint)((StatefulKnowledgeSessionImpl)kSession).session.getWorkingMemoryEntryPoint( EntryPointId.DEFAULT.getEntryPointId() ) ).getTruthMaintenanceSystem();
       
        InternalFactHandle fh = ( InternalFactHandle ) kSession.getFactHandle( key );
       
        BeliefSet bs =  fh.getEqualityKey().getBeliefSet();
       
        assertEquals( "value1", ((LogicalDependency) ((LinkedListEntry)bs.getFirst()).getObject()).getValue() );
        assertEquals( "value2", ((LogicalDependency) ((LinkedListEntry)bs.getFirst().getNext()).getObject()).getValue() );       
    }   
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

                                                                                                             false,
                                                                                                             true,
                                                                                                             query,
                                                                                                             (RuleTerminalNodeLeftTuple) resultLeftTuple );
                    }
                    BeliefSet bs = handle.getEqualityKey().getBeliefSet();
                    if ( bs == null ) {
                        abduced = handle.getObject();
                    } else {
                        if ( ! bs.isPositive() ) {
                            pass = false;
                        }
                    }
                } else {
                    // query was successful, but nothing could be abduced.
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

        if ( value != null && value instanceof Belief) {
            Belief beliefValue = (Belief) value;
            beliefSystem = (BeliefSystem) beliefValue.getBeliefSystem();
        }

        BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet == null ) {
            if ( context.getType() == PropagationContext.MODIFICATION ) {
                // if this was a  update, chances  are its trying  to retract a logical assertion
            }
            beliefSet = beliefSystem.newBeliefSet( handle );
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

                                                                                                             false,
                                                                                                             true,
                                                                                                             query,
                                                                                                             (RuleTerminalNodeLeftTuple) resultLeftTuple );
                    }
                    BeliefSet bs = handle.getEqualityKey().getBeliefSet();
                    if ( bs == null ) {
                        abduced = handle.getObject();
                    } else {
                        if ( ! bs.isPositive() ) {
                            pass = false;
                        }
                    }
                } else {
                    // query was successful, but nothing could be abduced.
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

       
        // "logical" should only appear once
        assertEquals( 1,
                      getLogicalCount( tms ) );
       
        BeliefSet bs =  ( BeliefSet ) logicalHandle2.getEqualityKey().getBeliefSet();      
        assertEquals( "value1", ((LogicalDependency) ((LinkedListEntry)bs.getFirst()).getObject()).getValue() );
        assertEquals( "value2", ((LogicalDependency) ((LinkedListEntry)bs.getFirst().getNext()).getObject()).getValue() );

        // Now lets cancel the first activation
        node2.retractLeftTuple( tuple2,
                                context2,
                                ksession );
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

                       
        TruthMaintenanceSystem tms = ((NamedEntryPoint)((StatefulKnowledgeSessionImpl)kSession).session.getWorkingMemoryEntryPoint( EntryPoint.DEFAULT.getEntryPointId() ) ).getTruthMaintenanceSystem();
       
        InternalFactHandle fh = ( InternalFactHandle ) kSession.getFactHandle( key );
       
        BeliefSet bs =  fh.getEqualityKey().getBeliefSet();
       
        assertEquals( "value1", ((LogicalDependency) ((LinkedListEntry)bs.getFirst()).getObject()).getValue() );
        assertEquals( "value2", ((LogicalDependency) ((LinkedListEntry)bs.getFirst().getNext()).getObject()).getValue() );       
    }   
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

import org.drools.core.spi.PropagationContext;

public class TruthMaintenanceSystemHelper {

    public static void removeLogicalDependencies(final InternalFactHandle handle, final PropagationContext propagationContext ) throws FactException {
        final BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet != null && !beliefSet.isEmpty() ) {
            beliefSet.cancel(propagationContext);
        }
    }
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

            beliefSet.cancel(propagationContext);
        }
    }
   
    public static void clearLogicalDependencies(final InternalFactHandle handle, final PropagationContext propagationContext ) throws FactException {
        final BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet != null && !beliefSet.isEmpty() ) {
            beliefSet.clear(propagationContext);
        }
    }   
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

        activation.setLogicalDependencies( null );
    }

    public static void removeLogicalDependency(final LogicalDependency node,
                                               final PropagationContext context) {
        final BeliefSet beliefSet = ( BeliefSet ) node.getJustified();
        beliefSet.getBeliefSystem().delete( node, beliefSet, context );
    }
View Full Code Here

Examples of org.drools.core.beliefsystem.BeliefSet

                                     final Activation activation,
                                     final PropagationContext context,
                                     final Rule rule,
                                     final ObjectTypeConf typeConf,
                                     final boolean read) throws FactException {
        BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet == null ) {
            if ( context.getType() == PropagationContext.MODIFICATION ) {
                // if this was a  update, chances  are its trying  to retract a logical assertion
            }
            beliefSet = beliefSystem.newBeliefSet( handle );
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.