Flexibility management and provision of balancing services with battery-electric automated guided vehicles in the Hamburg container terminal Altenwerder

*Correspondence: stefanie.holly@offis.de †Stefanie Holly, Astrid Nieße, Martin Tröschel, Lasse Hammer, Christoph Franzius, Viktor Dmitriyev, Christine Harnischmacher, Maike Greve, and Kristin Masuch contributed equally to this work. 1OFFIS Institute for Information Technology, Escherweg 2, 26121 Oldenburg, Germany Full list of author information is available at the end of the article Abstract Unlocking and managing flexibility is an important contribution to the integration of renewable energy and an efficient and resilient operation of the power system. In this paper, we discuss how the potential of a fleet of battery-electric transportation vehicles can be used to provide frequency containment reserve. To this end, we first examine the use case in detail and then present the system designed to meet this challenge. We give an overview of the tasks and individual sub-components, consisting of (a) an artificial neural network to predict the availability of Automated Guided Vehicles (AGVs) day-ahead, (b) a heuristic approach to compute marketable flexibility, (c) a simulation to check the plausibility of flexibility schedules, (d) a multi-agent system to continuously monitor and control the AGVs and (e) the integration of fleet flexibility into a virtual power plant. We also present our approach to the economic analysis of this provision of a system-critical service in a logistical context characterised by high uncertainty and variability.


Introduction
Unlocking and managing demand side flexibility is an important contribution to the integration of renewable energy and an efficient and resilient operation of the power system. The German Association of Energy and Water Industries (Bundesverband der Energie-und Wasserwirtschaft, BDEW) estimates that 2,700 MW of demand in Germany could be used in a flexible way Bundesverband der Energie-und Wasserwirtschaft (BDEW) (2013). This includes different energy intensive industries, such as the production of aluminium, steel or paper (Gobmaier et al. 2012) as well as private households (Zeilinger and Einfalt 2011). Logistics, however, has been mostly ignored so far, although the ongoing electrification of transportation systems in combination with smart charging strategies is expected to have great economical and ecological potential (Hacker et al. 2015).
In this research project, "FRESH", 1 we analyze the potential flexibility of a fleet of battery-electric transportation vehicles at the Hamburg container terminal Altenwerder and develop and test an agent-based system for optimized flexibility management. The use case for flexibility is the provision of frequency containment reserve (FCR) via the container terminal's automated charging stations. In this context, flexibility refers to the power and energy that can be dedicated to the provision of additional use cases by placing a transportation vehicle at a charging station without disturbing the logistical processes.
With this setup, three layers have to be reflected in the system design presented in the work, each of which coming with specific challenges: • Logistics layer: The transportation requirements in the container terminal have to be fulfilled first. The available flexibility thus changes over time and depends on the available battery-electric vehicles and charging stations, both of which depend in turn on the logistical processes of the container terminal. Thus, the transportation power demand has to be predicted in advance in order to calculate the overall marketable battery capacity.
• Charging and flexibility management layer: While for each battery-electric vehicle charging can be optimized depending on the individual logistic process, the flexibility of this process can be exploited on a higher level using pre-aggregation. In order to maximize the reliability of the provided flexibility in context of forecast errors and uncertainties in the logistical processes, a continuous monitoring and control of the battery-electric fleet is necessary.
• Aggregation and market layer: Providing FCR with time-restricted flexibility from transportation vehicles requires a pooling strategy, e.g. with a Virtual Power Plant, in order to be able to compensate for short-time deviations or unexpected logistical requirements. The pre-aggregated fleet flexibility can be integrated into market processes using the aggregator role as defined by the Universal Smart Energy Framework (de Heer 2015). The number of additional charging cycles and potentially reduced lifespan of the batteries has to be taken into account when analyzing the economic feasibility of the overall concept.
The rest of this paper is structured as follows: First, information on the container terminal addressed with the work at hand is presented. After that, we show the specific use case of FCR provision using the AGV fleet's flexibility. In the next section, the functional core of the technical system is described: the flexibility management system realized using software agents. Here we give a brief insight into the individual system components. Finally, we take a look at the economic perspective of the presented design, and discuss future work in the conclusion.

