A bi-layer multi-time coordination method for optimal generation and reserve schedule and dispatch of a grid-connected microgrid