All function with state will update the state and return it.

Remove randkey args in functions with state, since it can attach the randkey by states.
This commit is contained in:
wls2002
2024-05-25 20:45:57 +08:00
parent 5626fddf41
commit 79d53ea7af
12 changed files with 84 additions and 70 deletions

View File

@@ -9,13 +9,13 @@ class BaseGene:
def __init__(self):
pass
def setup(self, key, state=State()):
def setup(self, state=State()):
return state
def new_attrs(self, state, key):
def new_attrs(self, state):
raise NotImplementedError
def mutate(self, state, key, gene):
def mutate(self, state, gene):
raise NotImplementedError
def distance(self, state, gene1, gene2):