Multi-Terminal Berth and Quay Crane Joint Scheduling in Container Ports Considering Carbon Cost

: As container ports become increasingly important to the global supply chain, a growing number of ports are improving their competencies by consolidating multiple terminal resources internally. In addition, in the context of energy conservation and emission reduction, ports measure competitiveness not only in terms of terminal size, throughput and service level, but also in terms of low energy consumption and low pollution. Therefore, a nonlinear mixed-integer programming model considering the cost of carbon is developed for the multi-terminal berth and quay crane joint robust scheduling problem under uncertain environments to minimize the sum of expectation and variance of total cost under all randomly generated samples. The model considers the water depth and interference of quay cranes, etc. The expected vessel arrival time and the average operational efﬁciency plus relaxation are used as their actual values when scheduling. Finally, an improved adaptive genetic algorithm is developed by combining the simulated annealing mechanism, and numerical experiments are designed. The results show that the joint berth and quay crane scheduling with uncertainties and a multi-terminal coordination mechanism can effectively reduce the operating cost, including carbon costs and the vessel departure delay rate, and can improve resource utilization. Meanwhile, the scheduling with the multi-terminal coordination mechanism can obtain more signiﬁcant improvement effects than the scheduling with uncertainties.


Introduction
In recent years, container freight transport has developed rapidly due to its high efficiency; container ports have gradually become a vital node of the global supply chain, and their operational efficiency affects the efficiency of the entire supply chain. Due to geographical or other constraints, many ports exist with multiple terminals, such as the Port of Valencia, Keppel Terminal, Tanjong Pagar, and Blarney Terminal [1]. Terminals in these ports are usually operated by different entities and their resources cannot be shared with each other, so the efficiency cannot be maximized. With the increasing competition among ports, they must improve their competitiveness through the integration of resources. Furthermore, one of the major characteristics of maritime logistics is uncertainty. This will make the scheduling plan infeasible because of the constantly changing status of ships and terminals, such as arrival time, equipment breakdown, etc. The uncertainties mainly include arrival times, the operation time in the berth and the crane scheduling problem. In addition, changes in the operation time are usually caused by the quay crane operational efficiency or the breakdown of the quay crane, etc. In this paper, the influence yielded by the change in the quay crane operation efficiency is the focus. Furthermore, carbon emissions play a critical role in evaluating the operational efficiency of ports. Therefore, optimizing mechanical processes and resource allocation within ports is essential to reduce carbon emissions, promote energy conservation and emission reduction, foster the development of green port shipping, and enhance the competitiveness of port groups. This paper investigates the impact of berth and quay scheduling on carbon emissions.
At present, the field of container terminal frontier operation scheduling optimization already has many excellent review studies [2,3], and they have provided a relatively comprehensive description of relevant research in the field.

