private void Traverse(Dictionary<string, int> marking, Tree.Node tNode) { if (MarkFound != null) MarkFound(marking, tNode.Marking); if (StateExists(marking)) return; _foundMarkings.Add(marking); foreach (var newMarking in from trans in _transitions.Values where trans.ReadyForTransition(marking) select new { Mark = trans.Transit(marking), netNode = trans}) { SetMaxMarks(newMarking.Mark); var node = new Tree.Node(newMarking.Mark, newMarking.netNode.Name); tNode.Children.Add(node); Traverse(newMarking.Mark,node); } }
public void Traverse() { _startNode = new Tree.Node(_defMarking, "Root"); Traverse(new Dictionary<string, int>(_defMarking),_startNode); }