public void FillCriterias() { criteriasDataGrid.Columns.Clear(); int count = 1; criteriasСomboBox1.ItemsSource = listOfCriteriasNames.Select((s) => s = $"K{count++} - {s}").ToList(); criteriasСomboBox1.SelectedIndex = 0; count = 1; criteriasСomboBox2.ItemsSource = listOfCriteriasNames.Select((s) => s = $"K{count++} - {s}").ToList(); criteriasСomboBox2.SelectedIndex = 0; count = 1; alternativeCriteriasComboBox.ItemsSource = listOfCriteriasNames.Select((s) => s = $"K{count++} - {s}").ToList(); criteriasСomboBox2.SelectedIndex = 0; for (int i = 0; i < expertList[0].Criterias.Length; i++) { var col = new DataGridTextColumn { Header = $"K{i + 1}" }; var binding = new Binding($"[{i}]"); col.Binding = binding; criteriasDataGrid.Columns.Add(col); } criteriasDataGrid.ItemsSource = expertList[expertChooseListBox.SelectedIndex].Criterias; PrioritiesSelector selector = new PrioritiesSelector(); selector.ComputePriorities(new DotNetMatrix.GeneralMatrix(expertList[expertChooseListBox.SelectedIndex].Criterias)); coeficientyIndexTextBlock.Text = $"Індекс узгодженності: {(selector.ConsistencyRatio.Equals(double.NaN) ? 0 : selector.ConsistencyRatio).ToString()}"; }
private void ChangeCriterias() { criteriasDataGrid.ItemsSource = null; criteriasDataGrid.ItemsSource = expertList[expertChooseListBox.SelectedIndex].Criterias; PrioritiesSelector selector = new PrioritiesSelector(); selector.ComputePriorities(new DotNetMatrix.GeneralMatrix(expertList[expertChooseListBox.SelectedIndex].Criterias)); coeficientyIndexTextBlock.Text = $"Індекс узгодженності: {(selector.ConsistencyRatio.Equals(double.NaN) ? 0 : selector.ConsistencyRatio).ToString()}"; }
private void ExpertChooseListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ready) { criteriasDataGrid.ItemsSource = null; criteriasDataGrid.ItemsSource = expertList[expertChooseListBox.SelectedIndex].Criterias; alternativesDataGrid.ItemsSource = null; alternativesDataGrid.ItemsSource = expertList[expertChooseListBox.SelectedIndex].Alternatives[alternativeCriteriasComboBox.SelectedIndex]; PrioritiesSelector selector = new PrioritiesSelector(); selector.ComputePriorities(new DotNetMatrix.GeneralMatrix(expertList[expertChooseListBox.SelectedIndex].Criterias)); coeficientyIndexTextBlock.Text = "Індекс узгодженності: " + selector.ConsistencyRatio.ToString(); } }
/// <summary> /// /// </summary> private void CalculatePriorities() { PrioritiesSelector selector = new PrioritiesSelector(); selector.ComputePriorities(_criteria); //first (zero-th) element of the lambda matrix is the //consistency ratio factor for the selection matrix _lambdas.SetElement(0, 0, selector.ConsistencyRatio); _orderedCriteria = selector.CalculatedMatrix; }
/// <summary> /// /// </summary> private void CalculateChoices() { GeneralMatrix tempMatrix = null; int i, col0, colMax; PrioritiesSelector selector = new PrioritiesSelector(); for (i = 0; i < this._nCriteria; i++) { col0 = i * _mChoices; colMax = col0 + _mChoices - 1; tempMatrix = _choiceMatrix.GetMatrix(0, _mChoices - 1, col0, colMax); selector.ComputePriorities(tempMatrix); //first element of the matrix is consistency ratio //for the criteria _lambdas.SetElement(i + 1, 0, selector.ConsistencyRatio); _modelResult.SetMatrix(0, _mChoices - 1, i, i, selector.CalculatedMatrix); } }