Exemplo n.º 1
0
 private void ResetTray()
 {
     if (tray != null)
     {
         tray.Close();
         tray = null;
     }
 }
Exemplo n.º 2
0
        private void buttonRun_Click(object sender, EventArgs e)
        {
            if (listCriteria.SelectedIndices.Count <= 0)
            {
                // TODO: Handle this properly
                return;
            }

            int selectedIndex = listCriteria.SelectedIndices[0];

            RefreshBionicModel(((CriteriaListItem)listCriteria.Items[selectedIndex]).CriterionId);

            if (bionicModel == null)
            {
                // TODO: Handle this properly
                return;
            }

            string calcAppPath = textCalcApp.Text.Trim();

            if (string.IsNullOrEmpty(calcAppPath))
            {
                // TODO: Handle this properly
                return;
            }

            InitResultTable(tableResults);
            if (tray == null)
            {
                tray = new Tray();
                InitResultTable(tray.tableResults);
            }

            BionicSolverSettings solverSettings = new BionicSolverSettings()
            {
                ApplyElitism = Program.ApplicationSettings.ApplyElitism,
                CalcApplicationCommandLineArgumentsFormat = Program.ApplicationSettings.CalcAppCommandLineArgsFormat,
                CalcApplicationPath     = calcAppPath,
                DescendantsNum          = Program.ApplicationSettings.DescendantsNum,
                DescendantsRangePercent = Program.ApplicationSettings.DescendantsRangePercent,
                InitialPopulationSize   = Program.ApplicationSettings.InitialPopulationSize,
                MaxGenerations          = Program.ApplicationSettings.MaxGenerations,
                SelectionCap            = Program.ApplicationSettings.SelectionCap
            };

            BionicSolver solver = InitSolver();

            solver.Solve(bionicModel, solverSettings);
        }