Literature Review
Many studies have focused on the independent scheduling of berths and quay cranes. De et al. [4] incorporated fuel consumption cost into the dynamic berth allocation problem and designed a chemical reaction optimization approach to solve it. Al-Refaie and Abedalqader [5] studied the berth allocation problem and proposed two optimization models under regular vessel arrivals and under emergency conditions, separately. Wawrzyniak et al. [6] investigated the algorithm selection problem for solving the berth allocation problem. Abou Kasm and Diabat [7] studied the scheduling problem in the application of a new quay crane. Lv et al. [8] established a mixed-integer linear programming model for the berth allocation recovery problem and solved it using the squeaky wheel optimization heuristic. Jia et al. [9] studied how to allocate berths to deep-sea vessels and schedule arrivals of feeders for congestion mitigation at a container port with a stochastic optimization model, and solved the problem by a three-phase simulation optimization method. Xiang et al. [10] developed a data-driven model to optimize berth allocation at container terminals considering uncertain operation time, using clustering and algorithm generation techniques, and demonstrated its effectiveness through computational experiments. Rodrigues et al. [11] provided a comprehensive survey of literature on berth allocation and quay crane assignment problems under uncertainty, classifying approaches into proactive, reactive, and identifying research trends, limitations, and future directions. As a complex system, the internal parts of container ports interact with each other. Many studies are focused on the integrated scheduling problems of them. Some focused on the integrated quay crane and yard truck scheduling problem, such as Cao et al. [12]; others considered the simultaneous storage space and berth allocation problem, such as Safaei et al. [13] taking the form of a hybrid flow shop. Jonker et al. [14] developed a comprehensive model for the scheduling of quay cranes, AGVs, and yard cranes, and they also solved it by a tailored simulated annealing algorithm. Agra et al. [15] considered an integrated berth allocation and quay crane assignment and scheduling problem motivated by a real case where a heterogeneous set of cranes is considered. Li et al. [16] investigated an integrated berth allocation and quay crane assignment with uncertain quay crane maintenance activities and established a stochastic integer linear programming model to minimize the excepted total turnaround time of vessels. Chargui et al. [17] proposed a new extension of the berth and quay crane allocation and scheduling problems considering worker performance variability and yard truck deployment constraints. Ji et al. [18] solved the Berth Allocation and Quay Crane Assignment Problem (BACAP) with stochastic vessel arrival times using a scenario generation method and an MILP model to minimize the expected total vessel stay time. Tang et al. [19] proposed a mixed-integer linear programming model and a large neighborhood search algorithm to solve the continuous berth allocation and quay crane assignment problem, aiming to minimize the total stay time and delay penalty of ships. Most research has focused on the integrated berth and quay crane scheduling problem.
In realistic situations, the final scheduling solution may be infeasible if uncertainties are ignored during scheduling. Therefore, many scholars have conducted studies on resource scheduling in container terminals under uncertainties. These studies usually consider the uncertain arrival time and operation time, while they are different in strategies for coping with these uncertainties. Zhen and Chang [20] improved the robustness of the model by inserting buffer times between vessels and proposed a heuristic algorithm based on the squeaky wheel optimization method. Xiang et al. [21] examined the simultaneous Sustainability 2023, 15, 5018 3 of 20 allocation of berths and quay cranes under discrete berth situations with uncertainty at container terminals. Iris and Lam [22] applied recoverable robustness and designed an adaptive large neighborhood algorithm for solving the problem. Rodrigues and Agra [23] modeled the integrated berth allocation and scheduling problem under uncertain arrival time as a two-stage robust mixed-integer program and proposed a new scenario reduction procedure with a warm start technique to break down the problem.
In the context of a low-carbon economy, many experts have discussed the calculation of carbon cost in depth, mainly focusing on land transportation, maritime transportation and carbon costs of production enterprises, but relatively little research has been carried out on the carbon emission cost of ports. Prayogo et al. [24] discussed the model development of carbon emission cost in container terminal operations planning using a system dynamics approach. Sun et al. [25] considered a combination of the cost of all tasks, the total operating cost of quay cranes and the carbon taxation cost, and proposed a recoverable robustness berth and quay crane assignment-planning model. Lin et al. [26] investigates an integrated optimization problem of berths, quay cranes, and yard spaces allocation for tidal ports with channel capacity constraints under a carbon tax policy. Karam et al. [27] proposed a planning model that integrates berth allocation, quay crane assignment, and internal truck assignment problems with energy-saving goals and realistic factors.
To the best of the authors' knowledge, few studies have focused on frontier operation scheduling problems for the multi-terminal container port. Imai et al. [28] took Colombo port as an example and studied the berth allocation problem when berths in other terminals could be shared. Krimi et al. [29] presented an efficient rolling horizon-based heuristic to solve the integrated berth allocation and crane assignment problem in bulk ports. Bouzekri et al. [30] focus on the integrated laycan and berth allocation and quay crane assignment problem for tidal ports with multiple quays and different water depths; they proposed two models for the integration of the time-invariant quay crane assignment and the specific quay crane assignment, separately. Martin-Iradi et al. [31] consider a variant of the berth allocation problem-that is, the multiport berth allocation problem-aimed at assigning berthing times and positions to vessels in container terminals. In fact, their research is very similar to ours. However, they ignored the uncertainty in the terminals and did not consider the carbon emissions of these terminals, which are important factors when assigning berthing positions to ships. In addition, they used CPLEX to solve small instances, but did not provide an algorithm for large instances.
From previous studies, it can be seen that, the research on berth allocation and quay crane assignment under a low-carbon background is relatively insufficient. There are few studies on multiple terminals considering carbon emission reduction. Furthermore, most studies only consider a defined environment, without considering the uncertain arrival times and quay crane operational efficiency. Therefore, besides considering water depth, interference between quay cranes and export container transportation, this paper investigates the multi-terminal continuous berth and quay cranes robust scheduling problem with uncertain arrival times and quay crane operational efficiency. It can provide a little theoretical basis for the intensive operation of ports where multiple container terminals exist.

Problem Description and Formulation
The usual operation processes of a container terminal are shown in Figure 1. From the ship's point of view, if the ship needs to berth at the terminal, it should inform the terminal in advance of the length, expected arrival time, stowage plan, etc. Then, its berthing position, berthing time, specific operation quay cranes, and operational sequence of tasks will be determined by the terminal. After all tasks are completed, the ship leaves the port. Berth allocation, quay crane assignment, and quay crane scheduling involved in this process are considered seaside operations.
From the container point of view, after being unloaded from the ship by the quay crane (or when the container owner needs to send it out), it will be transported to the assigned yard by truck and then placed at the assigned option through the yard crane. When the container owner needs it (or it needs to be loaded onto the ship), it will be taken out using the yard cranes and be transported to the owner by truck (or be sent to the quay crane and loaded onto the ship). The landside operations of this process encompass yard truck scheduling, storage space allocation, and yard crane scheduling. In this paper, we assume a container port with terminals, each terminal ∈ with independent natural conditions and resources, such as the length of the quay , the water depth ℎ , the number of quay cranes , etc. During the planning period H, ships will arrive, each ship ∈ with a different draft , expected arrival time , expected departure time , etc. In addition, there are already 0 vessels in the terminals at the beginning of the planning period. The actual arrival time and the actual efficiency of cranes are defined as random variables with normal distribution. In addition, samples are generated according to the distribution function. For each vessel, a penalty cost is incurred if its actual arrival time exceeds its scheduled berthing time or if its actual departure time exceeds its expected departure time . The penalty cost is a measure of the deviation from the planned schedule and is used to discourage such deviations and promote adherence to the scheduled time frames. When the vessel's actual berthing terminal does not coincide with the pre-assigned terminal , the export containers need to be transferred to the actual berthing terminal. In practice, if the ship deviates from the preferred berth, the container will be transported from the container truck to the corresponding yard and container area of the preferred berth, then the carbon dioxide emissions will be generated. In the context of this problem, the berthing terminal , berthing position , berthing time , and the number of quay cranes assigned are determined to minimize the expected value and the standard deviation of the total cost for all ships across all samples.

