public void read(LogicalDependency node, BeliefSet beliefSet, PropagationContext context, ObjectTypeConf typeConf) { beliefSet.add( node.getJustifierEntry() ); }
public void addBlocked(final LogicalDependency dep) { // Adds the blocked to the blockers list if ( this.blocked == null ) { this.blocked = new LinkedList<LogicalDependency>(); } this.blocked.add( dep ); // now ad the blocker to the blocked's list - we need to check that references are null first AgendaItem blocked = (AgendaItem)dep.getJustified(); if ( blocked.blockers == null ) { blocked.blockers = new LinkedList<LinkedListEntry<LogicalDependency>>(); blocked.blockers.add( dep.getJustifierEntry() ); } else if ( dep.getJustifierEntry().getNext() == null && dep.getJustifierEntry().getPrevious() == null && blocked.getBlockers().getFirst() != dep.getJustifierEntry() ) { blocked.blockers.add( dep.getJustifierEntry() ); } }
public void removeBlocked(final LogicalDependency dep) { this.blocked.remove( dep ); AgendaItem blocked = (AgendaItem)dep.getJustified(); blocked.blockers.remove( dep.getJustifierEntry() ); }
public void delete(LogicalDependency node, BeliefSet beliefSet, PropagationContext context) { beliefSet.remove( node.getJustifierEntry() ); WorkingMemoryAction action = new LogicalRetractCallback( tms, node, beliefSet, (InternalFactHandle) node.getJustified(), context, node.getJustifier() ); wm.queueWorkingMemoryAction( action ); }
public void insert(LogicalDependency node, BeliefSet beliefSet, PropagationContext context, ObjectTypeConf typeConf) { boolean empty = beliefSet.isEmpty(); beliefSet.add( node.getJustifierEntry() ); if ( empty) { InternalFactHandle handle = (InternalFactHandle) node.getJustified(); ((NamedEntryPoint)handle.getEntryPoint()).insert( handle, handle.getObject(), node.getJustifier().getRule(), node.getJustifier(), typeConf ); } }
public void cancelRemainingPreviousLogicalDependencies() { if ( this.previousJustified != null ) { for ( LogicalDependency dep = (LogicalDependency) this.previousJustified.getFirst(); dep != null; dep = (LogicalDependency) dep.getNext() ) { this.workingMemory.getTruthMaintenanceSystem().removeLogicalDependency( activation, dep, activation.getPropagationContext() ); } } if ( this.previousBlocked != null ) { for ( LogicalDependency dep = this.previousBlocked.getFirst(); dep != null; ) { LogicalDependency tmp = dep.getNext(); this.previousBlocked.remove( dep ); AgendaItem justified = ( AgendaItem ) dep.getJustified(); justified.getBlockers().remove( dep.getJustifierEntry() ); if (justified.getBlockers().isEmpty() ) { // the match is no longer blocked, so stage it ((DefaultAgenda)workingMemory.getAgenda()).getStageActivationsGroup().addActivation( justified ); } dep = tmp; } } }