Discrete-Event Control and Predictive Optimization of Fuel Tankers and Pumps Allocation

This paper deals with a dynamic scheduling model of a general fuel tankers and pumps operations. The models are dynamics because the ships’ arrival time is allowed to vary. The goal of the study is to determine the optimal berth allocation/scheduling and the policy recommendations, which minimize ships’ total waiting time, berth occupancy ratio, and ships’ charter cost. Discrete-event Systems (DES) modeling is chosen due to aperiodicity in ships’ arrival time and asynchrony operations’ time among different berthing positions. Two DES models are developed, i.e.: (1) multiple cost allocation problem (MBAP) for the supply jetty and (2) simple berth allocation problem (SBAP) for the consignment jetty. Furthermore, we use model predictive control (MPC) to optimize the DES model, and we also provide mathematical analysis of the proposed algorithm. Numerical examples examining two cases (tidal and non-tidal) in each of the two models are presented to illustrate the optimal solution. The problem encountered is that current berth allocation is not working efficiently, as indicated by the average waiting time for ships at the supply jetties (jetties 1 and 2) which is above the standard (14 hours), while the consignment jetty (jetty 3) is well below standard.


Introduction
Indonesia as the largest archipelagic country in the world is traversed by 40% of sea trade routes, where sea routes contribute to 90% of world trade routes [1].Indonesian sea transportation routes are used in various supply chain activities, one of which is in the petroleum industry.Petroleum companies carry out the extraction and processing of crude oil sources located on the edge of sea waters with refinery unit infrastructure.An oil refinery located in the middle of the sea requires sea transportation to the fuel terminal (FT).FT is mostly on the waterside intended for efficient transportation from/to oil refineries.FT is a unit that receives fuel products, both raw and ready-touse, in large volumes and distributes them to various regions.Transportation from the refinery unit to a FT, among FTs, and from a FT to other depots can be reached by using various types of oil transport ships.Vessels come over time to the jetty, then the operators schedule the jetty for the ship based on certain factors and considerations.Berth allocation problems relate to the assignment of ships to the jetty at a maritime terminal [15].A common problem for a FT jetty is related to high waiting time for ships, causing special handling on ships and an increase in service rates.This study aims to model berth scheduling with the root problem of the inefficient jetty/berth allocation scheduling and inadequate decision-making.The performance criterion to be measured is the vessel waiting time (VWT).In measuring it, we model three performance measures that have an impact on the main performance measures: (i) total waiting time for vessels, (ii) berth occupancy ratio (BOR), and (iii) charter fees.In this paper, the decision variable is the ship's decision to berth at a certain jetty at a certain event time.
Two approaches used in this study are the discrete-event systems (DES) and model predictive controls (MPC).The DES model is applied in this paper because the time status of ship activity changes where system changes occur at discrete time points.A dynamic approach is more suitable for use on berth allocation problems because it corresponds to the evolution of time and the dependence between one ship's and the next ship's schedule, as found in [4].Here, the static problem approach is not suitable because the static model uses deterministic parameters, and the optimization is done for an initial solution to the final scheduling time.Thus, the implementation of the static model solution cannot accommodate delays in the arrival of ships or changes in the number of ships arriving at the FT.
The DES approach can evaluate the condition of berth availability at each point in time.The output of the DES approach is an ideal condition in berth scheduling using the existing scheduling sequence.To optimize the total waiting time of the DES reference model that uses the existing scheduling sequence, a model predictive control (MPC) approach is used.This approach is chosen because it predicts the output of the model and determines the optimal control trajectory that minimizes the cost function.MPC can produce optimal global solutions to the problem of optimizing the input allocation of the DES model with dynamic input sequences [7].This model will search for all possible solutions of a particular planning horizon.In this case, the planning horizon is a control limit parameter in search for model solutions.The output of the MPC approach is a scheduling sequence that is evaluated against the existing scheduling sequence.
MPC is known as an advanced technique that is widely applied in industry [6].Over the past 40 years, MPC has been successfully applied to complex industrial processes, which show great potential in dealing with complex problems under limited control optimization [9].Several studies related to MPC in various industries include automotive industry [10], inventory management in the supply chain [11], chemical processes [12], and semiconductor manufacturing [13].
The main reference models used in this study are the DES and MPC approaches from [4], which have the same event as this study, i.e., ship scheduling on the jetty.The setting of the models in [4] is for container vessels and terminals, where the resources are jetty and quay crane.Most of papers in BCAP is in container terminals, for instance is [14] and [15].In reality, BCAP problems can also be found in other types of terminals, such as bulk terminals, or more specifically fuel terminals which handle tanker vessels and liquid cargo.This is the first gap from the previous research, where we improve the application of the models to another kind of terminals, and the technical details of the models will be presented in the next paragraph.The DES models in [4] investigate dynamical events from ship arrivals, ship allocation to jetty, and berth operations.One drawback of the models in [4] is the exclusion of natural waterways and tidal condition, which is the second gap of the state-of-the-art models in [4].The ebb and flow nature in ocean waterways is included in this research.The third gap which is found in [4] is that the draft of jetty and vessels are not included in the models.In this research, we consider the draft conditions.This study adjusts [4] in: (1) calculating the pumping time by considering the pump specifications, the ship capacity, the setup time, and the preparation time for berth completion; and (2) using a fuel oil terminal object in which there are river tidal conditions, so that there will be an adjustment to the parameter value of ship arrival at the existing berth allocation which considers the temporary ship condition aground due to river tides.
In addition to the main reference model, several previous studies have similar characteristics, namely the berth allocation problem.It [14] optimizes berth dynamic scheduling at container terminals using the MPC approach, [15] optimizes waiting time at container terminals using a linear programming approach with static ship arrivals, and [4] controls and optimizes operations at container terminals using the DES and MPC approaches with static ship arrivals, as well as research by [16] that performs dynamic berth scheduling at container terminals using a linear programming approach.This paper is organized as follows: Section II provides a problem description and model formulation including DES, SBAP, MBAP, and MPC, as well as data collection, parameter estimation, and solution procedures.Section III provides mathematical analysis for the models.Section IV describes numerical examples and discussions of results along with recommendation policy and managerial insights.Finally, conclusions and a brief description of topics for future research are drawn in the last Section V.

