Example #1
0
        /// <summary>
        /// Cleans Input and Output dictionaries generating data from current transition list.
        /// USE WITH CARE.
        /// </summary>
        public void RefreshData()
        {
            //cleans dictionaries.
            this.InputAlphabet  = new List <string> ();
            this.OutputAlphabet = new List <string> ();

            //Adds Input/Output to lists
            foreach (Transition t in this.Transitions)
            {
                if (!InputAlphabet.Contains(t.Input))
                {
                    AddInput(t.Input);
                }

                if (!OutputAlphabet.Contains(t.Output))
                {
                    AddOutput(t.Output);
                }

                if (!States.Contains(t.SourceState))
                {
                    States.Add(t.SourceState);
                }

                if (!States.Contains(t.TargetState))
                {
                    States.Add(t.TargetState);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Adds a output to output data.
 /// </summary>
 /// <param name="outputData"></param>
 public Boolean AddOutput(string outputData)
 {
     if (!OutputAlphabet.Contains(outputData))
     {
         OutputAlphabet.Add(outputData);
         return(true);
     }
     return(false);
 }