/** * 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); }
/** Calculate the amount to spawn. */ public void calculateSpawnAmount() { this.spawnsRequired = 0; for (final Genome genome : this.members) { this.spawnsRequired += genome.getAmountToSpawn(); } }