Problem Description
We begin this section with a problem description for a generic fuel terminal.The terminal has three jetties consisting of two jetties for the supply process and one jetty for the consignment process.In one year, several fuelcarrying ships will berth to the jetty both from the sea and from the river.Ships for supply will carry fuel from the fuel supplier to the berth for unloading, while ships for consignment will carry fuel from the jetty for the process of filling fuel (loading) to the point of requesting fuel.
An explanation of each stage of the ship heading to PFT is as follows.
1. Ship's arrival, the ship comes to the jetty; this process is when the ship is still in the river before entering the berth area.In this stage, the data recorded is the actual time of arrival (ATA), which shows the ship's arrival time.2. Berthing, the ship is berthed at the available jetty.In this stage, the data recorded is the berthing time, which shows the time the ship is berthed at the jetty.3. Process, the ship carries out waiting for activities, pipe installation (hose connection), pipe pumping, and pipe discharge (hose disconnection).In this stage, the data recorded is process time, which shows the time of each ship activity.4. Unberthing, the ship has finished berthing and is preparing to leave the jetty.In this stage, the data recorded is the unberthing time, which shows the berth finishing time at the jetty.5. Ship's departure, the ship leaves the jetty; this process is when it has carried out a series of previous activities.In this stage, the data recorded is the actual time of departure (ATD), which shows the time the ship left.
The jetties operate 24 hours to serve ships coming either by sea or by the river.The problem experienced by the PFT jetty is that there are many ships with a high ship's waiting time.The standard used as a reference is United Nations Conference on Trade and Development (UNCTAD) 2021 which states that the ship's standard average waiting time is 14 hours.The root of the problem explored in this research is the absence of efficient berth scheduling.After understanding the problem, problem-solving is carried out using the discrete-event systems (DES) approach to find optimal scheduling solutions using the existing schedule.Then, from the DES results, scheduling optimization will be carried out with a model predictive control (MPC) approach which will produce a new schedule sequence.The objective function of the model is to minimize the vessel waiting time with the following decision criteria i.e., minimization of: (i) total vessel waiting time, (ii) charter fees, and (iii) berth occupancy ratio (BOR).