Model Assumptions and Notation
1. Berths are uninterrupted and vessels may dock at any point along the quay, provided that they meet the necessary requirements; 2. Terminals have different water depths, and vessels can only berth at terminals that meet their draft; 3. All quay cranes on the same terminal are located on the same track and cannot change or serve across terminals; From the container point of view, after being unloaded from the ship by the quay crane (or when the container owner needs to send it out), it will be transported to the assigned yard by truck and then placed at the assigned option through the yard crane. When the container owner needs it (or it needs to be loaded onto the ship), it will be taken out using the yard cranes and be transported to the owner by truck (or be sent to the quay crane and loaded onto the ship). The landside operations of this process encompass yard truck scheduling, storage space allocation, and yard crane scheduling.
In this paper, we assume a container port with N T terminals, each terminal m ∈ T with independent natural conditions and resources, such as the length of the quay L m T , the water depth h m , the number of quay cranes N m Q , etc. During the planning period H, N V ships will arrive, each ship i ∈ V with a different draft d f i , expected arrival time µ A i , expected departure time ED i , etc. In addition, there are already N 0 vessels in the terminals at the beginning of the planning period. The actual arrival time A s i and the actual efficiency of cranes v s i are defined as random variables with normal distribution. In addition, N S samples are generated according to the distribution function. For each vessel, a penalty cost is incurred if its actual arrival time A s i exceeds its scheduled berthing time y i or if its actual departure time d s i exceeds its expected departure time ED i . The penalty cost is a measure of the deviation from the planned schedule and is used to discourage such deviations and promote adherence to the scheduled time frames. When the vessel's actual berthing terminal T V i does not coincide with the pre-assigned terminal T i , the export containers need to be transferred to the actual berthing terminal. In practice, if the ship deviates from the preferred berth, the container will be transported from the container truck to the corresponding yard and container area of the preferred berth, then the carbon dioxide emissions will be generated. In the context of this problem, the berthing terminal T V i , berthing position x i , berthing time y i , and the number of quay cranes assigned C i are determined to minimize the expected value and the standard deviation of the total cost for all ships across all samples.

1.
Berths are uninterrupted and vessels may dock at any point along the quay, provided that they meet the necessary requirements; 2.
Terminals have different water depths, and vessels can only berth at terminals that meet their draft; 3.
All quay cranes on the same terminal are located on the same track and cannot change or serve across terminals; 4.
The minimum and maximum number of quay cranes for each vessel are required, and the actual operational efficiency of the quay cranes will decrease when multiple quay cranes are working on the same vessel together.

5.
The actual arrival time and efficiency of quay cranes are modeled as stochastic variables following a normal distribution (Tables 1 and 2).
The constant in the model are as Table 1, and the decision variables and Auxiliary decision variables are as Table 2.

Type Symbol Definition
Constants T Set of terminals, T = 1, 2, · · · , N T V Set of vessels to be scheduled, V = 1, 2, · · · , N V V 0 Set of vessels berthed before planning period, V 0 = 1, 2, · · · , N 0 Q m Set of quay cranes at the terminal m, Q m = 1, 2, · · · , N m Q , m ∈ T S Set of samples; each represents the actual arrival time, the quay crane operational efficiency and the actual departure time, S = 1, 2, · · · , N S L m Desired berthing position of the vessel i at its pre-assigned terminal, i ∈ V c x Deviation cost per meter between vessel's berthing position and its desired position c y Operation costs per hour for a quay crane c km Transshipment costs per container from terminal k to terminal m, k, m ∈ T p i Penalty cost per hour when the actual departure time of vessel i exceeds its expected departure time, i ∈ V p be f ore Waiting cost per hour when actual arrival time earlier than scheduling berthing time p a f ter Penalty cost per hour when actual arrival time later than scheduling berthing time M A sufficiently large positive number Table 2. Variable definition.

Type Symbol Definition
Decision variables If the quay crane q at terminal m serves the vessel i, If the vessel j berths after the departure time of vessel i, δ If the vessel j berths to the right of vessel i, If the vessel j berths after the departure time of berthed vessel i, ε If the vessel j berths to the right of berthed vessel i, If the vessel j berths to the left of berthed vessel i, ε l ij = 1; otherwise, ε l ij = 0, j ∈ V, i ∈ V 0 Chat Source: journal of marine science and engineering [32].

Cost of Carbon Calculation
To calculate the carbon emission cost of the port, we primarily consider the additional carbon emissions resulting from the ship deviating from its pre-assigned berth. When a ship fails to dock at the pre-assigned berth, its containers must be transported to the pre-assigned terminal using container trucks, which incurs an associated carbon emission cost.
In (1), c x denotes the cost of carbon emissions per unit distance for container trucks, measured in US dollars per meter. AD t represents the fuel consumption rate per unit distance of the collector truck (primarily diesel for container trucks) measured in tons per kilometer. q represents the low heating value of diesel fuel, measured in megajoules per ton of fuel. EF t represents the fuel emission factor measured in grams of carbon dioxide per megajoule of energy produced. P represents the unit cost of carbon dioxide (CO 2 ) emissions, measured in US dollars per ton.

Objective Function
With the objective function, referring to the literature [33], first, we generated a certain number of samples, each with the actual arrival time, quay crane operational efficiency, and actual departure time for all vessels. Then, we calculated the total cost for all vessels in the scheduling plan under each sample. Finally, we minimize the expectation plus the standard deviation of the total cost under all samples as the objective function, as shown in (2) and (3).
In (3), c y C i d s i − max y i , A s i represents the operational cost. p be f ore y i − A s i ) + refers to the waiting cost incurred when the actual arrival time of a vessel is earlier than its scheduled berthing time. In case a vessel arrives before its scheduled berthing time, it is required to anchor and wait, which results in lower satisfaction for the vessel and potentially affects the port's competitiveness. p a f ter A s i − y i ) + represents the penalty imposed when a ship's actual arrival time exceeds its scheduled berthing time, resulting in delays that negatively impact the port's efficiency and customer satisfaction. p i d s i − ED i ) + denotes the penalty cost incurred when the actual departure time of a vessel is later than its expected departure time. Ensuring smooth departure is crucial for both ships and terminals. Failure to depart on time may result in delay in reaching the next port for the ship, and disrupt the berthing and operations of subsequent ships for the terminal. c km z ik u im W i U represents the transshipment cost incurred due to the deviation between the actual terminal used and the pre-assigned terminal for each vessel. c x W i U + W i D |x i − bp i |z im u im represents the carbon emissions cost associated with deviations between the desired berthing position and the actual berthing position of a vessel.

