make fully stateful in module ga.

This commit is contained in:
wls2002
2024-05-25 16:47:25 +08:00
parent 485d481745
commit c0a7503168
5 changed files with 24 additions and 10 deletions

View File

@@ -1,3 +1,10 @@
from utils import State
class BaseCrossover:
def __call__(self, randkey, genome, nodes1, nodes2, conns1, conns2):
def setup(self, state=State()):
return state
def __call__(self, state, key, genome, nodes1, nodes2, conns1, conns2):
raise NotImplementedError