private void Gs_IterationCompleted(object sender, IterationCompletedEventArgs e) { AddPointsToChart(e.IterationCount, e.BestChromosome.Fitness, e.AverageFitness); Decode(e.BestChromosome); PopulationChart.Refresh(); Application.DoEvents(); }
private void Gs_IterationCompleted(object sender, IterationCompletedEventArgs e) { BestSolution = e.BestChromosome; AddPointsToChart(e.IterationCount, BestSolution.Fitness, e.AverageFitness); label1.Text = $"Total Length : {(int)CalculateFitness_TSPProblem(BestSolution)}"; map.Refresh(); PopulationChart.Refresh(); Application.DoEvents(); }
private void Gs_IterationCompleted(object sender, IterationCompletedEventArgs e) { resultlist.Items.Add("= Iteration Completed ========="); int val1 = (int)e.BestChromosome.Data[0]; int val2 = (int)e.BestChromosome.Data[1]; int val3 = (int)e.BestChromosome.Data[2]; int val4 = (int)e.BestChromosome.Data[3]; int val5 = (int)e.BestChromosome.Data[4]; int val6 = (int)e.BestChromosome.Data[5]; int val7 = (int)e.BestChromosome.Data[6]; int val8 = (int)e.BestChromosome.Data[7]; int val9 = (int)e.BestChromosome.Data[8]; int val10 = (int)e.BestChromosome.Data[9]; resultlist.Items.Add($"{val1} + {val2} + {val3} + {val4} + {val5} = {val1 + val2 + val3 + val4 + val5}"); resultlist.Items.Add($"{val6} * {val7} * {val8} * {val9} * {val10} = {val6 * val7 * val8 * val9 * val10}"); AddPointsToChart(e.IterationCount, e.BestChromosome.Fitness, e.AverageFitness); PopulationChart.Refresh(); Application.DoEvents(); }