Constraints
The objective function plays a critical role in determining the most optimal scheduling scheme. However, it is essential to take into account numerous constraints to obtain a practical and feasible ship berthing plan and shore bridge allocation plan. In our model, there exist constraints that require consideration in addition to the objective function. In the case of berthing terminals, it is necessary to ensure that each ship only berth at one terminal, as shown in (4). In addition, (5) ensures that the water depth of the terminal where each vessel berths meets its draft.
There are also constraints on berthing positions for all vessels. Firstly, as shown in (6), the position for a vessel to berth must be within the quay of the terminals. Secondly, it is also necessary to ensure that no two vessels occupy the same section of terminal at the same time, as shown in (7)-(9).
There are also several constraints on the berthing time. The vessel's arrival time and quay crane operational efficiency are usually uncertain and obey a normal distribution, i.e., , which changes the berthing time and makes the scheduling plan infeasible. Therefore, to minimize the impact of these uncertainties without rescheduling, we consider the sum of the expected value and relaxation as the arrival time during scheduling and employ the same approach for the quay crane operational efficiency. As shown in (10), all vessels must berth after their arrival. In (1), the relationship between the vessel's departure time, berthing time, and quay crane operational efficiency is defined. In addition, as shown in (12) and (13), when any two ships do not berth at the same terminal at the same time, it is also necessary to ensure the relationship between their berthing time and departure time.
In addition to the above constraints, if any two vessels berth at the same terminal, they must have a left-right relationship in berthing position or a sequential relationship in berthing time. If not, there is a risk of simultaneous occupation of the same section of the quay, necessitating the use of Equations (14) and (15).
Several constraints on quay cranes must be satisfied, too. Firstly, Equation (16) specifies a minimum and maximum number of quay cranes that can be assigned to each vessel. At the same time, (17) ensures the quay cranes serving a vessel belong to the terminal where the vessel berths. In addition, as shown in (18) and (19), each quay crane serves at most one vessel at the same time; (20) indicates that the serial number of quay cranes serving one vessel must be consecutive. Finally, (21)-(23) ensure that the quay cranes cannot cross each other or cross terminals to serve any two vessels berthing together.

Solution Method
The multi-terminal continuous berth and quay crane scheduling problem with uncertainties is more complex than the berth allocation problem, which is already an NP-hard problem. It is hard to find the optimal solution in polynomial time for large-scale problems. Thus, this study proposes an adaptive improved genetic algorithm, which integrates a simulated annealing mechanism (SA-AGA) to solve the problem. Figure 2 shows the flow chart of our algorithm.

Solution Method
The multi-terminal continuous berth and quay crane scheduling problem with uncertainties is more complex than the berth allocation problem, which is already an NPhard problem. It is hard to find the optimal solution in polynomial time for large-scale problems. Thus, this study proposes an adaptive improved genetic algorithm, which integrates a simulated annealing mechanism (SA-AGA) to solve the problem. Figure 2 shows the flow chart of our algorithm.

Encoding & Decoding Rules
How to encode the solution of a problem as a chromosome is a vital problem in applications of the genetic algorithm. In this paper, as shown in Figure 3, we adopt the real number encoding method and use a matrix of size 7N_V to represent a solution.

Encoding & Decoding Rules
How to encode the solution of a problem as a chromosome is a vital problem in applications of the genetic algorithm. In this paper, as shown in Figure 3, we adopt the real number encoding method and use a matrix of size 7N_V to represent a solution.

Encoding & Decoding Rules
How to encode the solution of a problem as a chromosome is a vital problem in applications of the genetic algorithm. In this paper, as shown in Figure 3, we adopt the real number encoding method and use a matrix of size 7N_V to represent a solution.  The genetic block corresponds to the serial number of vessels. The first three segments of the genetic block correspond to the berth's terminal , position , and time for each vessel. The fourth and fifth segments of the genetic block represent the number of assigned quay cranes and the serial number of the first assigned quay crane . The last two segments indicate the relaxation of the arrival time Δ and the operational efficiency Δ , separately.
Taking Figure 3 as an example, the first vessel berths at 233 m from the second terminal at 12.8 (=11.4 + 1.4) and is served by quay cranes from 2 to 4. The quay crane operational efficiency is the expected efficiency plus relaxation ( + 1.3). Similarly, the second 2) and is served by quay cranes from 2 to 5. The quay crane operational efficiency is the expected efficiency plus the slack (µ v i + 1.1), followed by the following.

Population Initialization
If the initial solution is of higher quality, the population may evolve to a better state after fewer iterations. Otherwise, it will take longer to approach the optimal solution, and the algorithm can be less efficient. At the same time, the diversity of the initial population makes it more possible to approach the optimal solution and easier to jump out of the local optimum. Therefore, this paper uses the greedy construction strategy to obtain the initial population combining the random generation strategy.
On the one hand, half of the initial population is generated using the greedy construction strategy. First, the pre-assigned terminal is designated as the berthing terminal, and the desired berthing position bp i is assigned as the berthing position for each vessel. Then, the expected arrival time plus the initial relaxation of arrival time µ A i + ∆ A i is considered as the berthing time. Furthermore, we designate the number of quay cranes assigned to each vessel as a random integer in the interval C min i , C max i and the serial number of the first quay crane assigned to each vessel as 1. Finally, let the quay crane operational efficiency be µ v i + ∆ v i . On the other hand, the remaining 50% of the initial population is selected through a random generation strategy. To be specific, the berthing terminal for the vessel is generated randomly from the range [1, N T ], and the berthing position is generated randomly from the range l 0, L m T − L i V and the interval 0, L m T − L i V . The berthing time, the number of quay cranes assigned, and the operational efficiency relaxation are fixed in the same way as the greedy construction strategy. Moreover, the serial number of the first quay crane is generated as an integer within the interval 1, N m q − C i + 1 .

