# Simulation Tool for Winter Navigation Decision Support in the Baltic Sea
## 6 Implementation  
The simulation component of the tool is a standalone model developed using Anylogic(r) software. The model is an agent-based, discrete-event simulator with specific add-on functionalities coded using Java. The simulation provides a unified platform to integrate agents, their environments, process flows, and system uncertainties (stochastic elements). The purpose of the simulator is to mimic the operations of the FSWNS, considering all relevant underlying performance factors and attributes of the system. This tool helps compare alternative navigational scenarios to finally arrive at the most efficient combination of policies and actions. This requires modelling of traffic flows, where merchant vessels follow a predefined order of visiting multiple ports in the region. Apart from the merchant vessels, icebreakers are an important part of the winter traffic, ensuring safe operational routes for all vessels. The environment includes varying ice conditions over the winter period. Based on ice data from FMI, ice thickness and topography can change for every mile of the sea area and as often as every day during the winter months. The paths that the vessels follow, known as dirways, are also a part of the environment. Dirways are created by icebreakers where there is ice and are subject to change due to wind, pressure, and changing ice conditions. Another aspect that needs to be captured is the transition between dirways. The ongoing journeys are completed on the old dirways and the new journeys are scheduled on the new dirways. Icebreakers need to coordinate between both set of dirways until all traffic is smoothly flowing on new dirways. This affects convoy formation as well. All these changes can affect the waiting time of the system. The speed of vessels, however, depends primarily on the ice conditions they encounter. These dynamically changing input data are modelled as events in the simulation. When an event occurs (a change in ice data or dirways), all agents are notified, and their operations are suitably modified. There are two agents in the model: merchant vessels and icebreakers. Statecharts are created for each agent, in which possible decisions and subsequent actions are modelled. An example is presented in Figure 4.  
Figure 3: Tool schematic. At the start of the simulation, vessels enter the system representing the simulated section of the FSWNS (e.g., the Bay of Bothnia) following their schedules, at a time and place determined by real-world AIS data and the existing airway network. The ice conditions are updated each time a ship enters a new grid square as determined by the ice data. The speeds of the vessels vary in accordance with their hv curves. When the speed of a vessel drops below a certain threshold, icebreakers are notified. Based on the location of the vessel, the icebreaker that will assist is chosen from the available fleet of icebreakers. Multiple vessels may be assisted by the same icebreakers if they are headed in the same direction. The simulation ends when all vessels in the specified time duration have run their course and completed their schedules. The vessels' average waiting time for icebreaker assistance is one of the KPIs generated as a simulation output. At the ports, process flow diagrams are used to model service and queuing operations. Both merchant vessels and icebreakers visit ports from time to time. From the simulation model's perspective, depending upon the vessel type and nature of visit (whether it is a destination or a transit point), different service times are modelled. Each port has different queuing and serving capacities. Relevant probability distributions are used to model these features. Figure 5 shows three process flows defined in the model. The first one (A) is for all merchant vessels. The service time at the port varies by vessel type and port. Each port has different resource and capacity constraints. The level of detail of service times and port constraints depends on the decisions that the end-user is interested in.