Agent using reinforcement learning to get the optimum policy