**2. Methods**

In this section, we outline the relevant components of the tool chain, the first being the simulation environment for the energy system, which employs a commercial tool (SimulationX [15]) based on the Modelica [16] standard. The simulation communicates via a functional mockup interface (FMI) [17] with two external programs, the charging controller implemented in Python and the multi-agent simulation tool NetLOGO.

#### *2.1. Modelica Simulation Environment*

SimulationX is a multi-physics program package for modeling, calculation, simulation, optimization, and reliability analysis of technical components and systems. It is based on the object-oriented programming language Modelica and supports the standardized interface FMI for communication between SimulationX and external programs. We also employed the GreenCity extension library that contains components for the simulation of a complete energy system with a focus on renewables. The main benefit of this simulation approach is that the engineering know-how implemented in the library can easily be accessed so that developers can directly focus on their key research areas (for example, controller development). Simulations of a complete year run on time-scales of seconds to minutes and can be parallelized for parameter optimization [18].
