Green Energy Scheduling for Demand Side Management in the Smart Grid