Gene Repair Method
Some constraints in the model have been satisfied after the population initialization. However, there are still many constraints that have not been met. The vast majority of solutions in the population generated after initialization are infeasible. Therefore, it is necessary to convert infeasible solutions into feasible ones through the gene repair method. The specific steps are outlined in Table 3. Table 3. Steps for the gene repair method.

The Gene Repair Method:
Step 1 : If the water depth h m of the terminal where the vessel berths is less than its draft d f i for any vessel i ∈ V, then reselect the its berthing terminal; Step2 : Obtain the set of vessels that have already been scheduled V m ready and the set of vessels that are planned to schedule V m already for each terminal m ∈ T. Then, sort them according to the increasing order of the vessels' berthing time; Step 3 : Let the set of vessels that have already berthed when scheduling V now be an empty set ∅, and consider the first vessel i in the set V m ready as the currently scheduled vessel. For any vessel j ∈ V m already , if its actual departure time d j is greater than the berthing time of the currently scheduled vessel i, add the vessel j to the set V now ; Step 4 : To schedule Q idle , determine the set of unoccupied quay segments based on the berthing position x j , length L j V , assigned quay cranes C j , and the serial number of the first assigned quay crane q start j for all vessels in the set V now ; Step 5 : Let the set of available idle quay segments Q use f ul when scheduling be an empty set ∅. For each idle quay segment s ∈ S in the set Q idle , if its length l s is greater than the length L i V of the currently scheduled vessel and the number of available quay cranes NC s is greater than the minimum number of quay cranes required C min i for the currently scheduled vessel, then add the idle quay segment s to the set Q use f ul ; Step 6 : If the set of available idle segments Q use f ul is empty, modify the berthing time of the currently scheduled vessel y i to the minimum departure time d j for all vessels in set V now , and turn to Step 2; Step 7 : If the quay segment occupied by the currently scheduled vessel is within any available idle quay segment s in the set Q use f ul , meaning x i ≥ x start s and x i + L i V ≤ x end s , where x start s and x end s indicate the start and end of the quay segment s respectively, then moor the vessel in the quay segment s and go to Step 8; otherwise, turn to Step 9; Step 8 : If the set of quay cranes assigned to the vessel i is a subset of the set of quay cranes within the quay segment where the vessel moored, i.e., q start i ≥ q start s and q start i + C i − 1 ≤ q start s + NC s − 1, where q start s and q end s indicate the serial number of the first and last quay crane of the quay segment s respectively, then go to Step 11; otherwise, turn to Step 10; Step 9 : Select a random segment s from the set Q use f ul . Then, modify the berthing position x i to a random integer within Step 10 : Let the number of quay cranes assigned C i be a random integer in the interval C min i , min C max i , NC s and let the serial number of the first quay crane assigned q start i be a random integer in the interval q start s , q end s − C i + 1 ; Step 11 : Remove the currently scheduled vessel i from the set V m ready , and add it to the set V m already ; Step 12 : If the set V m ready in any terminal m ∈ T is empty, then the chromosome has been repaired; otherwise, go back to Step 3.

Fitness Function and Genetic Operations
The genetic algorithm is a general search method that combines both directed and stochastic capabilities. It judges the merit of individuals within a population through the fitness value. The information accumulated during the search is obtained through the selection mechanism. Crossover and mutation, on the other hand, are used to search for new areas in the solution space.
The fitness function in the model is defined as the inverse of the objective function, represented as Equation (24), where K is a constant.
For the selection operation, we use the roulette wheel strategy combined with the elitist preservation strategy. Specifically, the probability of each chromosome being chosen for generating the new population is yielded according to its fitness value. Furthermore, the best 10% of individuals of the parent population are retained directly in the new population.
For the crossover operation, we use the fitness-based fusion crossover operator proposed by Beasley and Chu [34], which takes into account both the structure of the parent solutions and their fitness values. Table 4 describes its steps. Table 4. Steps of the fitness-based fusion crossover operator.

The Crossover Operator:
Step 1 : Randomly select two chromosomes from the parent population, denoted as P 1 and P 2 .Then calculate their fitness values, represented as f P1 and f P2 , respectively; Step2 : For each gene of the crossed child chromosome C[i], the probability of being Next, in the mutation operation, we adopt the uniform mutation strategy. For example, we randomly choose a parent chromosome denoted as P.
As the generation increases, the solution gradually converges and tends to fall into a local optimum. Therefore, as shown in (25), we make the mutation probability adaptive to jump out of the local optimum. As the number of generations with an unchanged optimal solution increases, the mutation probability is correspondingly increased.

The Simulated Annealing Mechanism
As previously noted, while genetic algorithms are effective at global search, they may not perform as well for local search. Such algorithms also tend to converge prematurely and have low search efficiency at the later stages of evolution. Therefore, we also apply a simulated annealing mechanism to improve the quality of the solution by performing a neighborhood search based on the high-quality solution obtained after the genetic algorithm. The steps are listed in Table 5. Table 5. Steps of the simulated annealing mechanism.