DES Models
Moreover, we will present discrete-event system (DES), for multiple berth allocation problems (MBAP) as well as the model predictive control (MPC) to solve the models.After that, we explain data collection, parameter estimation, and solution procedures.The main reference model in this paper is [4] so almost all models are built to refer to it.
A system where the state variables evolve according to discrete events that take place based on interactions between different (continuous and/or discrete) state variables in the system is referred to as a DES [2].In other words, DES is a dynamic system that evolves based on events that occur at certain points in time with irregular intervals [3].Mathematical modeling for the berth scheduling problems uses the DES approach.The DES is usually depicted with a Petri net [5].The conceptual model using a Petri net (see Fig. 1) will be used as a reference in developing the DES mathematical model.
For berth scheduling on supply jetties (jetties 1 and 2-so, more than one jetty is being operated), the MBAP model is used.This extends the dynamical modeling of a simple berthing process in (2) and ( 6) into multiple berth positions.Before determining the performance measure, we will first define the jetty dynamics variable j(k) where for each event time k, applies: where xb(k) is the finishing time of the b-th berth positions.Equation (1) refers to the earliest available berth position (denoted by j) based on the finishing time of each berth position at the previous event time k-1.For every b-th berth position at the event time k, we also denote new state variables zb(k) as the berth starting time, and yb(k) as the remaining operations time.Furthermore, the performance measures, Z, in the DES model of MBAP is formulated as follows in (2).
The dynamics of the jth berth position is given in (3)-( 5) ) ( ) ( ) ( ) Meanwhile, the dynamics of other b-th berthing position b ≠ j, is given in ( 6)-( 8) ( ) ( ) ( ) ( ) The state variable z in (3) and ( 6) defines the berthing time for every berth position at every event time k.The state variable y in ( 4) and ( 7) is the remaining operations time at every berth positions.Finally, as in the simple berthing process, the state variable x describes the estimated finishing time for every berth position.The mathematical parameters for μo and the relationship between dynamic sets S(k) and u(k) in MBAP can be found in ( 9) and (10).The cost function CN(k) which is the ship's total waiting time from the time evolution k to k+N-1 is similar to (7) given by (11).

MPC Algorithm
The MPC algorithm for MBAP is as follows.

Solution Procedures
In searching for a model solution, ship shipping numbers will be sorted according to the existing data as the existing scheduling order.Thus, for the MBAP models each has a shipping number by considering the return order in the existing data based on jetty supply (jetties 1 and 2) and consignment (jetty 3).The search for model solutions is carried out in the following two cases.

Case (1) Tidalconsidering the tidal conditions the waterways
The tidal conditions force the ship to run aground temporarily.Even though the pier is empty, if a ship coming in is hit by a river receding, the ship must wait first for the river to experience high tide.The first case in this model is a condition where there is a ship waiting time caused by the tides of the waterways.In this study, ships experiencing temporary grounding are identified in existing data by the presence of new ships and empty jetties at certain times.In ideal conditions without tides, the ship should be able to jetty immediately because the jetty is empty.However, when the jetty is empty and the ship has arrived, it is identified as a ship that has temporarily run aground.
To identify the ship, there are several mathematical inequalities that explain the relationship between the berth starting time and the berth finishing time on the previous ship.

