Text this: A Bi-Level Optimization Model for Flexible Capacity Allocation with Coordinated Planning and Operation