示例#1
0
        private void downloadBTN_Click(object sender, EventArgs e)
        {
            ResTB.Clear();
            ResParallelTB.Clear();

            int rowNum;

            int.TryParse(countTB.Text, out rowNum);
            ReadData(@"E:\C#\data-mining\input2.txt", rowNum);
            panel1.Enabled = true;
            panel2.Enabled = true;
            backgroundWorker1.WorkerReportsProgress = true;

            backgroundWorker1.WorkerSupportsCancellation = true;
            backgroundWorker2.WorkerReportsProgress      = true;

            backgroundWorker2.WorkerSupportsCancellation = true;
            datainfo = "загружено " + dataset.Count() + " сущностей размерности " + dataset[0].attributes.Length;
            drawData();
            drawParallelData();
            ResTB.AppendText(datainfo + Environment.NewLine);
            ResParallelTB.AppendText(datainfo + Environment.NewLine);
            startBTN.Enabled         = true;
            startParallelBTN.Enabled = true;
            downloadBTN.Enabled      = false;
        }
示例#2
0
        private void SingleComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            ResTB.AppendText("==================Окончательные результаты===========");
            for (int i = 0; i < clusterNum; i++)
            {
                ResTB.AppendText(i + "  кластер " + dataset.Where(x => x.cluster == i).Count() + " элементов");
            }

            lAllTime = (dt2 - dt1).TotalMilliseconds;
            ResTB.AppendText("Затрачено времени:" + lAllTime);
            ResTB.AppendText("Итераций :" + Rounds);
            drawData(dataset, pictureBox1);
            downloadBTN.Enabled = true;
        }