use black format all files;

remove "return state" for functions which will be executed in vmap;
recover randkey as args in mutation methods
This commit is contained in:
wls2002
2024-05-26 15:46:04 +08:00
parent 79d53ea7af
commit cf69b916af
38 changed files with 932 additions and 582 deletions

View File

@@ -1,15 +1,20 @@
from utils import State
from ..genome import BaseGenome
class BaseSpecies:
def setup(self, key, state=State()):
genome: BaseGenome
pop_size: int
species_size: int
def setup(self, state=State()):
return state
def ask(self, state: State):
raise NotImplementedError
def update_species(self, state, fitness, generation):
def update_species(self, state, fitness):
raise NotImplementedError
def speciate(self, state, generation):
def speciate(self, state):
raise NotImplementedError