Ejemplo n.º 1
0
 /**
  * Construct a species.
  *
  * @param population The population the species belongs to.
  * @param first The first genome in the species.
  * @param speciesID The species id.
  */
 public BasicSpecies(Population population, Genome first, long speciesID) {
   this.population = population;
   this.speciesID = speciesID;
   this.bestScore = first.getScore();
   this.gensNoImprovement = 0;
   this.age = 0;
   this.leader = first;
   this.spawnsRequired = 0;
   this.members.add(first);
 }
Ejemplo n.º 2
0
 /** Calculate the amount to spawn. */
 public void calculateSpawnAmount() {
   this.spawnsRequired = 0;
   for (final Genome genome : this.members) {
     this.spawnsRequired += genome.getAmountToSpawn();
   }
 }