Optimisation of the Accelerator Control by Reinforcement Learning: A Simulation-Based Approach