*2.2. Organisational Structure of Simulation Tool*

Figure 2 illustrates the structure of the developed tool, including the connections between the main modules. The tool is driven by recorded driving cycle data, and as the main output, it delivers the TCO over the projected fleet operational period (12 years, herein). The DPPM transforms the recorded driving data into individual driving cycles, and it also calculates various statistical features characterising the conventional city bus transport behaviours. The EBSM provides computer simulations of different types of city buses (CONV, HEV, PHEV, BEV) over the driving cycles extracted by the DPPM. The module outputs include the individual bus energy consumption (fuel and/or electricity) and various features of powertrain response (e.g., engine/e-motor operating points, gear ratio trajectories, etc.). The COM utilises the outputs of DPPM and EBSM to simulate the overall city bus fleet over the recorded driving cycles and optimise the PHEV- and BEV-type bus charging configuration and management. This module provides the number, location and type of chargers, the bus battery capacity and the number of reserve buses in the BEV case, which are required to fulfil the driving routes with sufficient battery charge. The COM also outputs the total fuel and/or electricity consumption over the considered period of operation. The TEAM uses the output data from the COM module, as well as the data on bus transport investment and exploitation/maintenance cost, in order to calculate the TCO.

**Figure 2.** Organisational structure of simulation tool.

The simulation tool is written in Python object-oriented programming language, with computationally demanded routines coded in C language. The Python language has been selected because it is available in open-source domain, it supports multiple platforms, has a vast number of available libraries, and is dynamically typed language (i.e., does not require declaring of data type of a variable) convenient for rapid prototyping. The simulation tool is designed in a user-friendly way (based on a graphical user interface (GUI) including windows, tabs, I/O data interfaces, etc.) and has in mind the transferability to other cities using a common/shared database. The database serves as a main storage for recorded driving cycle data, and plays the role of an intermediary between the main tool modules. In addition, the simulation tool includes the Data Management Module (DMM), which provides greater flexibility and adaptability to different cities' transport system configurations. DMM enables the user to define all static data (system parameters) required by the simulation tool, e.g., those related to vehicle model parameters, end-station and depot locations, charging station parameters and techno-economic data.
