Beispiel #1
0
        private void PropagateMatchedRetract(IExecutionContext context, Tuple tuple, Fact fact)
        {
            Tuple childTuple = tuple.ChildTuples.SingleOrDefault(t => t.Node == this && t.RightFact == fact);

            if (childTuple != null)
            {
                Sink.PropagateRetract(context, childTuple);
                childTuple.Clear();
            }
        }
        public void PropagateRetract(IExecutionContext context, Tuple tuple, Fact fact)
        {
            IBetaMemory memory     = context.WorkingMemory.GetNodeMemory(this);
            Tuple       childTuple = memory.FindTuple(tuple, fact);

            if (childTuple != null)
            {
                foreach (var sink in _sinks)
                {
                    sink.PropagateRetract(context, childTuple);
                }
                memory.Remove(childTuple);
                childTuple.Clear();
            }
        }