Setting the scene: the Hamburg container terminal Altenwerder
The Hamburg Container Terminal Altenwerder (CTA) (Fig. 1), operated by Hamburger Hafen und Logistik AG (HHLA), is a highly automated container handling facility and the world's first container terminal certified to be climate-neutral. The terminal was taken into service in 2002 and has been equipped from the beginning with advanced automation technology and modern data processing systems. Thus, discharging and loading of large container ships can be handled with a very high degree of automation and high efficiency. With 1.4 km of quay wall and four berths, CTA combines a compact layout with short overall transportation distances. 14 container gantry cranes handle loading and discharging of containers in two stages: First, double trolley gantry cranes load and discharge from/to the vessel. Each single container is then lowered on to a working portal higher up and prepared and checked for further transportation. Second, an additional trolley crane then accepts the container automatically and lowers it on to one of currently about 90 Automated Guided Vehicles (AGV) (Fig. 2).
Historically equipped with diesel-electric systems, CTA's AGVs are currently being exchanged with battery-electric systems. By 2022, the AGV fleet in use at CTA will be completely converted to fast-charging lithium-ion batteries, which is supported financially by the European Regional Development Fund. With a maximum charging and discharging rate of 220 kW and the simultaneous use of all 18 automated electricity filling stations, up to 4 MW load reduction and load increase potential can theoretically be provided to the energy market.
These vehicles provide transport between the gantry cranes and container storage. They find their way completely independently, without any instructions from humans. The AGV searches for the fastest route, with the aid of more than 19,000 transponders set into the ground. A software calculates and controls the shortest route to the destination while allowing for other moving vehicles. Fully automated, AGVs will also find their way to the ACSs and recharge when necessary. The ACSs allow for a fully automated and bidirectional charging of AGVs and thus offer the possibility to provide flexibility both with regard to energy markets and power system services.  The Terminal System covers all control and optimization systems of the terminal. It comprises an advanced data processing system and supervises and controls all logistical processes at CTA. The Terminal System's optimization functions realize shorter transportation routes and less empty runs and are continuously monitored and improved. Additionally, experienced human operators in a control room supervise the system's performance and are able to manually fine-tune the (semi-) automated decision making. For the work at hand, the Terminal System serves as interface system for the aggregator and the container terminal operator. The Terminal System is also the foundation of the flexibility management system being developed in the FRESH project as presented in the following sections.

Use case: provision of frequency containment reserve
Frequency containment reserve (FCR) is an instrument for short-term compensation of an imbalance between generation and consumption in power grids. In order to always ensure sufficient capacity, FCR is tendered via a procurement platform operated by the German transmission system operators (TSOs). At present, FCR products have a duration of one day and are traded two days in advance (D-2) in a daily procedure. In order to realize FCR provision in a container terminal as depicted above, we have to consider the energy-economic roles involved in such a setup. Figure 3 gives an overview regarding the roles as defined in this use case.
The aggregator holds access to the market (de Heer 2015). In order to fulfill the high reliability requirements for FCR provision, flexibility from the container terminal is combined with e.g. storage, renewables or conventional (e.g. gas-fired) generators and  controllable loads. Therefore, a pre-aggregator is needed to manage the small-scale flexibility provided by the logistics process. The pre-aggregator defines a slight variation of the aggregator role: It has no direct access to the market, but offers flexibility with a defined degree of reliability in day-ahead planning. In the provision phase, deviations must be detected in time, communicated to the aggregator and compensated by other plants in the pool. Using this distinction, the aggregator does not need information on the details of the underlying processes connected to delivering flexibility, i.e. the details of the logistics' processes in the container terminal. The pre-aggregator role can be realized either by the industrial consumer (i.e. the container terminal operator), or by a third party contracted for this task 2 . Table 1 presents the technical systems needed to realize the use case, including the specific actor that is in charge of operating the respective system. As part of the standardization of balancing service markets at European level, the tendering of FCR is set to undergo some changes starting July 2020. There will be a daily tendering procedure, which will take place the day before the provision (D-1) and in which individual 4-hour products will be tendered (TSOs of Austria 2018). This defines the timeframe for the provision of control reserve with the fleet of battery-electric vehicles: First, a day-ahead planning phase is necessary to determine the amount of flexibility that can be provided by the fleet. Second, this approximate planning must be supplemented by an intraday operational phase in which specific vehicles are selected and prepared in time for the provision of FCR. Therefore, these two phases have to be modeled separately. Figure 4 illustrates the sequential process in the day ahead planning phase. Gate closure for the offer of FCR will be at 8 a.m. on the previous day. Therefore, at 7 a.m. a query of the current logistics data and the status of the fleet regarding the batteries including the states of charge is started. This data is used to predict the transport demand over the course of the planning period. Afterwards, FlexMan requests market signals from the VPP. These signals indicate which prices are expected for the different 4-hour blocks. This step is currently considered optional, as it is not yet clear whether there will be significant price differences within a day. FlexMan uses the predicted transport demand and the market information to determine the flexibility of the fleet. Information on the available flexibility is transmitted to the VPP (i.e. the aggregator actor) that then participates with its total pool of plants in the tender for FCR. Once the tender results are known, the VPP has to divide its obligations for the provision of FCR between different facilities in its pool. The share of the FCR provisioning allocated to the (aggregated) AGV fleet is transmitted back to FlexMan and serves as the basis for the intraday operational phase. Figure 5 depicts the overall process in this phase. If the fleet needs to provide FCR, FlexMan will continuously request updates on the battery data of the fleet. Together with the FCR requirements from day-ahead planning and the predicted transportation requirements, this current status data forms the input for operational planning. The aim of operational planning is to select individual AGVs for FCR in order to ensure that they are ready for FCR provision in time, without interfering with the logistical processes in the terminal. Since it is very difficult to reliably predict the future SOC of individual vehicles in the long term, the selection of vehicles both must be made with shorter planning horizons and must be continuously reassessed. When a specific AGV is selected for FCR provision, FlexMan sends a charging request to the BPMS, which forwards the request to the TS. The TS creates a driving order to an available charging station for the vehicle, which is executed as soon as any existing transport orders are completed. Once the charging process has started, the BPMS informs FlexMan about the ACS where the vehicle is located. Additionally, FlexMan receives continuous updates on the SOC. The vehicle is confirmed for FCR provision as soon as it reaches the time when it is scheduled for FCR and has a valid SOC. Then, the Next Box takes control of the charging process and supervises FCR provision, while communicating with the control centre of the VPP. Afterwards, FlexMan initiates the return of the vehicle to the logistics operation by revoking the FCR confirmation from the Next Box. The AGV will then charge up to a pre-defined SOC and reintegrate into the transport operation.

