Reinforcement learning for control