コード例 #1
0
ファイル: population.py プロジェクト: FaydSpeare/NEAT
    def speciate(self):
        for spec in self.population:
            spec.entities = []
        for entity in self.population:

            suitable_species = False

            for spec in self.species:
                if Species.are_compatible(spec.standard, entity.brain):
                    spec.add(entity)
                    suitable_species = True
                    break

            if not suitable_species:
                self.species.append(Species(entity, self.spec_innov))
                self.spec_innov += 1