FlexMan: flexibility management with intelligent agents
FlexMan, the Flexibility Management System being developed in this project, is a modular data processing system. Its modules perform various specialized tasks and exchange data with each other in order to enable the usage of the flexibility of the AGV fleet. FlexMan has been implemented using ideas inspired by micro-service architectures. This refers to the idea that all components of the system should be (a) loosely coupled and (b) remain (re-)deployable at any time on demand. By design, each component has to maintain its own internal state (if this is required). The ability to run all components of the systems in separate containers also allows more flexible deployment of software updates compared to a monolithic system. For example, the algorithm that performs flexibility calculations could be later on replaced with improved heuristics in order to boost performance of the overall underlying business process.
Most of the functional modules of FlexMan have been implemented using the Python programming language. It offers excellent support for data analytics and artificial intelligence as well as still remaining a high-level and general-purpose programming language. All the modules' services are provided via Docker containers to ensure the aforementioned benefits of a micro-services architecture. Using this approach also simplifies the preparation of the field trial planned for 2021 in the container terminal, as the deployment of FlexMan into the existing TS will be less risky and more transparent with respect to already running services within CTA's IT systems. Figure 6 depicts both the internal modules of FlexMan and the external systems and components that FlexMan interacts with. The internal modules reflect the individual functionalities that are necessary in both the day-ahead planning and the intraday operational phase. The Controller is the central component of FlexMan. It encapsulates the external interfaces and triggers the recurring processes in the system, such as the dayahead flexibility determination and the continuous intraday planning. Furthermore, the Controller queries demanded data such as the actual status of the batteries from the BPMS or the sailing list from the TS, and either forwards it directly to other components or saves it in the Data Storage. This approach allows to use various types of data flows between components -both synchronous and asynchronous. For instance, in case of the Simulation module, the request to cross-check an operation plan and flexibility usage could last up to 5 min (see "Simulation: simulating automated logistics in the container terminal" section for more details on technical requirements).
In summary, the modular architecture of FlexMan enables a flexible design and adaptation of the system during the FRESH project and allows implementation of different use cases, thus simplifying the system's future evolution. The most important functional modules for the current use case of FCR provision, namely Prediction, Simulation, Fleet Flexibility and Planning, will be described in more detail in the following sections.

