Resilient Computing with Reinforcement Learning on a Dynamical System: Case Study in Sorting