Exemple #1
0
        public void CreateItems()
        {
            rowCountControl         = new NumericUpDown();
            rowCountControl.Minimum = 10;
            rowCountControl.Maximum = 100;
            SettingItemGUI rowCount = new SettingItemGUI("Number of rows",
                                                         snakeSettings.rowCount.ToString(),
                                                         rowCountControl);

            columnCountControl         = new NumericUpDown();
            columnCountControl.Minimum = 10;
            columnCountControl.Maximum = 100;
            SettingItemGUI columnCount = new SettingItemGUI("Number of columns",
                                                            snakeSettings.columnCount.ToString(),
                                                            columnCountControl);

            settingItems.Add(rowCount);
            settingItems.Add(columnCount);
        }
        private void CreateItems()
        {
            NumericUpDown inputNeuronsControl = new NumericUpDown();

            inputNeuronsControl.Minimum = 1;
            inputNeuronsControl.Value   = networkSettings.numberOfInputNeurons;
            inputNeuronsControl.Enabled = false;
            SettingItemGUI numberOfInputNeurons = new SettingItemGUI("Number of input neurons",
                                                                     networkSettings.numberOfInputNeurons.ToString(),
                                                                     inputNeuronsControl);

            hiddenLayersControl               = new NumericUpDown();
            hiddenLayersControl.Value         = networkSettings.numberOfHiddenNeurons.Length;
            hiddenLayersControl.ValueChanged += OnHiddenLayersChanged;
            hiddenLayersControl.Minimum       = 1;
            hiddenLayersControl.Maximum       = 6;
            hiddenLayersControl.ReadOnly      = true;
            hiddenLayersPrev = hiddenLayersControl.Value;
            SettingItemGUI numberOfHiddenLayers = new SettingItemGUI("Number of hidden layers",
                                                                     networkSettings.numberOfHiddenNeurons.Length.ToString(),
                                                                     hiddenLayersControl);

            hiddenNeuronsControl = new HiddenNeuronControlGUI(networkSettings);
            SettingItemGUI numberOfHiddenNeurons = new SettingItemGUI("Number of hidden neurons",
                                                                      networkSettings.numberOfHiddenNeurons.Length.ToString(),
                                                                      hiddenNeuronsControl);

            NumericUpDown outputNeuronsControl = new NumericUpDown();

            outputNeuronsControl.Minimum = 1;
            outputNeuronsControl.Value   = networkSettings.numberOfOutputNeurons;
            outputNeuronsControl.Enabled = false;
            SettingItemGUI numberOfOutputNeurons = new SettingItemGUI("Number of output neurons",
                                                                      networkSettings.numberOfOutputNeurons.ToString(),
                                                                      outputNeuronsControl);

            settingItems.Add(numberOfInputNeurons);
            settingItems.Add(numberOfHiddenLayers);
            settingItems.Add(numberOfHiddenNeurons);
            settingItems.Add(numberOfOutputNeurons);
        }
Exemple #3
0
        public void CreateItems()
        {
            // FLYT TOOLTIPS STRINGS IND I GENETIC SETTINGS SÅ DE KAN GENBRUGES


            populationSizeControl         = new NumericUpDown();
            populationSizeControl.Maximum = int.MaxValue;
            SettingItemGUI populationSize = new SettingItemGUI("Population size",
                                                               geneticSettings.PopulationSize.ToString(),
                                                               populationSizeControl,
                                                               "test");

            //populationSize.ToolTipText = "The size of the population in each generation.";

            selectionSizeControl         = new NumericUpDown();
            selectionSizeControl.Maximum = populationSizeControl.Value - 1;
            SettingItemGUI selectionSize = new SettingItemGUI("Selection size",
                                                              geneticSettings.SelectionSize.ToString(),
                                                              selectionSizeControl);

            //selectionSize.ToolTipText = "The number of agents chosen to be parents.";

            mutationGeneControl               = new NumericUpDown();
            mutationGeneControl.Maximum       = 100;
            mutationGeneControl.DecimalPlaces = 1;
            mutationGeneControl.Increment     = 0.1M;
            SettingItemGUI geneMutation = new SettingItemGUI("Gene mutation chance",
                                                             (geneticSettings.MutationProbabilityGenes * 100).ToString(),
                                                             mutationGeneControl);

            //geneMutation.ToolTipText = "The chance for any single gene to be mutated.";

            mutationAgentControl               = new NumericUpDown();
            mutationAgentControl.Maximum       = 100;
            mutationAgentControl.DecimalPlaces = 1;
            mutationAgentControl.Increment     = 0.1M;
            SettingItemGUI agentMutation = new SettingItemGUI("Agent mutation chance",
                                                              (geneticSettings.MutationProbabiltyAgents * 100).ToString(),
                                                              mutationAgentControl);

            //agentMutation.ToolTipText = "The chance for any single agent to be mutated.";

            chromosomeSize = new SettingItemGUI("Chromesome size",
                                                geneticSettings.GeneCount.ToString(),
                                                new TextBox());
            //chromosomeSize.ToolTipText = "The number of genes in an agent's chromosome.";
            chromosomeSize.EditControl.Enabled = false;

            selectionMethodControl = new ComboBox();
            selectionMethodControl.DropDownStyle = ComboBoxStyle.DropDownList;
            selectionMethodControl.Items.Add(geneticSettings.SelectionMethod);
            SettingItemGUI selectionMethod = new SettingItemGUI("Selection method",
                                                                geneticSettings.SelectionMethod.ToString(),
                                                                selectionMethodControl);

            //selectionMethod.ToolTipText = "The chosen method for selection."; // BESKRIV SPECIFIK METHOD

            crossOverMethodControl = new ComboBox();
            crossOverMethodControl.DropDownStyle = ComboBoxStyle.DropDownList;
            crossOverMethodControl.Items.Add(geneticSettings.CrossoverMethod);

            SettingItemGUI crossOverMethod = new SettingItemGUI("Crossover method",
                                                                geneticSettings.CrossoverMethod.ToString(),
                                                                crossOverMethodControl);

            //crossOverMethod.ToolTipText = "The chosen method for crossover."; // BESKRIV SPECIFIK METHOD

            settingItems.Add(populationSize);
            settingItems.Add(selectionSize);
            settingItems.Add(geneMutation);
            settingItems.Add(agentMutation);
            settingItems.Add(chromosomeSize);
            settingItems.Add(selectionMethod);
            settingItems.Add(crossOverMethod);
        }