Prediction: predicting AGV availability with machine learning
In order to accurately plan the amount of offered flexibility, a prediction of the future usage of the AGVs is needed. Flexibility for an entire day in fixed 4 hour intervals must The handled ships and the amount of containers to load and unload directly influence the number of AGVs needed. Therefore, sailing list entries of ships arriving, departing or lying in port on the day on which the use is to be predicted are taken as input for the prediction. A sailing list entry contains the name of the ship, scheduled arrival, departure and work start, a unique arrival ID, the planned berthing place, planned position of front and rear of the ship as well as the number of containers to load and unload. Table 2 shows an anonymized example of sailing list entries. The arrival ID is not used as model input, because it changes on every arrival and therefore holds no additional information that is useful to the models. On the other hand, the time scheduled dates, berthing position and length of the ship, as well as containers to load and unload influence the amount and duration of AGVs used, which subsequently influences ACS usage. The ship name might also contain valuable information, as the same ship could be handled similarly on different occasions. The dates are split into individual integers and ship names are mapped to integer representations in order to be processable by the prediction models. Usage profiles that measure the number of unused AGV and ACS throughout a day serve as labels, which are generated from AGV transport orders and ACS charging operations. For all 15 min intervals in a day, it is checked how many AGVs and how many ACSs are in use. This number is subtracted from the total number of AGVs/ACSs to get the number of unused equipment. Figure 7 shows an example of the amount of unused AGVs over a day, together with an example prediction. The offerable amount of flexibility is restricted by the number of unused AGVs and ACS, as described in the section about the use case. Because of that, the usage profiles are our prediction target. We will evaluate different Machine learning methods to reach accurate predictions and gain insight on their respective advantages and disadvantages on this prediction task. ANNs and Random Forests have proven to be useful regression tools in the past (Abiodun et al. 2018;Verikas et al. 2011), as well as in a pre-study carried out in a master thesis. This thesis used the same input data but aimed to predict the AGV energy demand of handling a ship. (Hammer 2019) Simulation data was used to generate the dataset for the pre-study as it relied on a full fleet of electric AGVs to predict their energy consumption. At the time of the pre-study, most of the terminals AGVs were diesel powered, which is why simulation was necessary. Additionally, the simulation data allowed to implement data preprocessing techniques, before real data was available. The details of the performed simulation are explained in the next section.  Over the course of this project, we could not yet collect sufficient data to create a large enough training dataset from real data. A first ANN model was therefore trained on the available AGV usage data which contains 6 months of sailing lists and usage profiles. The model consists of four feedforward layers with tanh activation reaching from 512 to 92 neurons in each layer. For model training, 80% of the data was used, 20% was used as a test set to evaluate the performance on unseen data.
The accomplished accuracy is promising. Figure 7 shows a prediction against the correct values of an unseen day. Although there are intervals in which the error is quite high, the figure shows that most of the trends throughout the day are predicted correctly. This indicates that the model is in principle able to learn AGV usage profiles. Overall, the mean absolute error (MAE) on unseen data is 15 AGVs. This means, that on average, for every 15 minute interval, the prediction is either 15 AGVs too high or too low. In a fleet of 96 AGVs this is still a substantial error that leads to very high security margins in the flexibility calculation and therefore less offerable flexibility. We subsequently aim to improve the prediction performance by using more training data, tuning the model further and using additional input such as weather data. As stated previously, other model types will also be evaluated.

