Beispiel #1
0
 public Parameters(int popSize, EncodingInformation encoding, SelectionInformation selection,
                   CrossoverInformation crossover, MutationInformation mutation, StoppingInformation stopping)
 {
     _populationSize = popSize;
     _encodingInfo   = encoding;
     _selectionInfo  = selection;
     _crossoverInfo  = crossover;
     _mutationInfo   = mutation;
     _stoppingInfo   = stopping;
 }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     gerberLib     = new LibGerberVS();
     project       = gerberLib.CreateNewProject();
     renderInfo    = new RenderInformation();
     selectionInfo = new SelectionInformation();
     RenderModeComboBox.SelectedIndex = 0;
     renderMode = GerberRenderMode.TranslateToCentre;
     pcbImagePanel.BackColor = Color.Black;
     project.BackgroundColor = pcbImagePanel.BackColor;
     fullScreen = false;
     UpdateMenus();
 }
Beispiel #3
0
        public static Chromosome PerformSelection(Chromosome[] population, SelectionInformation info)
        {
            switch (info.Type)
            {
            case SelectionType.Tournament:
                return(Tournament(population, info.TournamentSize));

            case SelectionType.RouletteWheel:
                return(Roulette(population));

            case SelectionType.Rank:
                return(Rank(population, info.AlphaRank, info.BetaRank));
            }

            return(null);
        }
Beispiel #4
0
        private void InitGA()
        {
            popSize = Settings.s0;
            noGen   = Settings.ngen;

            EncodingInformation enc = new EncodingInformation(n, EncodingType.RealValued);

            for (int i = 0; i < n; i++)
            {
                enc.MinValues[i] = Settings.minval;
                enc.MaxValues[i] = Settings.maxval;
            }

            SelectionInformation sel = new SelectionInformation
            {
                Type           = SelectionType.Tournament,
                TournamentSize = 2,
                Elitism        = 1
            };

            CrossoverInformation cro = new CrossoverInformation
            {
                Type        = CrossoverType.ArithmeticInteger,
                Probability = 0.9
            };

            MutationInformation mut = new MutationInformation
            {
                Type = MutationType.Gaussian,
                StandardDeviation = Settings.sigma,
                Probability       = Settings.pm
            };

            StoppingInformation stop = new StoppingInformation
            {
                Type           = StoppingType.Generations,
                MaxGenerations = noGen
            };

            _parameters = new Parameters(popSize, enc, sel, cro, mut, stop);
        }
Beispiel #5
0
 public SelectionPropertiesFrm(SelectionInformation selectionInfo)
 {
     InitializeComponent();
     this.selectionInfo = selectionInfo;
 }