def METHOD_NAME(self, archive: utils.Archive[utils.MultiValue], num: tp.Optional[int] = None) -> tp.Any:
    """Apply a roulette tournament selection."""
    if num is None:
        num = int(0.999 + np.sqrt(len(archive)))
    # the following sort makes the line deterministic, and function seedable, at the cost of complexity!
    my_keys = sorted(archive.bytesdict.keys())
    my_keys_indices = self.random_state.choice(len(my_keys), size=min(num, len(my_keys)), replace=False)
    my_keys = [my_keys[i] for i in my_keys_indices]
    # best pessimistic value in a random set of keys
    return np.frombuffer(min(my_keys, key=lambda x: archive.bytesdict[x].pessimistic_confidence_bound))