Simulation: simulating automated logistics in the container terminal
Simulating the logistic network of AGVs in a container terminal is a complex and highly specialised task. Nevertheless it has been reported in literature (Vavrík et al. 2017). Similarly, we employ the discrete event simulation tool Tecnomatrix Plant Simulation (Siemens Digital Industries Software) by Siemens to represent AGV activity and ACS usage in high temporal resolution. Within the whole system, this plant model serves two roles. First, it acts as the data generator for providing training data to the near-term AGV availability prediction. Second, it is used to check the plausibility of the determined day-ahead flexibility and the ad-hoc planning.
This project's model is based on the knowledge, processes and software artefacts developed during prior research project BESIC (Ihle et al. 2016). The BESIC simulation model was used to simulate the energy demand of the CTA. It was also able to simulate the logistics with different ratios of diesel-electric and battery-electric AGVs to show the difference in energy demand. In order to fit the necessary requirements stated in the introduction, the simulation model had to be substantially adjusted. An early version of the adjusted simulation model was then used to generate the data needed for the prediction pre-study mentioned in the previous section. Figure 8 shows a part of the simulation model. In comparison to Fig. 1 it only shows the unloading of one berthed ship. At the top of Fig. 8 five gantry cranes are shown. The grid simulates the transponders in the ground to let the AGVs, which are shown as rectangles, only drive along a specific path. The bottom of the figure shows an ACS and five container storages. The AGVs park in front of the gantry cranes which are processing the ship. As soon as an AGV is successfully loaded it starts driving to an assigned container yard. Another AGV, which is already parking in a waiting area in order to take its place, to be then loaded by the gantry crane.
Besides the data generation task, the simulation is going to be used within the project to verify the feasibility of the determined day-ahead flexibility and the intraday shortterm scheduling. Therewith, the risks of mismanaging the infrastructure of the container terminal can be minimized. An important part of the mentioned day-ahead planning is to determine how many AGVs and ACS can be taken out of the logistic processes without impacting the business as usual process of the container terminal under any circumstances. The quality of the simulation model was validated using historical data on ship handling times. For large ships (unload time greater 12 hours), the mean deviation between simulated and measured duration is 9%, for all ships it rises to 26%. This is mainly  by underestimating the unload time for small ships. The simulation runs on a virtual machine with 8 × 2.40GHz cores and 16GB RAM. It takes about five to six minutes to simulate three days of the logistical process depending on how many ships are being processed within those days.
To enable the planning validation, the simulation was further extended by three areas of charging platforms with a total of 18 ACS. Figure 9 shows one of these platforms. The AGVs are parking next to an ACS and are charged or used to provide flexibility. These platforms are used to predict how many ACSs are needed for the logistical processes of the container terminal.

Fleet flexibility: estimating flexibility and handling uncertainty of transport order allocation
The purpose of the flexibility module is to estimate the flexibility the whole fleet can provide without compromising logistic requirements. In other words, it is a matter of determining how many ACS with connected AGV may be taken out of the logistics operation. Thus, we must first estimate the number of ACS and AGV needed to meet the transport requirements. The number of AGV needed for logistics is obtained in the transport demand prediction. The number of ACS must be derived from this prediction and the information on the SOC of the fleet. The occupancy rate of ACS depends on how many AGVs have to reload at a time, which in turn depends on how many trips an AGV has to make. The same transport requirement, i.e. the number of transport orders, can therefore lead to very different utilisation profiles of the ACS depending on the allocation of orders.
As FlexMan is designed to have minimal impact on the terminal's logistics systems, it cannot interfere with the allocation of transport orders. The creation and assignment of transport orders is the sole responsibility of the TS. When assigning a task to a vehicle, the TS selects an AGV that can fulfill the order in time and has the lowest possible driving effort. As long as the SOC of a vehicle is above the minimum value, it has no influence on the allocation of transport orders. Since it is not possible to predict the positions of the vehicles, it is also difficult to predict to which vehicle a transport order will be assigned. The challenge for FlexMan is to determine the use of the ACS without influencing the allocation of transport orders and without being able to accurately predict the allocation and thus the occupation of ACS. So instead of trying to predict ACS usage for transport and  (3 in total). The right part of the figure is responsible for taking a charged AGV back into the logistic process using the remaining ACS for FCR, we select a certain number of ACS for FCR provision and check whether the logistics processes can still run smoothly. We use a heuristic to find a solution that does not interfere with the logistics process and provides the greatest possible benefit. Figure 10 shows the procedure of this heuristic. First a solution candidate is created. A solution candidate is a time series that specifies the number of ACS reserved for FCR provision for each 15 minute interval of the planning horizon. The first candidate is the 0candidate, which serves as a baseline. This means that no ACS are selected and therefore no FCR is offered. To determine the quality of the solution, we have to assess the expected profit and the feasibility of the candidate. The expected profit can be easily calculated by multiplying the power provided by the candidate by the expected price. The feasibility measure is a metric that indicates how well the logistics process can run if the number of ACS specified by the candidate and an equal number of connected AGVs is not available. To determine this metric, a logistic model is parameterized with the predicted transport demand and the solution candidate. This logistics model can be the simulation described in the previous section, as well as a simplified model. It is crucial that the model can be executed quickly and provides information about the feasibility with sufficient reliability. Afterwards the expected profit and the feasibility measure are combined to form the solution quality of the candidate. The candidate is then modified, for example by mutation, and the solution quality for this new candidate is evaluated. This iterative process is continued either until a candidate with sufficient solution quality has been found or until a certain period of time has elapsed. This approach is presented here as an abstract process model and is concretized by the design of the individual steps, e.g. the adaptation of the candidate, the logistics model and the exact determination of the feasibility measure. But even on that abstract level some advantages can be noted. The weighting of expected profit and feasibility measure in the calculation of the solution quality allows a trade-off between risk and profit. In addition, each solution candidate can be compared to the 0-candidate thus avoiding the offer of FCR if the risk for logistics is too high. This approach also offers the anytime condition, since there is a feasible solution from the first iteration with the 0-candidate, which is improved over time.

