Exemplo n.º 1
0
    public static OffspringSelectionGeneticAlgorithm CreateGpMultiplexerSample() {
      var problem = new HeuristicLab.Problems.GeneticProgramming.Boolean.MultiplexerProblem();
      problem.Name = "11-Multiplexer Problem";
      problem.Encoding.TreeLength = 50;
      problem.Encoding.TreeDepth = 50;

      var osga = new OffspringSelectionGeneticAlgorithm();
      osga.Name = "Genetic Programming - Multiplexer 11 Problem";
      osga.Description = "A genetic programming algorithm that solves the 11-bit multiplexer problem.";
      osga.Problem = problem;
      SamplesUtils.ConfigureOsGeneticAlgorithmParameters<GenderSpecificSelector, SubtreeCrossover, MultiSymbolicExpressionTreeManipulator>
        (osga, popSize: 100, elites: 1, maxGens: 50, mutationRate: 0.25);
      osga.MaximumSelectionPressure.Value = 200;
      return osga;

    }
        public static OffspringSelectionGeneticAlgorithm CreateGpMultiplexerSample()
        {
            var problem = new HeuristicLab.Problems.GeneticProgramming.Boolean.MultiplexerProblem();

            problem.Name = "11-Multiplexer Problem";
            problem.Encoding.TreeLength = 50;
            problem.Encoding.TreeDepth  = 50;

            var osga = new OffspringSelectionGeneticAlgorithm();

            osga.Name        = "Genetic Programming - Multiplexer 11 Problem";
            osga.Description = "A genetic programming algorithm that solves the 11-bit multiplexer problem.";
            osga.Problem     = problem;
            SamplesUtils.ConfigureOsGeneticAlgorithmParameters <GenderSpecificSelector, SubtreeCrossover, MultiSymbolicExpressionTreeManipulator>
                (osga, popSize: 100, elites: 1, maxGens: 50, mutationRate: 0.25);
            osga.MaximumSelectionPressure.Value = 200;
            return(osga);
        }