Adaptive Choice of Grid and Time in Reinforcement Learning