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