mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
feat(ai): add fitness calculation function templates
This commit is contained in:
parent
90eac234ec
commit
daadaeb2c6
@ -15,6 +15,30 @@ 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:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_col_transitions(field: np.ndarray) -> int:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_bumpiness(field: np.ndarray) -> int:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_holes(field: np.ndarray) -> int:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_wells(field: np.ndarray) -> int:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _calc_holes(field: np.ndarray) -> float:
|
def _calc_holes(field: np.ndarray) -> float:
|
||||||
height, width = field.shape
|
height, width = field.shape
|
||||||
penalty = 0
|
penalty = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user