cdsatrian

Normalisasi Moora

Oct 8th, 2021 (edited)
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub getNormalisasi()
  2.     Dim row As Integer = matriksKeputusanTable.RowCount
  3.     Dim column As Integer = matriksKeputusanTable.ColumnCount
  4.     Dim data = New String(row, column) {}
  5.     Dim temp = New Double(row) {}
  6.     Dim value = New Double(column) {}
  7.     Dim dt As New DataTable
  8.     Dim dataSet As New DataSet
  9.     matriksTernormalisasiTable.ColumnCount = column
  10.     matriksTernormalisasiTable.RowCount = row
  11.     For index = 0 To getKriteria.Length - 2
  12.         matriksTernormalisasiTable.Columns(index).Name = getKriteria(index)
  13.     Next
  14.     matriksTernormalisasiTable.Refresh()
  15.     Dim i As Integer = 0
  16.     Dim j As Integer = 0
  17.     While i < column
  18.         j = 0
  19.         While j < row
  20.             temp(j) = CDbl(matriksKeputusanTable.Rows(j).Cells(i).Value.ToString)
  21.             j += 1
  22.         End While
  23.         i += 1
  24.     End While
  25.     Dim pembagi
  26.     For index1 = 0 To row - 1
  27.         For index2 = 0 To column - 1
  28.             'inisialisai nilai pembagi per kolom
  29.             pembagi = 0
  30.             'hitung nilai total pembagi per kolom
  31.             For index3 = 0 To row - 1
  32.                 pembagi += matriksKeputusanTable.Rows(index3).Cells(index2).Value ^ 2
  33.             Next
  34.             data(index1, index2) = (matriksKeputusanTable.Rows(index1).Cells(index2).Value.ToString) / Math.Sqrt(pembagi)
  35.             matriksTernormalisasiTable.Rows(index1).Cells(index2).Value = data(index1, index2)
  36.         Next
  37.     Next
  38.     matriksTernormalisasiTable.Refresh()
  39. End Sub
Add Comment
Please, Sign In to add comment