Package org.encog.ml.genetic.species

Examples of org.encog.ml.genetic.species.Species


  public int getRowCount() {
    return this.population.getSpecies().size();
  }

  public Object getValueAt(int rowIndex, int columnIndex) {
    Species species = this.population.getSpecies().get(rowIndex);
   
    String leader = "none";
   
    if( species.getLeader()!=null )
      leader = Format.formatInteger((int)species.getLeader().getGenomeID());
   
    switch(columnIndex)
    {
      case 0:
        return Format.formatInteger((int)species.getSpeciesID());
      case 1:
        return Format.formatInteger(species.getAge());
      case 2:
        return Format.formatDouble(species.getBestScore(),4);
      case 3:
        return Format.formatInteger(species.getGensNoImprovement());
      case 4:
        return leader;
      case 5:
        return Format.formatInteger(species.getMembers().size());
      default:
        return "";
    }
   
  }
View Full Code Here


    this.averageFitAdjustment = 0;

    final Object[] speciesArray = getPopulation().getSpecies().toArray();

    for (final Object element : speciesArray) {
      final Species s = (Species) element;
      s.purge();

      if ((s.getGensNoImprovement() > this.paramNumGensAllowedNoImprovement)
          && getComparator().isBetterThan(this.bestEverScore,
              s.getBestScore())) {
        getPopulation().getSpecies().remove(s);
      }
    }
  }
View Full Code Here

    // first put all the genomes into correct species
    for (Genome genome : result.getGenomes()) {
      NEATGenome neatGenome = (NEATGenome) genome;
      int speciesId = (int) neatGenome.getSpeciesID();
      Species species = speciesMap.get(speciesId);
      if (species != null) {
        species.getMembers().add(neatGenome);
      }
      neatGenome.setInputCount(result.getInputCount());
      neatGenome.setOutputCount(result.getOutputCount());
    }

    // 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

TOP

Related Classes of org.encog.ml.genetic.species.Species

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.