Planning: continuously supervising and scheduling AGV for FCR provision
As described in earlier sections, the goal of intraday operational planning is to select specific AGVs for FCR provision. Since they are equipped with identical battery systems, Fig. 10 Heuristic for flexibility determination each AGV can contribute in principle the same amount of power to the FCR provision once it is prepared. However, the AGVs differ in the amount of time they need to be ready for FCR provision, as they may need to finish transportation tasks and/or have to drive to the ACS from different positions. Additionally, depending on their current SOC they may or may not need to recharge before they can contribute to FCR provision. Thus, for each AGV feasible FCR schedules have to be determined. Here, a schedule indicates how much power an AGV contributes in every 15-minute interval of the FCR product. In addition, a schedule includes the preparatory steps and thus indicates whether the AGV and the ACS it occupies will be available for transportation tasks. Thus, in this context a schedule represents a single possible usage of an AGV for FCR provision over time. Figure 11 depicts the general setup of the multi-agent system (MAS) used for operational planning. In this system, each AGV is represented by an AGV-Agent. These agents are responsible for calculating a set of feasible schedules for their AGV, including both schedules with start times deferred due to preparatory steps as well as schedules without any involvement in FCR provision. The AGV-Agents forward the set of schedules to the Optimizer-Agent. The Optimizer-Agent then integrates the received information into an integer linear optimization problem in order to select exactly one schedule for each AGV. The objective function of the optimization is defined such that for each 15-minute interval of FCR provision the provided power summed up over all selected schedules will be as close as possible to, but not less than the marketed flexibility. At the same time, the constraints from logistics must be met. This means that at most as many ACSs and AGVs may be withdrawn from the logistics process as is permitted on the basis of the transportation demand forecast.
Regarding MAS in general, solving an optimization problem in a centralized way may seem counterintuitive, as distributed systems are often used in conjunction with heuristic optimization approaches (Sonnenschein et al. 2015). This is especially true in largescale energy systems, as MAS-based optimization approaches typically scale up very well (Nieße et al. 2012) and are therefore often employed in complex and very dynamic systems such as Smart Grids (Merabet et al. 2014). However, in context of the FRESH project, this project, we are faced with a set of conflicting requirements: • Modularity of FlexMan: The FlexMan system has been designed with modularity in mind. Therefore, the Planning module too has to be designed in such a way that exchanging it with a different module (that implements the same functionality, of course) is possible. Thus, a fully distributed optimization solution is not feasible here.
• Continuous integration of new AGVs: As the exchange of diesel-electric with battery-electric AGVs is currently still in progress, over time more and more AGV will become available for FCR provision. Here, an agent-based representation of AGV allows for a simple plug-and-play integration of AGV into the overall optimization process.
• Handling of short-term deviations: Due to the uncertainty in both the transportation demand prediction and the logistical processes, the Planning module has to deal with short-term deviations from the day-ahead planning in order to reliably provide FCR. Here, the AGV-Agents play a key role again, as they continuously supervise and control their according AGV and are able to reschedule their usage in a concurrent and reactive way.
We will systematically analyze the performance of the MAS in the field trial that is scheduled for 2021, and critically reflect the design choices with respect to the above listed requirements in order to further improve our system in the future.

