Resource Allocation And Load-Shedding Policies Based On Markov Decision Processes For Renewable Energy Generation And Storage