Exemple #1
0
 private bool ValidKalim(Kalim transition)
 {
     return(Q.Contains(transition.GjendjaFillestare) &&
            Q.Contains(transition.GjendjePerfundimtare) &&
            Sigma.Contains(transition.Simbol) &&
            !KalimAlreadyDefined(transition));
 }
Exemple #2
0
        private static void Main()
        {
            using (StreamReader str = new StreamReader("Rastet.txt"))
            {
                while (!str.EndOfStream)
                {
                    string[] parts = str.ReadLine().Split(' ');

                    var Q          = parts[0].Split(',');
                    var BashkesiaE = new List <char>();
                    foreach (var gj in parts[1].Split(','))
                    {
                        BashkesiaE.Add(Convert.ToChar(gj));
                    }

                    var      Q0      = parts[2].Split(',');
                    var      F       = parts[3].Split(',');
                    string[] kalimet = parts[4].Split(',');
                    var      Kalimet = new List <Kalim>();
                    foreach (var kalim in kalimet)
                    {
                        string[] elements       = kalim.Split('-');
                        Kalim    kalimiIRradhes = new Kalim(elements[0], Convert.ToChar(elements[1]), elements[2]);
                        Kalimet.Add(kalimiIRradhes);
                    }


                    var afjd = new AFJD(Q, BashkesiaE, Kalimet, Q0, F);
                    var afd  = Konvertuesi.Konverto(afjd);
                    foreach (var kalim in afd.Delta)
                    {
                        Console.WriteLine(kalim.ToString());
                    }
                    Console.WriteLine("Shtyp nje celes per te pare automatin e rradhes!");
                    Console.ReadKey();
                }
            }
            Console.ReadLine();
        }
Exemple #3
0
 private bool KalimAlreadyDefined(Kalim transition)
 {
     return(Delta.Any(t => t.GjendjaFillestare == transition.GjendjaFillestare &&
                      t.Simbol == transition.Simbol));
 }
Exemple #4
0
 private bool KalimiVlefshem(Kalim transition)
 {
     return(Q.Contains(transition.GjendjaFillestare) &&
            Q.Contains(transition.GjendjePerfundimtare) &&
            Sigma.Contains(transition.Simbol));
 }