Пример #1
0
        private void btn_algorithm2_Click(object sender, EventArgs e)
        {
            //get values frome user:
            int    N_LENGTH, W_LENGTH, K_CENTERS;
            string file_name;

            //starting time
            getValuesFromUsers(out N_LENGTH, out W_LENGTH, out K_CENTERS, out file_name);

            var watch = System.Diagnostics.Stopwatch.StartNew();///calc execution time

            //call algorithm2
            Console.WriteLine("Calling Algorithm 2...");
            RawDataType         data;
            Tuple <double, int> result = BitClusterDiscord.bitClusterDiscord(out data, N_LENGTH, W_LENGTH, K_CENTERS, file_name);



            watch.Stop();//stop timer
            var elapsedMs = watch.ElapsedMilliseconds;


            this.txt_time.Text             = elapsedMs.ToString();
            this.best_so_far_dist_txt.Text = result.Item1.ToString();
            this.best_so_far_loc_txt.Text  = result.Item2.ToString();

            Console.WriteLine("Writing to file...");
            IOFunctions.writeFile(data, N_LENGTH, result.Item2);
            //Done
            Console.WriteLine(this.Text + " : Done Algorithm 2. Best_so_far_loc = " + result.Item2 + ". Time: " + elapsedMs);
        }
Пример #2
0
        private void btn_HotSax_Click(object sender, EventArgs e)
        {
            //get values frome user:
            int    N_LENGTH, W_LENGTH;
            string file_name;

            //starting time
            getValuesFromUsers_HOTSAX(out N_LENGTH, out W_LENGTH, out file_name);

            //fixed: hard code
            W_LENGTH = 3;

            var watch = System.Diagnostics.Stopwatch.StartNew();///calc execution time

            //call the function
            Console.WriteLine("Calling HOTSAX ...");

            RawDataType         data;
            Tuple <double, int> result = Heuristic.Heuristic_Function(N_LENGTH, W_LENGTH, file_name, out data);

            watch.Stop();//stop timer
            var elapsedMs = watch.ElapsedMilliseconds;

            this.txt_time.Text             = elapsedMs.ToString();
            this.txt_best_so_far_dist.Text = result.Item1.ToString();
            this.txt_best_so_far_loc.Text  = result.Item2.ToString();

            Console.WriteLine("Writing to file...");
            IOFunctions.writeFile(data, N_LENGTH, result.Item2);

            //Done
            Console.WriteLine(this.Text + " : \n\tDone HOTSAX. Best_so_far_loc = " + result.Item2 + ". Time: " + elapsedMs);
            Console.WriteLine("====================================================================");
        }