'Return the action corresponding to the given direction. This is a helper method for debugging and testing
purposes.
:return: the action index corresponding to the given direction'

@staticmethod
def action_from_direction(d):

    return dict(left=0, down=1, right=2, up=3)[d]