( ) ( ) ( )
The inequalities ( 19) and (20) explain that the ship's arrival time at event time k is slower than the berth finishing time at event time k-1.This means that when the ship arrives, the jetty is empty.The inequalities (21) and ( 22) explain that the ship's arrival time at event time k is not the same (slower) than the berth starting time at event time k.If the inequalities ( 19) and (20) or inequalities (21) and ( 22) apply, then the jetty is empty and the ship is temporarily grounded so it must wait for high tide first.Therefore, the new arrival time is defined in the dataset, namely μa' as follows.
( ) ( ) This means that the adjustment of the ship's arrival time for the model dataset becomes the berth starting time that has temporarily run aground, so that the ship has experienced a temporary aground with a time of t ts(k)-μa(u(k)) [zb(k)-μa(u(k))] for SBAP [MBAP].If the conditions of inequalities ( 19) and (20) or inequalities ( 21) and ( 22) do not apply, then when the ship arrives there is no empty jetty/berth.

Case (2) Non-tidal -not considering the tidal conditions of the waterways
This case is an ideal scenario where there is no ebb and flow of the waterways.In this case it is also considered that dredging of the river by the FT or river tides do not cause the ship to temporarily run aground.This case is used as an alternative policy when there are better conditions on the waterways regarding river tides.
There is no change in the conceptual model or mathematical model in this second case.The difference in cases 1 and 2 is the parameter of the ship's arrival time where in the first case there is an adjustment of the arrival time parameter by considering the condition of the ship aground temporarily.