The Neighborhood Search Combined with Simulated Annealing Mechanism:
Step 1 : Initialize the current generation as h = 1 and the system temperature as T = T 0 ; Step2 : If the number of consecutive generations for which the optimal solution remains unchanged, denoted as g uc exceeds 10% of the maximum genetic generation G max , and the current generation h is less than the maximum allowed generations H max , proceed to Step 3; otherwise, terminate the simulated annealing process; Step 3 : Search in the neighborhood Ω P of the optimal solution P max of the current population to obtain a new solution P new ; Step 4 : Repair the new solution P new to make it feasible and calculate its fitness value f new ; Step 5 : If the fitness value of the new solution f new is greater than the maximum fitness value f max , turn to Step 6; otherwise, go to Step 7; Step 6 : Let P max = P new , f max = f new , g uc = 1, and stop the simulated annealing process; Step 7 : Calculate the acceptance probability p accept = e ( f new − f max )/T , and generate a random number r ∈ [0, 1]. If r < p accept , turn to Step 8; otherwise, turn to Step 9; Step 8 : Modify the worst solution of current population, and set P min = P new , f min = f new ; Step 9 : Modify the system temperature T = ηT and the current generation h = h + 1, turn to Step 2.
In the proposed process, the neighborhood solution of a given solution is obtained by modifying the information pertaining to any vessel. As an illustrative example, consider a solution denoted as P. To generate a set of neighboring solutions for P, we randomly select a ship i and perturb its berthing terminal, berthing position, berthing time, number of assigned quay cranes, the serial number of the first assigned quay crane, and the relaxations of arrival time and quay crane operational efficiency, within their respective domains. We denote the set of all such solutions generated by this procedure as the neighborhood Ω P of the solution P.

Analysis of Algorithm Effectiveness
This paper proposes a novel SA-AGA algorithm that applies a greedy construction strategy to the initial population generation process and incorporates a simulated annealing mechanism into the genetic algorithm. To evaluate the performance of the SA-AGA algorithm, we conducted experiments with randomly generated examples of 20, 30 and 40 ships arriving at the port. We compared the results obtained with the SA-AGA algorithm, an NG-AGA algorithm that lacks the greedy construction strategy, an NSA-AGA algorithm that lacks the simulated annealing mechanism, and a traditional adaptive genetic algorithm (AGA) that lacks both. We analyzed the experimental results to assess the effectiveness of the proposed algorithm. Figure 4 depicts the variations of objective function values against the number of iterations for the SA-AGA, NG-AGA, NSA-AGA, and AGA algorithms applied to randomly generated cases with 20, 30 and 40 ships to be scheduled, respectively. The curves of SA-AGA, NSA-AGA, and AGA demonstrate that the combination of the simulated annealing mechanism with the genetic algorithm solution framework effectively prevents the algorithms from converging to local optima. As a result, the final scheduling solutions have lower objective function values and better quality.  Furthermore, the curves of SA-AGA and NG-AGA indicate that the use of both the random generation strategy and the greedy construction strategy during population initialization leads to faster convergence of the objective function values with an increasing number of ships to be dispatched, and lower objective function values are obtained. These findings suggest that the proposed SA-AGA algorithm has better performance compared to the other algorithms tested. Furthermore, the curves of SA-AGA and NG-AGA indicate that the use of both the random generation strategy and the greedy construction strategy during population initialization leads to faster convergence of the objective function values with an increasing number of ships to be dispatched, and lower objective function values are obtained. These findings suggest that the proposed SA-AGA algorithm has better performance compared to the other algorithms tested.

Numerical Experiments
This paper presents numerical experiments to validate the algorithm proposed in Section 4. The experiments were conducted on a computer system equipped with an Intel Core i5-8300H CPU clocked at 2.30 GHz and 16 GB of RAM, using MATLAB 2016a as the software platform.

Parameter Design
Before starting the experiments, it is necessary to determine the parameters. The parameters involved in our experiments can be divided into three categories: terminal parameters, vessel parameters, and algorithm parameters.

Terminal Parameters Design
In this paper, our experimental subject is a port with three container terminals.  , 1). Furthermore, the interference coefficient between the quay cranes g is 0.9.
To calculate the objective function value, it is necessary to determine the various cost factors in the port. Table 6 indicates the transshipment cost c km between terminals for a container. The operating cost c y for each quay crane is 4.34 per hour. The carbon emissions cost c x when the vessel's berthing position is different from the desired berthing position is 0.01 per dollar per meter. The waiting cost p before for a vessel at anchor is 33.2 per hour. The penalty cost per hour p i when a vessel departs the port with a delay is 10% of the length L i V . When one ship arrives late, the berthing and departure of subsequent vessels may be affected. Therefore, a penalty cost p after is needed and we set it to 100 per hour. In addition, the size of the samples N S is 20.

Vessel Parameters Design
At the beginning of the scheduling period, we assume that several vessels have berthed already and are being served. Table 7 outlines the parameter ranges for both scheduled and unscheduled vessels. The symbol U indicates a uniform distribution, while Z represents the set of integers. The planning period is 72 h, and the number of vessels scheduled at each terminal is between 1 and 3. In addition, it is worth noting that the draft constraint should be met when determining the berthing terminal or the pre-assigned terminal of the vessels. The drafts for all vessels are obtained according to (26).  The ordinal number of the first quay crane allocated Pre-assigned terminal for vessels to be scheduled The number of containers for export that need to be scheduled for the vessels U(100, 300) ∩ Z W i D Total count of import containers for scheduled vessels

Algorithm Parameters Design
Before using the algorithm, the necessary parameters need to be determined. In this paper, we set the population size popsize = 100, the number of generations G max = 500, and the initial probability p 0 m = 0.6. In terms of the simulated annealing mechanism, we set the initial temperature T max = 100, the cooling rate η = 0.8, and the maximum generation of the simulated annealing mechanism H max = 100.

