Citation: Spanoudakis, N.I.; Akasiadis, C.; Iatrakis, G.; Chalkiadakis, G. Engineering IoT-Based Open MAS for Large-Scale V2G/G2V. Systems 2023, 11, 157. https://doi.org/10.3390/ systems11030157 Academic Editors: Philippe Mathieu, Juan M. Corchado, Alfonso González-Briones and Fernando De la Prieta Pintado Received: 4 February 2023 Revised: 10 March 2023 Accepted: 14 March 2023 Published: 19 March 2023 Copyright: © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). systems Article Engineering IoT-Based Open MAS for Large-Scale V2G/G2V Nikolaos I. Spanoudakis 1, * ,‡ , Charilaos Akasiadis 2,§ , Georgios Iatrakis 3,‡ and Georgios Chalkiadakis 3,‡ 1 School of Production Engineering & Management, Technical University of Crete, 73100 Chania, Greece 2 Institute of Informatics & Telecommunications, National Centre for Scientific Research ‘Demokritos’, 15341 Athens, Greece 3 School of Electrical & Computer Engineering, Technical University of Crete, 73100 Chania, Greece * Correspondence: nispanoudakis@tuc.gr; Tel.: +30-28210-37744 This paper is an extended version of our paper published in PAAMS2022—The 21st International Conferenceon Practical Applications of Agents and Multi-Agent Systems, L’Aquila, Italy, 13–15 July 2022. Current address: University Campus, Technical University of Crete, 73100 Chania, Greece. § Current address: Patriarchou Grigoriou & Neapoleos 27, 15341 Aghia Paraskevi, Greece. Abstract: In this paper, we aimed to demonstrate how to engineer Internet of Things (IoT)-based open multiagent systems (MASs). Specifically, we put forward an IoT/MAS architectural framework, along with a case study within the important and challenging-to-engineer vehicle-to-grid (V2G) and grid-to-vehicle (G2V) energy transfer problem domain. The proposed solution addresses the important non-functional requirement of scalability. To this end, we employed an open multiagent systems architecture, arranging agents as modular microservices that were interconnected via a multi-protocol Internet of Things platform. Our approach allows agents to view, offer, interconnect, and re-use their various strategies, mechanisms, or other algorithms as modular smart grid services, thus enabling their seamless integration into our MAS architecture, and enabling the solution of the challenging V2G/G2V problem. At the same time, our IoT-based implementation offers both direct applicability in real-world settings and advanced analytics capabilities via enabling digital twin models for smart grid ecosystems. We have described our MAS/IoT-based architecture in detail; validated its applicability via simulation experiments involving large numbers of heterogeneous agents, operating and interacting towards effective V2G/G2V; and studied the performance of various electric vehicle charging scheduling and V2G/G2V-incentivising electricity pricing algorithms. To engineer our solution, we used ASEME, a state-of-the-art methodology for multiagent systems using the Internet of Things. Our solution can be employed for the implementation of real-world prototypes to deliver large-scale V2G/G2V services, as well as for the testing of various schemes in simulation mode. Keywords: internet of things (IoT); open multiagent systems; smart grid; engineering multiagent systems (EMASs); digital twin 1. Introduction The smart grid [1] constitutes an important emerging application domain for artificial intelligence and multiagent systems (MAS). In the smart grid, energy and information both flow over electricity distribution and transmission networks in all possible directions. As such, buildings, as well as electric vehicles (EVs), become active energy consumers and/or producers, and the need for their effective integration into the system arises. Not only is the smart grid an electricity network with diverse consumers and producers, it is also a dynamic marketplace where heterogeneous devices appear and need to connect and interoperate [2,3]. To date, several smart grid-related business models and information system architectures have been proposed, but they do not always adhere to particular standards [4]. This is not surprising, given the fact that energy markets can differ in scale, i.e., they can be global, regional, or isolated; that they may be regulated or owned by a Systems 2023, 11, 157. https://doi.org/10.3390/systems11030157 https://www.mdpi.com/journal/systems