@classmethod
def index(cls, state):
    """
        Return the `state` index in the state space.

        :param state: state representation
        :type state: OrderedDict
        :rtype: int
        """
    i = 0
    index = 0
    for _, value in state.items():
        index += value * 2 ** i
        i += 1
    return index
