@staticmethod
def slice_state_history(states, slice_length):
    """Slices states from the trackers history.

        If the slice is at the array borders, padding will be added to ensure
        the slice length."""
    slice_end = len(states)
    slice_start = max(0, slice_end - slice_length)
    padding = [None] * max(0, slice_length - slice_end)
    state_features = padding + states[slice_start:]
    return state_features
