Exemple #1
0
        private void clustering_button_Click(object sender, EventArgs e)
        {
            ArrayList LowerBorders = new ArrayList();

            LowerBorders.Add(0.0);
            LowerBorders.Add(0.0);
            ArrayList UpperBorders = new ArrayList();

            UpperBorders.Add((double)pictureBox.Width);
            UpperBorders.Add((double)pictureBox.Height);
            ClusteringForm form = new ClusteringForm(points, LowerBorders, UpperBorders);

            form.ShowDialog();
            if (form.isClustered)
            {
                if (form.isHierarchicalClustering)
                {
                    isHierarchicalClustering = true;
                    isFuzzyClustering        = false;
                    dendrogram = form.getDendrogram();
                    DendrogramForm dendrogram_form = new DendrogramForm(dendrogram);
                    dendrogram_form.Show();
                }
                else if (form.isFuzzyClustering)
                {
                    isHierarchicalClustering = false;
                    isFuzzyClustering        = true;
                    MembershipMatrix         = form.getMemebershipMatrix();
                    ColorizeFuzzyClusters();
                }
                else
                {
                    isHierarchicalClustering = false;
                    isFuzzyClustering        = false;
                    points = form.getPoints();
                    ColorizeClusters();
                }
            }
        }
 private void Cluster_button_Click(object sender, EventArgs e)
 {
     isFuzzyClustering        = false;
     isHierarchicalClustering = false;
     for (int i = 0; i < points.Count; i++)
     {
         ((Point)points[i]).cluster_numbers.Clear();
     }
     if (LikeClassInfo_rb.Checked)
     {
         GenerationTypes form = new GenerationTypes();
         form.ShowDialog();
         if (form.isForHierarchicalClustering)
         {
             isHierarchicalClustering = true;
             dendrogram = CreateClassesDendrogram();
         }
         else if (form.isForFuzzyClustering)
         {
             isFuzzyClustering = true;
             CreateClassesMembershipMatrix();
         }
         else
         {
             for (int i = 0; i < points.Count; i++)
             {
                 ((Point)points[i]).cluster_numbers.Add((int)((ArrayList)ClassInfo[i])[0]);
             }
         }
     }
     else if (ClusteringAlgorithms_rb.Checked)
     {
         ClusteringForm form = new ClusteringForm(points, LowerBorders, UpperBorders, true);
         form.ShowDialog();
         if (form.isHierarchicalClustering)
         {
             isHierarchicalClustering = true;
             dendrogram = form.getDendrogram();
         }
         else if (form.isFuzzyClustering)
         {
             isFuzzyClustering = true;
             MembershipMatrix  = form.getMemebershipMatrix();
         }
         else
         {
             points = form.getPoints();
         }
     }
     else if (Random_rb.Checked)
     {
         GenerationTypes form = new GenerationTypes();
         form.ShowDialog();
         if (form.isWithoutNoise)
         {
             CreateRandomClustersWithoutNoise();
         }
         else if (form.isWithNoise)
         {
             CreateRandomClustersWithNoise();
         }
         else if (form.isForHierarchicalClustering)
         {
             isHierarchicalClustering = true;
             CreateRandomDendrogram();
         }
         else if (form.isForFuzzyClustering)
         {
             isFuzzyClustering = true;
             CreateRandomMembershipMatrix();
         }
     }
     isClustered = true;
     Close();
 }