diff --git a/src/ai/heuristics/bumpiness.py b/src/ai/heuristics/bumpiness.py index 03b4828..17c57ae 100644 --- a/src/ai/heuristics/bumpiness.py +++ b/src/ai/heuristics/bumpiness.py @@ -4,4 +4,13 @@ import numpy as np def bumpiness( field: np.ndarray[int, np.dtype[np.uint8]], ) -> int: - pass + """ + Calculate the bumpiness of a given signal based on peaks. + + Args: + field: The game field. + + Returns: + The bumpiness of the field. + """ + return int(np.sum(np.abs(np.diff(field.shape[0] - np.argmax(field, axis=0)))))