// Genetic algorithm private void button3_Click(object sender, EventArgs e) { BackgroundWorker Work_Thread = new BackgroundWorker(); Work_Thread.DoWork += new DoWorkEventHandler(delegate(object sender2, DoWorkEventArgs e2) { Genetic_Algorithm GA = new Genetic_Algorithm(); e2.Result = GA.Genetic_Algorithm_Start(task, new List<Solution>() { }, 1); }); Work_Thread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object sender3, RunWorkerCompletedEventArgs e3) { Create_Form("Genetic algorithm", (string)e3.Result); }); Work_Thread.RunWorkerAsync(); }
// Genetic algorithm private void button3_Click(object sender, EventArgs e) { BackgroundWorker Work_Thread = new BackgroundWorker(); Work_Thread.DoWork += new DoWorkEventHandler(delegate(object sender2, DoWorkEventArgs e2) { Genetic_Algorithm GA = new Genetic_Algorithm(); e2.Result = GA.Genetic_Algorithm_Start(task, new List <Solution>() { }, 1); }); Work_Thread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object sender3, RunWorkerCompletedEventArgs e3) { Create_Form("Genetic algorithm", (string)e3.Result); }); Work_Thread.RunWorkerAsync(); }
// Linking Simplex and Genetic algorithms private void button4_Click(object sender, EventArgs e) { BackgroundWorker Work_Thread = new BackgroundWorker(); Work_Thread.DoWork += new DoWorkEventHandler(delegate(object sender2, DoWorkEventArgs e2) { Optimized_Simplex_Algorithm OSA = new Optimized_Simplex_Algorithm(); Tuple <string, List <Solution> > Results = OSA.Optimized_Simplex_Algorithm_Start(task, 1); Genetic_Algorithm GA = new Genetic_Algorithm(); e2.Result = GA.Genetic_Algorithm_Start(task, new List <Solution>(Results.Item2), 1); }); Work_Thread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object sender3, RunWorkerCompletedEventArgs e3) { Create_Form("Linking Simplex and Genetic algorithms", (string)e3.Result); }); Work_Thread.RunWorkerAsync(); }
// Linking Simplex and Genetic algorithms private void button4_Click(object sender, EventArgs e) { BackgroundWorker Work_Thread = new BackgroundWorker(); Work_Thread.DoWork += new DoWorkEventHandler(delegate(object sender2, DoWorkEventArgs e2) { Optimized_Simplex_Algorithm OSA = new Optimized_Simplex_Algorithm(); Tuple<string, List<Solution>> Results = OSA.Optimized_Simplex_Algorithm_Start(task, 1); Genetic_Algorithm GA = new Genetic_Algorithm(); e2.Result = GA.Genetic_Algorithm_Start(task, new List<Solution>(Results.Item2), 1); }); Work_Thread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object sender3, RunWorkerCompletedEventArgs e3) { Create_Form("Linking Simplex and Genetic algorithms", (string)e3.Result); }); Work_Thread.RunWorkerAsync(); }