Integration of time-restricted and variable flexibility into a virtual power plant
The idea of using Virtual Power Plants (VPP) as a market aggregator for small and distributed energy resources (DER) has been introduced almost 20 years ago (Hendschin et al. 2001). Today, most wind power plants and bio-fuel plants in Germany have been integrated into commercially operated VPP that predict and market their plants' power generation (Klobasa et al. 2018). For this, DER have to be connected to a VPP by some means of (bi-directional) communication. Typically, vendor specific and thus proprietary hardware and software is employed; there have been, however, substantial efforts in the last years to develop and establish standards for information exchange between DER and VPP, such as the IEC 61850-based "VHPready" (Industry Alliance VHPready e V 2017).
In contrast to wind power plants and bio-fuel plants (or stationary battery systems), battery-electric vehicles are non-stationary DER. From a VPP's point of view, they may connect at some (potentially not exactly known) time to a charging station, charge and/or provide flexibility while being connected, and then disconnect again. Thus, both the general availability of flexible mobile battery systems and their concrete, time-restricted flexibility are subject to uncertainty. However, providing a system-critical service such as frequency containment reserve (FCR) requires a very high reliability of flexibility. In this project we therefore employ a three step approach to provide FCR with time-restricted, variable flexibility: 1 The day-ahead marketing of the expected flexibility of the AGV fleet has to rely on predictions with high quality and information about the uncertainty of predictions. This will allow the VPP to make use of a more or less conservative amount of flexibility, depending on the confidence of the prediction. 2 During the intraday operational phase of FCR provision (and possibly activation), the FlexMan agents supervise and control the AGV fleet with regard to both the logistical requirements and the flexibility promised day-ahead. In case of (usually unavoidable) actual or (short-term) predicted deviations from the promised flexibility, FlexMan will try to reschedule AGVs and send them to the charging stations in order to compensate for any shortcomings. 3 Most importantly, the AGV fleet's flexibility is not marketed on its own. In order to minimize the risk of failing to provide FCR as promised, we integrate the AGV fleet's flexibility into a large pool of DER. Next Kraftwerke operates one of the largest VPPs in Europe, comprising more than 7.5 Gigawatt of combined generation and consumption capacity, with more than 1 Gigawatt of balancing service capacity. Thus, we are able to compensate any short-term deviations that couldn't be handled in steps 1 and 2 and reliably provide FCR.
However, while this approach will work from a technical perspective, providing and integrating time-restricted and uncertain flexibility into the VPP at great expense may not be economically feasible in the long run. Thus, we have to revisit the use case of FCR provision from an economic perspective.

Use case revisited: the economic perspective
In order to make economically beneficial decisions, the operator has to gain insight over total costs that arise in the context of implementation, usage and deconstructions that have to be weighed against the benefits and revenues. Therefore, firstly the relevant cost drivers are identified and scenarios for the evaluation of the cost drivers are determined. The analysis is build upon the total cost of ownership method. Lastly, the transferability and usability of the results is discussed.

Cost driver determination
Building on the use case of FCR provision, it is necessary to determine the cost drivers arising when an electrified container terminal is transferred into an agent-based system for optimised flexibility management. To approach this issue, we first analyze existing work on cost analysis in electrified systems to find a systemized scheme for the cost analysis and to identify relevant costs that were addressed in similar settings. Secondly, experts from different relevant fields evaluate the cost drivers of the described project setting. For this evaluation, we perform expert-interviews with project partners that are experienced experts in the port and electric industry. Finally, we aggregate the gathered results to identify a cost model that is based on a systemized scheme and holds for this specific use case.

Scenarios and specific cost driver evaluations
Scenario analysis has been applied for forecasting trends in various domains as a tool for improving decision making in the context of multiple possible future environments (Daum 2001;Elkington and Trisoglio 1996;Mietzner and Reger 2005). The primary aim of the scenario development is the creation of holistic, consistent perspectives on relevant environmental factors and assist in strategic decision making (Mietzner and Reger 2005). This research method is often applied in innovation settings such as this one, as it allows including a multitude of different influencing factors and can be applied in a straightforward manner.
The evaluation of the degradation of the battery in the use case of FCR provision poses an additional challenge. As the use of vehicle batteries for frequency regulation will lead to additional charging and discharging cycles, this will most likely lead to a faster degradation of the battery (Guo et al. 2019) and thus not only resolve the advantage of the long battery lifecycle, but also lead to additional costs due to a more frequent battery replacement (Bishop et al. 2013). Especially since the battery itself represents up to 50 percent of the purchase value of the AGV, the additional wear and tear has a significant impact on the profitability of providing FCR (Zhou et al. 2011). Different degradation mechanisms can be used to estimate battery degradation, "cycle ageing" and "calender ageing" (Barré et al. 2013). As the focus of the research project is on the additional use of the battery during the AGV rest periods, it can be assumed that the main part of wear and tear is caused by battery use, making it sensible to focus on cycle ageing. In order to quantify battery degradation for the specific use case, in the first step a drive model simulates the SOC progression of the AGV without V2G service based on AGV tour plans. In the subsequent step, the SOC progression resulting from the tours and the additional V2G service based on grid frequency data is simulated. Battery performance data and the FCR volume are relevant as input data for this combined model. In addition, the consumption from the drive model serves as an indicator to decide whether FCR can be provided. The drive model can therefore also be described as a tour forecast, making it possible to comply with the restrictions to prefer the logistic obligations of the AGV to the provision of FCR. From the generated SOC curves, the relevant wear factors for the respective degradation models can then be determined in the fourth step. Finally, by combining the extracted wear factors with the respective models, the degradation can be determined. By comparing the resulting degradation in the drive model with the results for the drive V2G model, the changes in degradation can finally be determined and thus the adjusted life cycle of the batteries.

