Optimal generation rescheduling in microgrids under uncertainty