Results and Analysis
First, three scheduling strategies are defined. These strategies include multi-terminal cooperative scheduling under uncertainty (referred to as M + U), multi-terminal independent scheduling under uncertainty (referred to as S + U), and multi-terminal cooperative scheduling under certainty (referred to as M + C). We then compare them in terms of the objective function value (i.e., total cost), vessel departure delay rate, quay utilization, and quay crane utilization.
Under the S + U, the mathematical model can be obtained by adding (27) to the MU-BAQCAP. It limits the actual berthing terminal for each vessel to its pre-assigned terminal. The algorithm is also similar to the SA-AGA, except that the berthing terminals of vessels are fixed to their pre-assigned terminals.
According to Section 5.1, ten cases were constructed for each scale of 20, 30, and 40 vessels, respectively. The average value of the algorithm under five runs is used as the final result for each scheduling strategy. Table 8 displays the objective function values for each experiment under M + U and S + U, with the difference between them referred to as Gap. It is evident that the total cost of scheduling under S + U is considerably higher than that under M + U, with the difference between them increasing as the number of vessels to be scheduled grows. The increase can be attributed to the efficient sharing of terminal resources as the number of ships increases, enabling them to be berthed on schedule and significantly decreasing waiting, delay, and penalty costs. Similarly to Table 8, the results of the objective function values for each experiment under M + U and M + C are presented in Table 9. The difference between the objective function values of M + U and M + C is defined as the Gap. Again, we can find that the cost of the scheduling solution obtained under M + U is lower than under M + C. However, the difference between them, which is only about 20%, is not as large as the difference between M + U and S + U which is about 50~80%. The objective function values for each experiment under different scheduling strategies are presented in Figure 5a-c, corresponding to the scale values of 20, 30, and 40, respectively. Clearly, the variations of the objective function values in the M + U and M + C are much smaller than those in the S + U under all scales. The reason is that the workload of each terminal can be more balanced by sharing resources with others. In contrast, in the independent scheduling strategy, when the number of vessels at a particular terminal is much higher than others, these vessels can only wait at anchor due to the inability to share the resources of other terminals. As a result, the queue waiting on the berth becomes longer and the total cost increases. Therefore, in scheduling operations for dispatched vessels at this container port, the highest priority should be given to addressing the impact of uncertain environmental factors, which can result in cost savings of approximately 40-60% for the port. In addition, there is a need to integrate all terminals and coordinate the scheduling of internal resources, which can yield cost savings of approximately 10-20% for the port. longer and the total cost increases. Therefore, in scheduling operations for dispatched vessels at this container port, the highest priority should be given to addressing the impact of uncertain environmental factors, which can result in cost savings of approximately 40-60% for the port. In addition, there is a need to integrate all terminals and coordinate the scheduling of internal resources, which can yield cost savings of approximately 10-20% for the port. There are many other indicators beyond the total cost that can measure the performance of a scheduling plan in a container port. Therefore, in this paper, three other indicators are selected to further evaluate the scheduling plans obtained under the scheduling strategies: vessel delay departure rate , quay utilization , and quay crane utilization . The vessel delay departure rate is calculated by (28), the quay utilization by (29), and the quay crane utilization by (30). There are many other indicators beyond the total cost that can measure the performance of a scheduling plan in a container port. Therefore, in this paper, three other indicators are selected to further evaluate the scheduling plans obtained under the scheduling strategies: vessel delay departure rate τ delay , quay utilization τ quay , and quay crane utilization τ crane . The vessel delay departure rate is calculated by (28), the quay utilization by (29), and the quay crane utilization by (30).
Here, N s delay denotes the number of vessels in sample s that depart later than their desired departure time ED i . N V indicates the number of vessels to be scheduled. N S denotes the number of samples; H denotes the planning period. A s i and d s i represent the actual arrival and departure time of vessel i in sample s, respectively.
A delay in vessel departure time means that it may not arrive at the next port on time, and thus reduces the satisfaction of the customer. Figure 6 shows the vessel delay departure rates for each experiment in different scheduling strategies under the scales 20, 30, and 40, respectively. As can be seen, in most experiments, the delay rates under M + U and M + C are generally lower than those under S + U. The gap becomes more noticeable as the number of vessels to be scheduled increases, with the difference reaching about 10% in most experiments. Furthermore, the uncertainty factor has little impact on the delayed departure rate, which is slightly higher when considering uncertainties than when not, up to about 8%, but within 5% in most experiments. By adding the buffer time variable, the impact of uncertain factors on the planned berthing time of the ship is taken into account, reducing the possibility of the actual arrival time being later than planned. This implies that the scheduling plan considers uncertainties such as ship arrival time and shore bridge operation efficiency, which can effectively reduce the rate of ship arrival delays, minimizing their impact on subsequent ship berthing and enhancing the plan's feasibility.
Higher utilization of terminal resources means fewer idle resources on the terminal, which also reduces the idle cost. Figure 7 shows the quay utilization in the three scheduling strategies under the scales 20, 30, and 40, respectively. Figure 8 shows the quay crane utilization. From Figures 7a and 8a, it is noted that when the number of vessels to be scheduled is 20, the gap in the quay utilization in different strategies is not significant, so the quay crane utilization is. The reason is that the number of vessels to be scheduled is too small and the resources cannot be fully utilized yet. Therefore, the utilization of resources in different strategies is similar. When the number of vessels to be scheduled reaches 30, the quay and quay crane utilization in the M + U and M + C are still not significant. However, we can still find that the resource utilization under M + C is about 3% lower than under M + U, regardless of the quay or quay crane, as shown in Figures 7b and 8b. As the number of vessels increases to 40, we can find in Figures 7c and 8c that the difference is more significant with resource utilization between S + U, M + C, and M + U, up to about 13% at the maximum. Therefore, as the number of vessels increases, integrating all terminals and coordinating their internal resources can effectively increase the utilization of critical terminal resources.
actual arrival and departure time of vessel in sample s, respectively.
A delay in vessel departure time means that it may not arrive at the next port on time, and thus reduces the satisfaction of the customer. Figure 6 shows the vessel delay departure rates for each experiment in different scheduling strategies under the scales 20, 30, and 40, respectively. As can be seen, in most experiments, the delay rates under M + U and M + C are generally lower than those under S + U. The gap becomes more noticeable as the number of vessels to be scheduled increases, with the difference reaching about 10% in most experiments. Furthermore, the uncertainty factor has little impact on the delayed departure rate, which is slightly higher when considering uncertainties than when not, up to about 8%, but within 5% in most experiments. By adding the buffer time variable, the impact of uncertain factors on the planned berthing time of the ship is taken into account, reducing the possibility of the actual arrival time being later than planned. This implies that the scheduling plan considers uncertainties such as ship arrival time and shore bridge operation efficiency, which can effectively reduce the rate of ship arrival delays, minimizing their impact on subsequent ship berthing and enhancing the plan's feasibility.  Higher utilization of terminal resources means fewer idle resources on the terminal, which also reduces the idle cost. Figure 7 shows the quay utilization in the three scheduling strategies under the scales 20, 30, and 40, respectively. Figure 8 shows the quay crane utilization. From Figures 7a and 8a, it is noted that when the number of vessels to be scheduled is 20, the gap in the quay utilization in different strategies is not significant, so the quay crane utilization is. The reason is that the number of vessels to be scheduled is too small and the resources cannot be fully utilized yet. Therefore, the utilization of resources in different strategies is similar. When the number of vessels to be scheduled reaches 30, the quay and quay crane utilization in the M + U and M + C are still not significant. However, we can still find that the resource utilization under M + C is about 3% lower than under M + U, regardless of the quay or quay crane, as shown in Figures 7b and   In summary, in the case of a container port with multiple terminals, it can improve the port's operating cost, the vessel delay, departure rate, and the utilization of quay and quay cranes by sharing their resources and accounting for the uncertainty in vessel arrival time and quay crane operational efficiency.

