Reinforcement Learning For Self-Adapting Time Discretizations Of Complex Systems