Beispiel #1
0
 private void RandomizeBtn_Click(object sender, EventArgs e)
 {
     bool isSucceed = true;
     Int32 clustersCount = 0;
     Int32 pointsCount = 0;
     isSucceed = Int32.TryParse(clusters_TextBox.Text, out clustersCount);
     if (!isSucceed)
     {
         MessageBox.Show(@"Clusters Count is invalid. \n Please, observe ur specified data");
         return;
     }
     isSucceed = Int32.TryParse(points_TextBox.Text, out pointsCount);
     if (!isSucceed)
     {
         MessageBox.Show(@"Clusters Count is invalid. \n Please, observe ur specified data");
         return;
     }
     
     kMeans = new K_Means(pointsCount, clustersCount);
     kMeans.Randomize();
     
     kMeans.SetGraphics(panel1.CreateGraphics());
     K_Painter.Draw(kMeans, panel1);
 }
Beispiel #2
0
 public Form1()
 {
     InitializeComponent();
     kMeans = new K_Means();
    // InitBitmap();
 }