In this paper, we consider the problem of optimizing the portfolio of an aggregator that interacts with the energy grid via bilateral contracts. The purpose of the contracts is to achieve the pointwise procurement of energy to the grid. The challenge raised by the coordination of scattered resources and the securing of obligations over the planning horizon is addressed through a twin-time scale model, where robust short term operational decisions are contingent on long term resource usage incentives that embed the full extent of contract specifications. A contract is said to be valid at week t if week t is within the contract’s validity period and if it has a positive number of request tokens left at the end of week t − 1. A resource contract that has announced a maintenance for week t is not valid at week t. Contract Level information. Projected Flow information. set of weeks. set of time slots in week t. duration of time slot s ∈ S(t). set of time slots types. type of time slot s ∈ S(t). set of demands (grid contracts). set of resources (generator’s contracts). set of valid demand contracts in time slot s ∈ S(t). set of valid resource contracts in time slot s ∈ S(t). set of valid and compatible demand/resource contract pairs in time slot s ∈ S(t). set of valid resources in time slot s ∈ S(t) that are compatible with demand i. set of valid demands in time slot s ∈ S(t) that are compatible with resource i. set of demand contracts in time slots of type k. subset of valid demand contracts in D ^ k forming the ℓth horizontal slice of the corresponding demand histogram. number of slices in histogram associated with demand D ^ k . slide indices for time slot type k: Lk = [1, … , nk ]. static feasibility set associated with resource set R and demand set D. robust feasible at week t. set of feasible demand request scenarios. subset of feasible demand request scenarios compatible with the uniform forecast. amount of mobilization m used in time slots of type k along the ℓth slice (to respond to simultaneous requests from demands D ^ k ℓ ). binary decision variable set to 1 if resource i is assigned to demand j in time slot s ∈ S(t). binary parameters set to 1 if demand j makes a request in time slot s ∈ S(t). upper bound on the expected number of simultaneous requests from demands D ^ k ℓ in time slots of type k. expected number of requests from demand j in time slots of type k. number of request tokens for resource i at the beginning of week t. number of requests tokens for demand j at the beginning of week t. adjusted cost of resource i for demand j at time slot s ∈ S(t). cost for the mobilization of resource i for one unit of time. set of mobilizations for time slots of type k for demands in D ^ k ℓ . total cost of resource mobilization for mobilization m ∈ M kℓ. mobilization incidence matrix associated with slice ℓ of time slot type k. duration of time slot s ∈ S(t). power delivered (resp. received) for resource (resp. demand) ℓ. 
Optimal design of bilateral contracts for energy procurement