## 6 Discussion
### Test 1--Real Sailing Schedule  
Optimization can be achieved by setting a priority when charging individual ships. Certain ferries (\"Ferry 6\", \"Ferry 2\", and \"Ferry 4\") shown in Figure 4 are available for a short time to replenish the battery storage. As a rule, a short time implies a high intensity  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Number of particles & 1024 \\ Max number of iterations & 1000 \\ Global weight w\({}_{\text{g}}\) & 0.4 \\ Global weight w\({}_{\text{1}}\) & 0.3 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The basic simulation settings.  
Figure 4: Display of the daily analyzed fleet energy load diagram.  
of the required power. The rest of the fleet is available for charging for a longer period of the day, i.e., more time spent on the berth.  
An optimized charging schedule (Figure 5) was created using the proposed hybrid model on the sailing schedule, considering the daily energy needs. The time intervals during which the ship is charged are marked with a different color for each ship. Furthermore, the timeline is marked in black when the outbound ship is available for charging and disconnected from the land connection. For instance, \"Ferry 5\" (interval marked red) is available for charging from 5:30 to 20:15 and 22:50 to 23:20. Since \"Ferry 6\" has the charging priority, between T1 and T2, \"Ferry 5\" and all other ferries are disconnected from the charging station (interval marked black). In Figure 5, the time intervals T1 and T2 correspond to the peak loads of the daily energy profile shown in Figure 4. Disconnecting an individual ship from a charger results in a proportional increase in charging power in the remaining lots available. The increase in charging power is distributed over the entire charging interval equally due to the technical limitation related to the maximum amount of charging current under the nominal capacity of the ESS.  
After applying the proposed method, Figure 6 shows the new optimized daily profile of electric energy consumption required to charge all ships' ESS following the generated new ship charging schedule. It has to be pointed out that the maximum charging power of the fleet of ships at the moment t = 10:00 was 2594 MW without the optimization algorithm. The peak charging current was reduced to 1974 MW using the PSO and greedy algorithm. The original amount of power is 31.4% higher than the newly created optimized power. Such a reduction relieves the energy infrastructure. Further, the transition to RES greatly reduces the economic costs associated with constructing the power network system [39].  
Figure 5: The optimized ship’s charging schedule.  
Figure 6: Modified daily energy load diagram (Test 1).  
The optimization results in the previous optimization task were predictable because one ship (Ferry 6) significantly contributes to the consumption profile. Therefore, a reduction in the required peak power is achieved by giving priority to such a consumer and simultaneously disconnecting others from the network. At the end of the interval in which each ship is available for charging, the ship's energy needs are fulfilled so each ship can operate the sailing line according to the proposed schedule.