{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,5]],"date-time":"2026-02-05T23:49:04Z","timestamp":1770335344335,"version":"3.49.0"},"reference-count":37,"publisher":"MDPI AG","issue":"13","license":[{"start":{"date-parts":[[2025,7,1]],"date-time":"2025-07-01T00:00:00Z","timestamp":1751328000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"PRR-Plano de Recupera\u00e7\u00e3o e Resili\u00eancia","award":["C644914747-00000023"],"award-info":[{"award-number":["C644914747-00000023"]}]},{"name":"PRR-Plano de Recupera\u00e7\u00e3o e Resili\u00eancia","award":["170\/2024\/BI\/AgendasPRR"],"award-info":[{"award-number":["170\/2024\/BI\/AgendasPRR"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Energies"],"abstract":"<jats:p>Given the increasing energy demand and the environmental consequences of fossil fuel consumption, the shift toward sustainable energy sources has become a global priority. Renewable Energy Communities (RECs)\u2014comprising citizens, businesses, and legal entities\u2014are emerging to democratise access to renewable energy. These communities allow members to produce their own energy, sharing or selling any surplus, thus promoting sustainability and generating economic value. However, scaling RECs while ensuring profitability is challenging due to renewable energy intermittency, price volatility, and heterogeneous consumption patterns. To address these issues, this paper presents a Machine Learning as a Service (MLaaS) framework, where each REC microgrid has a customised Reinforcement Learning (RL) agent and electricity price forecasts are included to support decision-making. All the conducted experiments, using the open-source simulator Pymgrid, demonstrate that the proposed agents reduced operational costs by up to 96.41% compared to a robust baseline heuristic. Moreover, this study also introduces two cost-saving features: Peer-to-Peer (P2P) energy trading between communities and internal energy pools, allowing microgrids to draw local energy before using the main grid. Combined with the best-performing agents, these features achieved trading cost reductions of up to 45.58%. Finally, in terms of deployment, the system relies on an MLOps-compliant infrastructure that enables parallel training pipelines and an autoscalable inference service. Overall, this work provides significant contributions to energy management, fostering the development of more sustainable, efficient, and cost-effective solutions.<\/jats:p>","DOI":"10.3390\/en18133477","type":"journal-article","created":{"date-parts":[[2025,7,1]],"date-time":"2025-07-01T09:29:01Z","timestamp":1751362141000},"page":"3477","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":5,"title":["Intelligent Management of Renewable Energy Communities: An MLaaS Framework with RL-Based Decision Making"],"prefix":"10.3390","volume":"18","author":[{"ORCID":"https:\/\/orcid.org\/0009-0002-8628-8262","authenticated-orcid":false,"given":"Rafael","family":"Gon\u00e7alves","sequence":"first","affiliation":[{"name":"Instituto de Telecomunica\u00e7\u00f5es, 3810-193 Aveiro, Portugal"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5848-2802","authenticated-orcid":false,"given":"Diogo","family":"Gomes","sequence":"additional","affiliation":[{"name":"Instituto de Telecomunica\u00e7\u00f5es, 3810-193 Aveiro, Portugal"},{"name":"Departamento de Eletr\u00f3nica, Telecomunica\u00e7\u00f5es e Inform\u00e1tica, University of Aveiro, 3810-193 Aveiro, Portugal"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6504-9441","authenticated-orcid":false,"given":"M\u00e1rio","family":"Antunes","sequence":"additional","affiliation":[{"name":"Instituto de Telecomunica\u00e7\u00f5es, 3810-193 Aveiro, Portugal"},{"name":"Departamento de Eletr\u00f3nica, Telecomunica\u00e7\u00f5es e Inform\u00e1tica, University of Aveiro, 3810-193 Aveiro, Portugal"}]}],"member":"1968","published-online":{"date-parts":[[2025,7,1]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"38","DOI":"10.1016\/j.esr.2019.01.006","article-title":"The role of renewable energy in the global energy transformation","volume":"24","author":"Gielen","year":"2019","journal-title":"Energy Strategy Rev."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"e04511","DOI":"10.1016\/j.heliyon.2020.e04511","article-title":"Renewable energy community and the European energy market: Main motivations","volume":"6","author":"Soeiro","year":"2020","journal-title":"Heliyon"},{"key":"ref_3","unstructured":"Nations, U. (2015). Transforming our World: The 2030 Agenda for Sustainable Development, United Nations, Department of Economic and Social Affairs."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"96","DOI":"10.1016\/j.rser.2018.02.007","article-title":"Intermittent and stochastic character of renewable energy sources: Consequences, cost of intermittence and benefit of forecasting","volume":"87","author":"Notton","year":"2018","journal-title":"Renew. Sustain. Energy Rev."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"14072","DOI":"10.1016\/j.egyr.2022.10.347","article-title":"Artificial intelligence in renewable energy: A comprehensive bibliometric analysis","volume":"8","author":"Zhang","year":"2022","journal-title":"Energy Rep."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Alwan, N.T., Majeed, M.H., Shcheklein, S.E., Ali, O.M., and PraveenKumar, S. (2021). Experimental Study of a Tilt Single Slope Solar Still Integrated with Aluminum Condensate Plate. Inventions, 6.","DOI":"10.3390\/inventions6040077"},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Praveenkumar, S., Gulakhmadov, A., Kumar, A., Safaraliev, M., and Chen, X. (2022). Comparative Analysis for a Solar Tracking Mechanism of Solar PV in Five Different Climatic Locations in South Indian States: A Techno-Economic Feasibility. Sustainability, 14.","DOI":"10.3390\/su141911880"},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"100197","DOI":"10.1016\/j.egyai.2022.100197","article-title":"A new hybrid AI optimal management method for renewable energy communities","volume":"10","author":"Conte","year":"2022","journal-title":"Energy AI"},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"25","DOI":"10.1049\/stg2.12049","article-title":"Exploring regression models to enable monitoring capability of local energy communities for self-management in low-voltage distribution networks","volume":"5","author":"Mai","year":"2022","journal-title":"IET Smart Grid"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Du, Y., Mendes, N., Rasouli, S., Mohammadi, J., and Moura, P. (2023). Federated Learning Assisted Distributed Energy Optimization. arXiv.","DOI":"10.1049\/rpg2.13101"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Matos, M., Almeida, J., Gon\u00e7alves, P., Baldo, F., Braz, F.J., and Bartolomeu, P.C. (2024). A Machine Learning-Based Electricity Consumption Forecast and Management System for Renewable Energy Communities. Energies, 17.","DOI":"10.3390\/en17030630"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"100329","DOI":"10.1016\/j.egyai.2023.100329","article-title":"Reconstructing hourly residential electrical load profiles for Renewable Energy Communities using non-intrusive machine learning techniques","volume":"15","author":"Giannuzzo","year":"2024","journal-title":"Energy AI"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"104538","DOI":"10.1016\/j.scs.2023.104538","article-title":"A bi-level reinforcement learning model for optimal scheduling and planning of battery energy storage considering uncertainty in the energy-sharing community","volume":"94","author":"Kang","year":"2023","journal-title":"Sustain. Cities Soc."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Denysiuk, R., Lilliu, F., Recupero, D.R., and Vinyals, M. (2020, January 22\u201324). Peer-to-peer Energy Trading for Smart Energy Communities. Proceedings of the 12th International Conference on Agents and Artificial Intelligence, Valletta, Malta. Volume 1: ICAART. INSTICC.","DOI":"10.5220\/0008915400400049"},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Limmer, S. (2023). Empirical Study of Stability and Fairness of Schemes for Benefit Distribution in Local Energy Communities. Energies, 16.","DOI":"10.3390\/en16041756"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"607","DOI":"10.1109\/TSG.2023.3288533","article-title":"Collective Asset Sharing Mechanisms for PV and BESS in Renewable Energy Communities","volume":"15","author":"Guedes","year":"2024","journal-title":"IEEE Trans. Smart Grid"},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"11103","DOI":"10.1109\/TII.2024.3390595","article-title":"Price-Matching-Based Regional Energy Market With Hierarchical Reinforcement Learning Algorithm","volume":"20","author":"Zhang","year":"2024","journal-title":"IEEE Trans. Ind. Informatics"},{"key":"ref_18","unstructured":"Karakolis, E., Pelekis, S., Mouzakitis, S., Markaki, O., Papapostolou, K., Korbakis, G., and Psarras, J. (2022, January 12\u201314). Artificial intelligence for next generation energy services across Europe\u2013the I-Nergy project. Proceedings of the International Conferences e-Society 2022 and Mobile Learning 2022, Online."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"106956","DOI":"10.1016\/j.ijepes.2021.106956","article-title":"Evaluating forecasting methods in the context of local energy communities","volume":"131","author":"Coignard","year":"2021","journal-title":"Int. J. Electr. Power Energy Syst."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"132877","DOI":"10.1016\/j.energy.2024.132877","article-title":"Deep learning-based electricity price forecasting: Findings on price predictability and European electricity markets","volume":"308","author":"Aliyon","year":"2024","journal-title":"Energy"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Dimitropoulos, N., Sofias, N., Kapsalis, P., Mylona, Z., Marinakis, V., Primo, N., and Doukas, H. (2021, January 12\u201314). Forecasting of short-term PV production in energy communities through Machine Learning and Deep Learning algorithms. Proceedings of the 2021 12th International Conference on Information, Intelligence, Systems & Applications (IISA), Chania Crete, Greece.","DOI":"10.1109\/IISA52424.2021.9555544"},{"key":"ref_22","first-page":"993","article-title":"An overview of forecasting methods for monthly electricity consumption","volume":"30","author":"Krstev","year":"2023","journal-title":"Teh. Vjesn."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"350","DOI":"10.1016\/j.matcom.2024.10.004","article-title":"Short-term electricity price forecasting through demand and renewable generation prediction","volume":"229","author":"Belenguer","year":"2025","journal-title":"Math. Comput. Simul."},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Sousa, H., Gon\u00e7alves, R., Antunes, M., and Gomes, D. (2024, January 19\u201321). Privacy-Preserving Energy Optimisation in Home Automation Systems. Proceedings of the Joint International Conference on AI, Big Data and Blockchain, Vienna, Austria.","DOI":"10.1007\/978-3-031-73151-8_1"},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Gon\u00e7alves, R., Magalh\u00e3es, D., Teixeira, R., Antunes, M., Gomes, D., and Aguiar, R.L. (2025). Accelerating Energy Forecasting with Data Dimensionality Reduction in a Residential Environment. Energies, 18.","DOI":"10.3390\/en18071637"},{"key":"ref_26","first-page":"1","article-title":"Stable-Baselines3: Reliable Reinforcement Learning Implementations","volume":"22","author":"Raffin","year":"2021","journal-title":"J. Mach. Learn. Res."},{"key":"ref_27","unstructured":"Fuente, N.D.L., and Guerra, D.A.V. (2024). A Comparative Study of Deep Reinforcement Learning Models: DQN vs. PPO vs. A2C. arXiv."},{"key":"ref_28","unstructured":"Mnih, V., Kavukcuoglu, K., Silver, D., Graves, A., Antonoglou, I., Wierstra, D., and Riedmiller, M. (2013). Playing Atari with Deep Reinforcement Learning. arXiv."},{"key":"ref_29","unstructured":"Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. (2017). Proximal Policy Optimization Algorithms. arXiv."},{"key":"ref_30","unstructured":"Schulman, J., Moritz, P., Levine, S., Jordan, M., and Abbeel, P. (2018). High-Dimensional Continuous Control Using Generalized Advantage Estimation. arXiv."},{"key":"ref_31","unstructured":"Mnih, V., Badia, A.P., Mirza, M., Graves, A., Lillicrap, T.P., Harley, T., Silver, D., and Kavukcuoglu, K. (2016). Asynchronous Methods for Deep Reinforcement Learning. arXiv."},{"key":"ref_32","unstructured":"Huang, S., Kanervisto, A., Raffin, A., Wang, W., Onta\u00f1\u00f3n, S., and Dossa, R.F.J. (2022). A2C is a special case of PPO. arXiv."},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Bifet, A., and Gavalda, R. (2007, January 26\u201328). Learning from time-changing data with adaptive windowing. Proceedings of the 2007 SIAM international Conference on Data Mining, Minneapolis, MN, USA.","DOI":"10.1137\/1.9781611972771.42"},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"1591","DOI":"10.21105\/joss.01591","article-title":"PyMarket\u2014A simple library for simulating markets in Python","volume":"5","author":"Kiedanski","year":"2020","journal-title":"J. Open Source Softw."},{"key":"ref_35","unstructured":"OMIE (2025, January 04). European Market. Available online: https:\/\/www.omie.es\/en."},{"key":"ref_36","unstructured":"Henri, G., Levent, T., Halev, A., Alami, R., and Cordier, P. (2020). pymgrid: An Open-Source Python Microgrid Simulator for Applied Artificial Intelligence Research. arXiv."},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Mystakidis, A., Koukaras, P., Tsalikidis, N., Ioannidis, D., and Tjortjis, C. (2024). Energy Forecasting: A Comprehensive Review of Techniques and Technologies. Energies, 17.","DOI":"10.3390\/en17071662"}],"container-title":["Energies"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1996-1073\/18\/13\/3477\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:02:32Z","timestamp":1760032952000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1996-1073\/18\/13\/3477"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,7,1]]},"references-count":37,"journal-issue":{"issue":"13","published-online":{"date-parts":[[2025,7]]}},"alternative-id":["en18133477"],"URL":"https:\/\/doi.org\/10.3390\/en18133477","relation":{},"ISSN":["1996-1073"],"issn-type":[{"value":"1996-1073","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,7,1]]}}}