Total cost of ownership analysis
In the IT industry the specific Life-Cycle Cost Analysis approach of the Total Cost of Ownership (TCO) method is used as a suitable tool for this purpose (Ferrin and Plank 2002). It is defined as "a purchasing tool and philosophy which is aimed at understanding the true cost of buying a particular good or service from a particular supplier" (Ellram 1993). In order to make economically beneficial decisions, the operator has to gain insight into all costs that arise in association with the project and over the entire project duration. We assess the TCO of the project based on the previously determined cost drivers. Combining the results of the previous steps in a calculation model which is able to calculate the economic efficiency of different possible development scenarios. In this calculation, the battery degradation model along with the various influencing factors are combined in order to be able to provide accurate information on costs and revenues.

Transferability and usability
As the project serves as a prototypical implementation case for developing an electrified container terminal into an agent-based system for optimised flexibility management, the subsequent transferability of the project insights is one of the main goals. While the central role of sustainable logistics operations is undisputed in theory, in practice, the electrification of industrial firms' transportation systems is barely progressing. Therefore, our research aims to identify what factors influence the adoption of electrified transportation systems. We conduct a qualitative empirical study to identify the characteristics of organizations and electric mobility technology that require adaptation in the context of closed fleet systems (Döring and Bortz 2016;Myers 2013). For the survey, we interview experts from organizations with closed fleet logistics systems, who also deal with current topics of possible alternative propulsion systems for their vehicles. The factors that influence the adoption of any innovation can be wide-ranging and emerge from various sides (Rogers 1983). Based on the theory of innovation diffusion, the innovation-decision process that leads to the adoption of an innovation can depend on the characteristics of the innovation, as well as the characteristics of the organizations and the stages of the innovation-decision process itself (Rogers 1983). Through our analysis, we identify particular organizational and technology-related characteristics based on the steps of the innovation diffusion process. Thus, transfer concepts are being developed to make the knowledge gathered in this project applicable for decision-making in other industries and applications and subsequently state the respective potentials and challenges based on collected experiences.

Conclusion and outlook
In this paper, we presented ongoing work on flexibility management and frequency containment reserve provision with a battery-electric fleet of automated guided vehicles in a container terminal. The major challenge here is to provide flexibility for a system-critical service with high reliability in a logistical context that is characterized by high uncertainty and variability. In order to tackle this challenge, we (a) use artificial neural networks to predict the availability of AGVs day-ahead, (b) compute the marketable flexibility with a heuristic approach, (c) rely on simulation for checking the plausibility of flexibility schedules, (d) continuously supervise and control the AGVs with a multi-agent system and (e) integrate the fleet's flexibility into a larger pool of distributed energy resources within a virtual power plant.
As the work in this project is still ongoing, we are looking forward to evaluating our approach in a field trial that is planned for 2021. This will give us the opportunity to critically analyze the performance of the FlexMan system and to further improve on the quality of prediction, simulation and optimization. An important question throughout the project is the economic perspective of flexibility provision -here, we will reflect not only on the total cost of ownership of a flexibility management system, but also develop concepts to transfer the knowledge gained in this project to other industries. model of the container terminal and designed the FlexMan System Architecture. CH, MG, KM and LK elaborated on the economic perspective of the use case. BW provided data and background knowledge regarding the Container Terminal Altenwerder. JK was involved in defining the VPP integration and supported the work with practical insights. All author(s) have read and approved the final manuscript.

Funding
Publication costs were covered by the DACH+ Energy Informatics Conference Organizers, supported by the Swiss Federal Office of Energy.

Availability of data and materials
Due to privacy issues and non-disclosure agreements, data is not publicly available.