A reinforcement learning approach to hybrid control design