Mathematical Analysis
In this section, mathematical analysis is provided to justify the efficacy of the DES models and the MPC algorithm which have developed in Section II.Consider the nonlinear systems in (25).It is clear that our models in the previous section is nonlinear.
The multi-variable sector condition is given by Expression in ( 25) is equaivalent to By factor expanson yields we obtain in (28) In matrices form, we can also rewrite (28) into (29) as follows This completes our proof that P is a symmetric matrix.To prove that (25) is global exponentially stable, it can be achieved by using Lyapunov stability theory.Our candidate Lyapunov function is given as follows in (30).
The derivate is given in (31) and (32) Exponential stability of a function is guaranteed if it follows a condition given in (33) and (34 Linear matrix inequalities (LMI) in (33) holds only when (34) holds.Therefore, the S-procedure can be used to relax (34) and it yields in (35) The nonlinear system is asymptotically stable if an can be found such that (35) holds.Therefore, it completes our proof that our DES models and MPC algorithm are guaranteed stability which leads to optimality.

Data collection and parameterization
The process of collecting data is done by taking primary data directly from the a fuel terminal in Pontianak, Indonesia.The characteristics of the jetty and specifications of the ship are described in Table I and II below.We use the existing 2020 jetty schedule record which 224, 103, and 751 ships berth at jetty 1, 2, and 3, respectively.Due to page limitations, this data is not displayed.The pumping process uses a pump that is adapted to each type of ship.Prior to the pumping process, the pump setup is carried out in advance, while the setup time is shown in Table 3. Ships that come and leave the jetty are ships leased by Fuel Terminal to ship owners.Each ship will be calculated round trip days (RTD) then multiplied twice as well as the charter rate to get the charter fee (see Table 4).
Parameters of ship arrival time (μa), ship capacity (I), pump speed (V), setup time (s1), and the number of ships berth (M) will use existing data.The planning horizon (N) parameter is a parameter that is optimized using MPC.
In the meantime, the parameters of ship operating time (μo) and preparation time for completion of berth (s2) will be estimated.The results of estimation calculations will be used as input datasets in the model.This research uses the Python through Google Collab.

Experiment
The stages of finding a solution are as follows.First, the search for a solution will initially be carried out, namely in the existing First-Come First-Serve DES model (Existing-FCFS) where the decision variables are the same as the existing scheduling sequence.Next, a solution search will be carried out, namely the MPC for planning horizon N = 2, 3, 4, 5, 6.Furthermore, each model also considers two cases (cases 1 and 2).
Total Waiting Time: The main performance evaluation, namely the total vessel waiting time FCFS-Existing scheduling has succeeded in producing the berth starting time earlier than the existing condition.Whereas for each MPC model MBAP, the result is that the total waiting time of the predictive control model with planning horizon N = 6 is the best compared to other types of scheduling.
MBAP: On the existing schedule, the average vessel waiting time is 17.87 hours (see Fig. 2).The output of the FCFS-Existing model shows that the average waiting time for ships is reduced to 10.7 hours and 2.59 hours for scenarios 1 and 2, respectively.This significant decrease is due to MBAP using two jetties (jetties 1 and 2), where there is a more even distribution of jetty assignments compared to the existing conditions.Thus, the FCFS-Existing model that uses the same decision variables as the existing schedule has described the ideal existing scheduling conditions.Like SBAP, the output of the MBAP model on optimizing the FCFS-Existing model uses the predictive control (MPC) model with planning horizon N = 2,3,4,5 and 6 showing consistency of performance measures.
Berth Occupancy Ratio (BOR): Based on Fig. 3, the BOR value of the two jetties based on the model output is in the interval of 29-31% [29-32%].The output of the model successfully balances the BOR of jetties 1 and 2. Thus, the BOR values for jetties 1 and 2 meet UNCTAD standards (under 14 hours).The model output performs berth scheduling in a nearly balanced total operating time.This also causes the total waiting time in the MBAP model to be significantly reduced as the BOR value decreases compared to the existing conditions.As for jetty 3, the BOR value does not change because the total ship operating time is constant for all types of scheduling.Even though there is a change in the schedule sequence compared to the existing conditions, the total operating time of the ship remains constant.To reduce the BOR at jetty 3, the company may consider adding one jetty as a jetty for consignment.However, the addition of one jetty needs to be studied again from various aspects such as finance, environment, resources, social and governance, and so on.The MPC with planning horizon N = 6 is proven to provide optimal total waiting time for ships and charter fees compared to other types of scheduling, even though the BOR value for the N = 6 scheduling type is not significantly different (29-32%) from other DES and MPC scheduling types.Thus, the policy recommendation is to choose the MPC scheduling type with a planning horizon of N = 6.

Conclusions
Discrete-Event Systems (DES) and model predictive control in have been studied.The study of DES is done by developing Multiple Berth Allocation Problems (MBAP) models by considering two cases (tidal and non-tidal).
The goal for this study is to determine the optimal berth allocation/scheduling and the policy recommendations, which minimize ships' total waiting time, berth occupancy ratio, and ship's charter cost.The models and algorithm is analyzed mathematically to prove its stability.
Findings obtained from the numerical results are as follows: • The recommendation policy for Pontianak Fuel Terminal is the output of a predictive control model with a planning horizon of N = 6.• The average waiting time for ships for supply (jetties 1 and 2) decreases by 54.39% and 98.66% for cases 1 and 2, respectively; and for consignment (jetty 3) is decreases by 13.27% and 32.22% for cases 1 and 2, respectively.• Berth occupancy ratio (BOR) decreases on jetties 1 and 2. Jetty 3 does not experience a decrease in BOR because the total operating time of the ship does not change.Thus, there is an even distribution of jetty activity levels in the jetty supply.• Charter fees decrease in: (i) supply (jetties 1 and 2) by 71.07%and 98.69% for cases 1 and 2, respectively; (ii) consignment (jetty 3) by 68.81% and 69.42% for cases 1 and 2, respectively.However, for (ii) and case 2 it takes effort to avoid tidal conditions, e.g., with a river dredging project.
Other interesting topics are (i) to develop a multi-variable decision mathematical model by considering changes in jetty conditions, (ii) to model with a linear programming approach, and (iii) to carry out a dynamic berth allocation problem by adding dynamic aspects of the berth starting time as another solution in berth scheduling.The research of these topics is on the way.

Figure 1 .
Figure 1.A conceptual model using a Petri net explains the relationship between state variables and ship's berthing process at the jetty

STEP 1 .STEP 2 .
For a new event time k value, update the current state variable value.Solve the following optimization problem

Table 1 .
Characteristics of jetties