Conclusions and Future Work
The present study investigates the berth allocation problem and quay crane allocation problem for multiple terminals under the context of low carbon emissions and uncertainty in vessel arrival times and quay crane operational efficiency. After considering con- 8b. As the number of vessels increases to 40, we can find in Figures 7c and 8c that the difference is more significant with resource utilization between S + U, M + C, and M + U, up to about 13% at the maximum. Therefore, as the number of vessels increases, integrating all terminals and coordinating their internal resources can effectively increase the utilization of critical terminal resources.  In summary, in the case of a container port with multiple terminals, it can improve the port's operating cost, the vessel delay, departure rate, and the utilization of quay and quay cranes by sharing their resources and accounting for the uncertainty in vessel arrival time and quay crane operational efficiency.

Conclusions and Future Work
The present study investigates the berth allocation problem and quay crane allocation problem for multiple terminals under the context of low carbon emissions and uncertainty in vessel arrival times and quay crane operational efficiency. After considering con- In summary, in the case of a container port with multiple terminals, it can improve the port's operating cost, the vessel delay, departure rate, and the utilization of quay and quay cranes by sharing their resources and accounting for the uncertainty in vessel arrival time and quay crane operational efficiency.

Conclusions and Future Work
The present study investigates the berth allocation problem and quay crane allocation problem for multiple terminals under the context of low carbon emissions and uncertainty in vessel arrival times and quay crane operational efficiency. After considering constraints such as interference between quay cranes, existing berthing vessels at the beginning of the planning period, vessel draft requirements, and container transshipment, a multi-terminal berth and quay crane joint robust scheduling model considering carbon cost (MU-BAQCAP) was developed under the uncertainties. Then, an adaptive improved genetic algorithm (SA-AGA) is designed for the solution in combination with the simulated annealing mechanism, and the applicability of the algorithm is verified through numerical experiments. The results show that, compared with the independent scheduling for multiple terminals under uncertain environments and the collaborative scheduling for multiple terminals under certain environments, scheduling with the uncertain environment and the coordination mechanism for multiple terminals can have a greater advantage in terms of total cost and can more effectively improve the service capacity and competitiveness of container ports. The differences between the results with and without collaborative scheduling are more significant than the ones between the results with or without considering the uncertain environment.
Future research could explore the following areas: (1) The quay crane allocation problem studied in this paper is static. However, if the quay crane can be used for other vessels before the vessel it is serving departs (dynamic quay crane allocation problem), the utilization of the quay crane can be greatly improved. Therefore, this restriction can be introduced into the model in subsequent research. (2) This paper assumes that the quay crane can reach anywhere along the quay. However, in the actual operation of a container port, the quay cranes can only move within a fixed area. Therefore, we need to take it into account in future studies to make the model more realistic and feasible. (3) The scope of this paper is limited to addressing the berth allocation problem and quay crane allocation problem in container port operations. However, there are many other processes involved, such as container truck scheduling, storage allocation, and yard crane scheduling. These processes are interlinked and interdependent. Therefore, more processes need to be included in the study to obtain a more feasible scheduling solution.
Author Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Data available in a publicly accessible repository that does not issue. DOIs Publicly available datasets were analyzed in this study. This data can be found here: https: //github.com/Jiajia-fe/Data-and-Code-for-Article.git, accessed on 12 February 2023.