private void Update(int iteration) { label19.Text = (iteration + 1).ToString(); Best = OffspringsFitness.Min(); for (int x = 0; x < OffspringsFitness.Length; x++) { if (OffspringsFitness[x] == OffspringsFitness.Min()) { ShowResult(x); break; } } label13.Text = Best.ToString(); label15.Text = Crossovers.ToString(); label17.Text = Mutations.ToString(); if (Best == 0) { thread.Abort(); timer1.Enabled = false; timer2.Enabled = false; button1.Enabled = true; button2.Enabled = false; } }