Package org.drools.core.phreak

Examples of org.drools.core.phreak.RuleNetworkEvaluatorActivation


            List<PathMemory> rmems =  lmem.getSegmentMemory().getPathMemories();
            for ( int i = 0, length = rmems.size(); i < length; i++ ) {
                PathMemory rm = rmems.get( i );

                RuleNetworkEvaluatorActivation evaluator = agenda.createRuleNetworkEvaluatorActivation( Integer.MAX_VALUE, rm, rm.getRuleTerminalNode() );
                evaluator.evaluateNetwork(this);
            }
        } else {
            // no need to call retract, as no leftmemory used.
            getEntryPointNode().assertQuery( handle,
                                             pCtx,
View Full Code Here


                List<PathMemory> rmems =  lmem.getSegmentMemory().getPathMemories();
                for ( int i = 0, length = rmems.size(); i < length; i++ ) {
                    PathMemory rm = rmems.get( i );

                    RuleNetworkEvaluatorActivation evaluator = agenda.createRuleNetworkEvaluatorActivation( Integer.MAX_VALUE, rm, rm.getRuleTerminalNode() );
                    evaluator.evaluateNetwork(this);
                }
            } else {
                getEntryPointNode().retractQuery( factHandle,
                                                  pCtx,
                                                  this );
View Full Code Here

   
    public RuleNetworkEvaluatorActivation createRuleNetworkEvaluatorActivation(final int salience,
                                                                               final PathMemory rs,
                                                                               final TerminalNode rtn) {
        InternalAgendaGroup agendaGroup = (InternalAgendaGroup) getAgendaGroup( rtn.getRule().getAgendaGroup() );
        RuleNetworkEvaluatorActivation lazyAgendaItem =  new RuleNetworkEvaluatorActivation(activationCounter++, null, salience, null, rs, rtn);
        lazyAgendaItem.setActivated( true );
        lazyAgendaItem.setAgendaGroup( agendaGroup );       
        addActivation( lazyAgendaItem, true );       
        return lazyAgendaItem;
    }
View Full Code Here

            List<PathMemory> rmems =  lmem.getSegmentMemory().getPathMemories();
            for ( int i = 0, length = rmems.size(); i < length; i++ ) {
                PathMemory rm = rmems.get( i );

                RuleNetworkEvaluatorActivation evaluator = agenda.createRuleNetworkEvaluatorActivation( Integer.MAX_VALUE, rm, rm.getRuleTerminalNode() );
                evaluator.evaluateNetwork(this, 0, -1);
            }
        } else {
            // no need to call retract, as no leftmemory used.
            getEntryPointNode().assertQuery( handle,
                                             pCtx,
View Full Code Here

                List<PathMemory> rmems =  lmem.getSegmentMemory().getPathMemories();
                for ( int i = 0, length = rmems.size(); i < length; i++ ) {
                    PathMemory rm = rmems.get( i );

                    RuleNetworkEvaluatorActivation evaluator = agenda.createRuleNetworkEvaluatorActivation( Integer.MAX_VALUE, rm, rm.getRuleTerminalNode() );
                    evaluator.evaluateNetwork(this, 0, -1);
                }
            } else {
                getEntryPointNode().retractQuery( factHandle,
                                                  pCtx,
                                                  this );
View Full Code Here

            ((AgendaItem)dep.getJustifier()).removeBlocked( dep );
            entry = tmp;
        }
       
        if ( wasBlocked ) {
            RuleNetworkEvaluatorActivation ruleNetworkEvaluatorActivation = targetMatch.getRuleNetworkEvaluatorActivation();
            if ( ruleNetworkEvaluatorActivation == null ) {
                // the match is no longer blocked, so stage it
                ((DefaultAgenda)workingMemory.getAgenda()).getStageActivationsGroup().addActivation( targetMatch );
            } else {
                if ( !ruleNetworkEvaluatorActivation.isActivated() ) {
                    // Make sure the rule evaluator is on the agenda, to be evaluated
                    ((InternalAgenda) workingMemory.getAgenda()).addActivation( ruleNetworkEvaluatorActivation );
                }
                targetMatch.getRuleNetworkEvaluatorActivation().getLeftTupleList().add( targetMatch.getTuple() );
            }
View Full Code Here

                this.previousBlocked.remove( dep );
               
                AgendaItem justified = ( AgendaItem ) dep.getJustified();
                justified.getBlockers().remove( dep.getJustifierEntry() );
                if (justified.getBlockers().isEmpty() ) {
                    RuleNetworkEvaluatorActivation ruleNetworkEvaluatorActivation = justified.getRuleNetworkEvaluatorActivation();
                    if ( ruleNetworkEvaluatorActivation == null ) {
                        // the match is no longer blocked, so stage it
                        ((DefaultAgenda)workingMemory.getAgenda()).getStageActivationsGroup().addActivation( justified );
                    } else {
                        if ( !ruleNetworkEvaluatorActivation.isActivated() ) {
                            // Make sure the rule evaluator is on the agenda, to be evaluated
                            ((InternalAgenda) workingMemory.getAgenda()).addActivation( ruleNetworkEvaluatorActivation );
                        }
                        ruleNetworkEvaluatorActivation.getLeftTupleList().add( justified.getTuple() );
                    }
                }
                dep = tmp;
            }
        }       
View Full Code Here

   
    public RuleNetworkEvaluatorActivation createRuleNetworkEvaluatorActivation(final int salience,
                                                                               final PathMemory rs,
                                                                               final TerminalNode rtn) {
        InternalAgendaGroup agendaGroup = (InternalAgendaGroup) getAgendaGroup( rtn.getRule().getAgendaGroup() );
        RuleNetworkEvaluatorActivation lazyAgendaItem =  new RuleNetworkEvaluatorActivation(activationCounter++, null, salience, null, rs, rtn, isDeclarativeAgenda());
        lazyAgendaItem.setActivated( true );
        lazyAgendaItem.setAgendaGroup( agendaGroup );       
        addActivation( lazyAgendaItem, true );       
        return lazyAgendaItem;
    }
View Full Code Here

TOP

Related Classes of org.drools.core.phreak.RuleNetworkEvaluatorActivation

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.