A reinforcement learning model of visually guided braking