public override void PropagateRetract(IExecutionContext context, Tuple tuple) { IEnumerable <Fact> facts = RightSource.GetFacts(context); foreach (Fact fact in facts) { MemoryNode.PropagateRetract(context, tuple, fact); } }
public override void PropagateAssert(IExecutionContext context, Tuple tuple) { IEnumerable <Fact> facts = RightSource.GetFacts(context); foreach (Fact fact in facts) { if (MatchesConditions(tuple, fact)) { PropagateMatchedAssert(context, tuple, fact); } } }
protected TupleFactSet JoinedSet(IExecutionContext context, Tuple tuple) { int level = tuple.Level; var facts = RightSource.GetFacts(context).ToList(); if (facts.Count > 0) { IDictionary <long, List <Fact> > factGroups = GroupFacts(facts, level); if (factGroups.Count > 0) { return(JoinByGroupId(tuple, factGroups)); } } return(new TupleFactSet(tuple, facts)); }
protected IEnumerable <TupleFactSet> JoinedSets(IExecutionContext context, IList <Tuple> tuples) { if (tuples.Count == 0) { return(EmptySetList); } int level = tuples[0].Level; var facts = RightSource.GetFacts(context).ToList(); if (facts.Count > 0) { IDictionary <long, List <Fact> > factGroups = GroupFacts(facts, level); if (factGroups.Count > 0) { return(JoinByGroupId(tuples, factGroups)); } } return(CrossJoin(tuples, facts)); }
protected IEnumerable <Fact> MatchingFacts(IExecutionContext context, Tuple tuple) { return(RightSource.GetFacts(context).Where(fact => MatchesConditions(context, tuple, fact))); }