private void ProcessSerialDivergence(IPfcNode node) { ValidationToken nodeVt = GetValidationData(node).ValidationToken; foreach (IPfcNode successor in node.SuccessorNodes) { nodeVt.IncrementAlternatePathsOpen(); Enqueue(node, successor, nodeVt); } nodeVt.DecrementAlternatePathsOpen(); //added 1 per child, subtract 1 overall. Thus 1 split to 4 yields 4 alt. }
private void UpdateClosureToken(IPfcTransitionNode closureTransition) { // Find the youngest common ancestor to all gazinta tokens. IPfcNode yca = DivergenceNodeFor(closureTransition); bool completeParallelConverge = AllParallelAndAtLeastOneOfEachSetOfSerialPathsContain(yca, closureTransition); ValidationToken replacementToken = completeParallelConverge ? // Are all of the root node's outbound // paths closed by the closure node? GetValidationData(yca).ValidationToken : // If so, its token is the closure token. GetValidationData(closureTransition.PredecessorNodes[0]).ValidationToken; // If not, pick one of the gazinta tokens. replacementToken.IncrementAlternatePathsOpen(); GetValidationData(closureTransition).ValidationToken = replacementToken; if (m_diagnostics) { Console.WriteLine("\t\tAssigning {0} ({1}) to {2} on its closure.", replacementToken.Name, replacementToken.AlternatePathsOpen, closureTransition.Name); } }