Thinking fast or slow? A reinforcement learning approach