Reinforcement Learning for Flexibility Design Problems