public ActionResult Kotumserlik(string matris, int rows) { Calculate calculate = new Calculate(); String[,] Matris = calculate.AyirilmisMatris(matris, rows); Results results = new Results() { Isim = "Kötümserlik", Rows = rows }; SonucDetay _sonucDetay = calculate.KotumserlikHesapla(Matris); _sonucDetay.SonucSatir += 1; SonucDetay sonucDetay = new SonucDetay() { Sonuc = _sonucDetay.Sonuc, SonucSatir = _sonucDetay.SonucSatir }; SonucViewModel sonucViewModel = new SonucViewModel() { Results = results, SonucDetay = sonucDetay }; return(View("Sonuc", sonucViewModel)); }
public ActionResult Hurwics(FormCollection Nesneler) { string matris = Nesneler["matris"]; int rows = Convert.ToInt32(Nesneler["rows"]); float alfa = Convert.ToSingle(Nesneler["textBoxAlfa"]); alfa /= 100; Calculate calculate = new Calculate(); String[,] Matris = calculate.AyirilmisMatris(matris, rows); Results results = new Results() { Isim = "Hurwics", Rows = rows }; SonucDetay _sonucDetay = calculate.HurwicsHesapla(Matris, alfa); _sonucDetay.SonucSatir += 1; SonucDetay sonucDetay = new SonucDetay() { Sonuc = _sonucDetay.Sonuc, SonucSatir = _sonucDetay.SonucSatir }; SonucViewModel sonucViewModel = new SonucViewModel() { Results = results, SonucDetay = sonucDetay }; return(View("Sonuc", sonucViewModel)); }
public SonucDetay LaplaceHesapla(String[,] model) { a = MatrisSatirHesapla(model); d = MatrisKolonHesapla(model); float EsOlasilik = 1 / Convert.ToSingle(d); YeniMatris = ConvertMatris(model); float[] SatirTop = new float[a]; float buyuk = 0; for (int i = 0; i < a; i++) { float Top = 0; for (int j = 0; j < d; j++) { Top += YeniMatris[i, j]; } SatirTop[i] = Top; SatirTop[i] = SatirTop[i] * EsOlasilik; if (buyuk < SatirTop[i]) { buyuk = SatirTop[i]; } } int sonucSatiri = Array.IndexOf(SatirTop, buyuk); SonucDetay sonucDetay = new SonucDetay() { Sonuc = buyuk, SonucSatir = sonucSatiri }; return(sonucDetay); }
public SonucDetay HurwicsHesapla(String[,] model, float _alfa) { a = MatrisSatirHesapla(model); Buyukler = new int[a]; float alfa = _alfa; float alfa2 = 1 - alfa;//1-alfa //satırın en büyüğü Buyukler = EnBuyukHesapla(model); Kucukler = EnKucukHesapla(model); float[] HurwicsTop = new float[a]; float hurwics = 0; for (int i = 0; i < Buyukler.Length; i++) { HurwicsTop[i] = (Buyukler[i] * alfa) + (Kucukler[i] * alfa2); if (hurwics < HurwicsTop[i]) { hurwics = HurwicsTop[i]; } } int sonucSatiri = Array.IndexOf(HurwicsTop, hurwics); SonucDetay sonucDetay = new SonucDetay() { Sonuc = hurwics, SonucSatir = sonucSatiri }; return(sonucDetay); }
public SonucDetay KotumserlikHesapla(String[,] model) { a = MatrisSatirHesapla(model); Kucukler = new int[a]; int KotuBuyuk = 0; Kucukler = EnKucukHesapla(model); for (int i = 0; i < Kucukler.Length; i++) { if (KotuBuyuk < Kucukler[i]) { KotuBuyuk = Kucukler[i]; } } int sonucSatiri = Array.IndexOf(Kucukler, KotuBuyuk); SonucDetay sonucDetay = new SonucDetay() { Sonuc = KotuBuyuk, SonucSatir = sonucSatiri }; return(sonucDetay); }
public SonucDetay IyimserlikHesapla(String[,] model) { a = MatrisSatirHesapla(model); Buyukler = new int[a]; int iyiBuyuk = 0; Buyukler = EnBuyukHesapla(model); for (int i = 0; i < Buyukler.Length; i++) { if (iyiBuyuk < Buyukler[i]) { iyiBuyuk = Buyukler[i]; } } int sonucSatiri = Array.IndexOf(Buyukler, iyiBuyuk); SonucDetay sonucDetay = new SonucDetay() { Sonuc = iyiBuyuk, SonucSatir = sonucSatiri }; return(sonucDetay); }
public SonucDetay PismanlikHesapla(String[,] model) { a = MatrisSatirHesapla(model); d = MatrisKolonHesapla(model); Buyukler = new int[d]; YeniMatris = ConvertMatris(model); for (int i = 0; i < d; i++) { int sayi = 0; for (int j = 0; j < a; j++) { if (sayi < YeniMatris[j, i]) { sayi = YeniMatris[j, i]; } Buyukler[i] = sayi; } } int[,] PismalikMatris = new int[a, d]; for (int i = 0; i < d; i++) { for (int j = 0; j < a; j++) { PismalikMatris[j, i] = Buyukler[i] - YeniMatris[j, i]; } } //Sütundaki büyük olanlar int[] Buyuk = new int[a]; for (int i = 0; i < a; i++) { //satır for (int j = 0; j < d; j++) { if (Buyuk[i] < PismalikMatris[i, j]) { Buyuk[i] = PismalikMatris[i, j]; } } } int kucuk = Buyuk[0]; for (int i = 0; i < Buyuk.Length; i++) { if (kucuk > Buyuk[i]) { kucuk = Buyuk[i]; } } int sonucSatiri = Array.IndexOf(Buyuk, kucuk); SonucDetay sonucDetay = new SonucDetay() { Sonuc = kucuk, SonucSatir = sonucSatiri }; return(sonucDetay); }