Package org.encog.ml.genetic.genome

Examples of org.encog.ml.genetic.genome.Genome


      calculateScore(genome);
    }

    getPopulation().sort();

    final Genome genome = getPopulation().getBest();
    final double currentBest = genome.getScore();

    if (getComparator().isBetterThan(currentBest, this.bestEverScore)) {
      this.bestEverScore = currentBest;
      this.bestEverNetwork = ((NEATNetwork) genome.getOrganism());
    }

    this.bestEverScore = getComparator().bestScore(getError(),
        this.bestEverScore);
  }
View Full Code Here


    }

    // set the species leader links
    for (Species species : leaderMap.keySet()) {
      int leaderID = leaderMap.get(species);
      Genome leader = genomeMap.get(leaderID);
      species.setLeader(leader);
      ((BasicSpecies)species).setPopulation(result);
    }

    return result;
View Full Code Here

  public class NeuralGeneticAlgorithmHelper extends BasicGeneticAlgorithm {
    /**
     * @return The error from the last iteration.
     */
    public final double getError() {
      final Genome genome = getPopulation().getBest();
      return genome.getScore();
    }
View Full Code Here

     * Get the current best neural network.
     *
     * @return The current best neural network.
     */
    public final MLMethod getMethod() {
      final Genome genome = getPopulation().getBest();
      return (BasicNetwork) genome.getOrganism();
    }
View Full Code Here

   *
   * @return The parent.
   */
  @Override
  public final Genome chooseParent() {
    Genome baby;

    // If there is a single member, then choose that one.
    if (this.members.size() == 1) {
      baby = this.members.get(0);
    } else {
View Full Code Here

    final TaskGroup group = EngineConcurrency.getInstance()
        .createTaskGroup();

    // mate and form the next generation
    for (int i = 0; i < countToMate; i++) {
      final Genome mother = getPopulation().getGenomes().get(i);
      final int fatherInt = (int) (Math.random() * matingPopulationSize);
      final Genome father = getPopulation().getGenomes().get(fatherInt);
      final Genome child1 = getPopulation().getGenomes().get(
          offspringIndex);
      final Genome child2 = getPopulation().getGenomes().get(
          offspringIndex + 1);

      final MateWorker worker = new MateWorker(mother, father, child1,
          child2);

View Full Code Here

      String prefix = dialog.getPrefix().getValue();
      int count = dialog.getGenomesToExtract().getValue();
     
      for(int i=0;i<count;i++)
      {
        Genome genome = this.population.getGenomes().get(i);
        genome.decode();
        NEATNetwork network = (NEATNetwork)genome.getOrganism();
        String name = FileUtil.forceExtension( prefix + i, "eg" );
        File path = new File(EncogWorkBench.getInstance().getProjectDirectory(),name);
        EncogWorkBench.getInstance().save(path, network);
       
      }
View Full Code Here

   
    String type = "Unknown";
   
    if( population.getGenomes().size()>0 )
    {
      Genome genome = population.getGenomes().get(0);
      if( genome instanceof NEATGenome )
      {
        type = "Neat";
      }
      else if( genome instanceof NeuralGenome )
View Full Code Here

TOP

Related Classes of org.encog.ml.genetic.genome.Genome

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.