Safe reinforcement learning: A control barrier function optimization approach. (11th August 2020)