public static XmlGraph ToXmlGraph(this TlaAutomaton automaton) { var xg = new XmlGraph(); foreach (var state in automaton.AllStates) { string name = string.Empty; if (state.IsInitial) { name += "Initial" + Environment.NewLine; } name += state.Name; if (state.IsAccepting) { name += Environment.NewLine + "Accepting"; } xg.CreateNode(state.Name).Text = name; } foreach (var item in automaton.AllTransitions) { xg[item.FromState.Name].ConnectTo(xg[item.ToState.Name]).Text = item.Condition == null ? "<NULL>" : item.Condition.ToString(); } return(xg); }
public XmlGraphNode(XmlGraph owner, string id) { _owner = owner; this.Id = id; }