Package org.encog.ml.ea.population

Examples of org.encog.ml.ea.population.BasicPopulation


  public MLMethodGeneticAlgorithm(final MethodFactory phenotypeFactory,
      final CalculateScore calculateScore, final int populationSize) {
    super(TrainingImplementationType.Iterative);

    // Create the population
    final Population population = new BasicPopulation(populationSize, null);
    final Species defaultSpecies = population.createSpecies();

    for (int i = 0; i < population.getPopulationSize(); i++) {
      final MLEncodable chromosomeNetwork = (MLEncodable) phenotypeFactory
          .factor();
      final MLMethodGenome genome = new MLMethodGenome(chromosomeNetwork);
      defaultSpecies.add(genome);
    }
    defaultSpecies.setLeader(defaultSpecies.getMembers().get(0));
   
    population.setGenomeFactory(new MLMethodGenomeFactory(phenotypeFactory,
        population));
   
    // create the trainer
    this.genetic = new MLMethodGeneticAlgorithmHelper(population,
        calculateScore);
View Full Code Here

TOP

Related Classes of org.encog.ml.ea.population.BasicPopulation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.