public virtual CurrentSolution Clone() { CurrentSolution cloneSolution = new CurrentSolution(); cloneSolution.clustersNumber = clustersNumber; cloneSolution.DegreeOfFuzziness = DegreeOfFuzziness; cloneSolution.target = target; cloneSolution.methodInput = methodInput; cloneSolution.clusterPrototypes = new InputObject[clustersNumber]; //clone prototypes for (int i = 0; i < clusterPrototypes.Length; i++) { cloneSolution.clusterPrototypes[i] = clusterPrototypes[i].Clone(); } cloneSolution.primaryMemberships = (double[,]) primaryMemberships.Clone(); return cloneSolution; }
private void ShowResults(CurrentSolution results, int clustersNumber, MethodInputResponse inputParams, int offset, string title) { myExcel.Worksheet currentWorkSheet = (myExcel.Worksheet)m_ObjWorkBook.Sheets[clustersNumber]; currentWorkSheet.Name = clustersNumber.ToString() + " clusters"; //FCM output //Membership values output: currentWorkSheet.Cells[offset + 1, 1] = title; for (int i = 0; i < clustersNumber; i++) { currentWorkSheet.Cells[offset + 2, 2 * (i + 1) + 1] = "Cluster " + (i + 1).ToString(); } for (int i = 0; i < inputParams.InputObjects.Count; i++) { currentWorkSheet.Cells[offset + i + 3, 1] = inputParams.InputObjects[i].Name; for (int j = 0; j < clustersNumber; j++) { currentWorkSheet.Cells[offset + i + 3, 2 * (j + 1) + 1] = string.Format("{0:0.##########}", results.PrimaryMemberships[j, i]); } } //DSE-s output: for (int i = 0; i < clustersNumber; i++) { currentWorkSheet.Cells[offset + 2, 2 * (i + 1)] = "DSE " + (i + 1).ToString(); } for (int i = 0; i < inputParams.InputObjects.Count; i++) { for (int j = 0; j < clustersNumber; j++) { currentWorkSheet.Cells[offset + i + 3, 2 * (j + 1)] = results.GetSignedEuclidean(inputParams.InputObjects[i], results.ClusterPrototypes[j]); } } //Cluster centres output: currentWorkSheet.Cells[offset + inputParams.InputObjects.Count + 4, 1] = "Clusters prototypes:"; //column captions: int rowCount = offset + inputParams.InputObjects.Count + 5; foreach (string dimensionName in inputParams.dimensionsLowerBounds.Keys) { currentWorkSheet.Cells[rowCount, 1] = dimensionName; rowCount ++; } //actual values now: for (int i = 0; i < clustersNumber; i++) { int j = 0; foreach (string dimension in inputParams.dimensionsLowerBounds.Keys) { currentWorkSheet.Cells[offset + inputParams.InputObjects.Count + 5 + j, i + 2] = results.ClusterPrototypes[i].Dimensions[dimension]; j++; } } //currentWorkSheet.Cells[offset + inputParams.InputObjects.Count + 6 + inputParams.dimensionsLowerBounds.Count, 1] = "Iterations count: " + iterationsCount.ToString(); // currentWorkSheet.Columns.AutoFit(); m_ObjExcel.Visible = true; m_ObjExcel.UserControl = true; }