public static void ManualSystem(Defuzzifier def, FuzzySystem fsAkcel, FuzzySystem fsKormilo) { int L, D, LK, DK, V, S, A, K; while (true) { Console.WriteLine("Unesi L D LK DK V S || ili 'K' za kraj"); String str = Console.ReadLine(); if (str[0] == 'K') { break; } String[] p = str.Split(' '); L = int.Parse(p[0]); D = int.Parse(p[1]); LK = int.Parse(p[2]); DK = int.Parse(p[3]); V = int.Parse(p[4]); S = int.Parse(p[5]); A = fsAkcel.Zakljuci(L, D, LK, DK, V, S); //A = 4; K = fsKormilo.Zakljuci(L, D, LK, DK, V, S); //K = 5; //akcel = 10; kormilo = 5; Console.Write("Akcel:" + A.ToString() + " Kormilo:" + K.ToString() + "\r\n"); Console.Out.Flush(); } }
private static void Pravilo(Defuzzifier def, FuzzySystem fsAkcel, FuzzySystem fsKormilo) { Console.WriteLine("Unesite slovo baze (kor/akc) i redni broj pravila: (npr. 'k2') "); string pravilo = Console.ReadLine(); FuzzySystem.ManualSingleRule(pravilo, def, fsAkcel, fsKormilo); Console.ReadKey(); }
internal static void ManualSingleRule(string pravilo, Defuzzifier def, FuzzySystem fsAkcel, FuzzySystem fsKormilo) { int L, D, LK, DK, V, S, A, K; if (pravilo[0] == 'a' || pravilo[0] == 'A') { int redni = int.Parse(pravilo[1].ToString()); Console.WriteLine("Unesi L D LK DK V S"); String str = Console.ReadLine(); String[] p = str.Split(' '); L = int.Parse(p[0]); D = int.Parse(p[1]); LK = int.Parse(p[2]); DK = int.Parse(p[3]); V = int.Parse(p[4]); S = int.Parse(p[5]); fsAkcel.ZakljuciPrint(L, D, LK, DK, V, S, fsAkcel.AkcelRules[redni]); } else if (pravilo[0] == 'k' || pravilo[0] == 'K') { int redni = int.Parse(pravilo[1].ToString()); Console.WriteLine("Unesi L D LK DK V S"); String str = Console.ReadLine(); String[] p = str.Split(' '); L = int.Parse(p[0]); D = int.Parse(p[1]); LK = int.Parse(p[2]); DK = int.Parse(p[3]); V = int.Parse(p[4]); S = int.Parse(p[5]); fsKormilo.ZakljuciPrint(L, D, LK, DK, V, S, fsKormilo.KormiloRules[redni]); } }
private static void Manual(Defuzzifier def, FuzzySystem fsAkcel, FuzzySystem fsKormilo) { FuzzySystem.ManualSystem(def, fsAkcel, fsKormilo); }