mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
refactor(ai): move fitness.py
This commit is contained in:
parent
b877fc2a59
commit
4a985b7e01
3
src/ai/fitness/__init__.py
Normal file
3
src/ai/fitness/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from .fitness import calculate_fitness
|
||||||
|
|
||||||
|
__all__ = ["calculate_fitness"]
|
||||||
@ -5,8 +5,6 @@ import numpy as np
|
|||||||
from game import Game
|
from game import Game
|
||||||
from utils import CONFIG
|
from utils import CONFIG
|
||||||
|
|
||||||
from .log import log
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_fitness(game: Game) -> float:
|
def calculate_fitness(game: Game) -> float:
|
||||||
field = np.where(game.field != None, 1, 0)
|
field = np.where(game.field != None, 1, 0)
|
||||||
@ -15,10 +13,6 @@ def calculate_fitness(game: Game) -> float:
|
|||||||
return fitness
|
return fitness
|
||||||
|
|
||||||
|
|
||||||
def get_peaks(field: np.ndarray) -> int:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def get_row_transitions(field: np.ndarray) -> int:
|
def get_row_transitions(field: np.ndarray) -> int:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user