Beispiel #1
0
 private void Slv_Report(Suduku current, double temperature, double score)
 {
     this.latestTable = current.Table;
     if (this.Diagram.IsDisposed)
     {
         this.Diagram = new DiagramForm();
         this.Diagram.Show();
     }
     this.Diagram.Update(temperature, current.ConflictCount);
 }
Beispiel #2
0
        private void btnSA_Click(object sender, EventArgs e)
        {
            Reset();
            SimulatedAnnealing slv = new SimulatedAnnealing();

            slv.ErrorHappend  += Slv_ErrorHappend;
            slv.Report        += Slv_Report;
            slv.ProblemSolved += Slv_ProblemSolved;
            MainThread         = new Thread(() =>
            {
                watch.Start();
                slv.Start(currentSuduku, double.Parse(txtSALimit.Text.ToLower().Replace("min", "").Trim()));
            });
            this.Diagram = new DiagramForm();
            this.Diagram.Show();
            MainThread.IsBackground = true;
            Loading(true);
            MainThread.Start();
        }