private void Btn_start_Clicked(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Neural Network Json | *.json"; DialogResult dr = ofd.ShowDialog(); if (dr == DialogResult.OK) { Network n = Network.LoadFromFile(ofd.FileName); GeneticAlgorithm.Initialize(false); for (int i = 0; i < GeneticAlgorithm.evolviAmount; i++) { Random RNG = new Random(); Evolvi j = new Evolvi(new Vector2(RNG.Next(100, 1900), RNG.Next(100, 1900)), false); j.Network = n.Clone(); GeneticAlgorithm.CurrentGeneration.Add(j); Thread.Sleep(50); } ScreenManager.SetScreen("SC_EVO"); } else { ScreenModal.ShowDialog("You did not choose a file, try again.", ModalButtons.OK); } }
private void Btn_exit_Clicked(object sender, EventArgs e) { ScreenModal.ShowDialog("Would you like to save the best neural network?", ModalButtons.YesNoCancel); }
private void Btn_start_withoutload_Clicked(object sender, EventArgs e) { ScreenModal.ShowDialog("This will create a new, empty, evolution. \nProceed?", ModalButtons.YesNo); }
private void Btn_cancel_Clicked(object sender, EventArgs e) { ScreenModal.ShowDialog("Are you sure you want to cancel?", ModalButtons.YesNo); }