## 2 Simulation Based Resource Optimization
### Identifying an Optimal Number of Resources  
We will use the simulation templates to seek the number of resources that ensure a certain level of service with minimal cost. As there are an infinite number of resource levels that will satisfy the service requirement, the search space which is the combination of the number of MH and the number of berth is large. However, we can substantially reduce the search space if the performance criterion improves as the number of resources increases. For example, a port that possesses three mobile harbors and two berths provides better service than a port with two mobile harbors and one berth. We will consider performance criteria for which improvement means a decrease in value, e.g., waiting time. For the Port of Surabaya system, we will focus on the ratio of waiting time to service time (W/S ratio). We change the combination of the number of MH and the number of berth and iteratively execute model to find the optimum number of resources. Three properties are identified and seven steps to iteratively execute model are developed to find optimal harbor design.  
Let n = (n\({}_{\text{MH}}\), n\({}_{\text{berth}}\)) denote the number of units of resource present in each of the subsystem mobile harbors and land berth; n\({}_{\text{MH}}\) and n\({}_{\text{berth}}\) are the number of units of mobile harbors and berths, respectively. Let P(n) denote the performance of the system with a number of resources n. We will rely on the following assumption: For any binary vector b \(\in\) {0,1}\({}^{2}\), P(n) \(\geq\) P(n + b). Here, we consider that if no resource is required for a particular subsystem, then adding such a resource will only increase cost and not change the performance. When seeking to obtain a minimal cost solution that satisfies a target performance level P\({}_{\text{tgt}}\), this property can be exploited as follows:  
* Property 1: If P(n) \(\leq\) P\({}_{\text{tgt}}\), there is no need to evaluate P(n + b), for any b \(\in\) {0,1}\({}^{2}\), as it will cost more and also satisfy the performance constraint.
* b), for any b \(\in\) {0,1}\({}^{2}\), with n\({}_{\text{k}}\) + b\({}_{\text{k}}\)\(\geq\) 0, for all k = 1,..., K, as it will also not meet our service level requirement that is W/S ratio is less than 0.1.
* Property 3: n\({}_{\text{berth}}\) should be less than n\({}_{\text{MH}}\). Berths need not be used if there are enough to provide uninterrupted service to all land-sea interface berth locations.  
We will use these features to speed up the optimization process. We seek a resource level that achieves minimal cost while guaranteeing a desired level of service as follows.  
* Step 1: Initialize n with an arbitrary value. Set S' to the empty set; it will contain resource level vectors that we have already considered.
* Step 2: Conduct numerous replications of the simulation to approximate P(n).
* Step 3: If P(n) \(\leq\) P\({}_{\text{tgt}}\), go to step 4; else, go to step 5.
* Step 4: Calculate the resource cost with n resources and if it has the least cost so far, set that value as our current minimal cost. Include all resource vectors with greater resource cost according to Property 1 above in the set S'. Go to step 6.
* Step 5: Include all resource vectors with performance dominated by n according to Property 2 in the set S'. Go to step 6.
* Step 6: Employ Property 3 to add resource vectors to the set S'. Go to step 7.
* Step 7: If there is no resource vector remaining that is not included in S', terminate the search. The resource vector with minimal cost that is not in S' is optimal (or there is no solution if all are in S'). If the previous statements in Step 7 do not apply, select a new resource vector not in S' by randomly increasing or decreasing the resource levels by one for one of the resources; Call the new resource levels \(\mathbf{n}^{\alpha}\). Go to Step 2.  
This procedure is used to obtain a cost optimal resource vector for the architecture so that its estimated performance satisfies the performance criteria.