Stochastic scheduling of autonomous mobile robots at hospitals

This paper studies the scheduling of autonomous mobile robots (AMRs) at hospitals where the stochastic travel times and service times of AMRs are affected by the surrounding environment. The routes of AMRs are planned to minimize the daily cost of the hospital (including the AMR fixed cost, penalty cost of violating the time window, and transportation cost). To efficiently generate high-quality solutions, some properties are identified and incorporated into an improved tabu search (I-TS) algorithm for problem-solving. Experimental evaluations demonstrate that the I-TS algorithm outperforms existing methods by producing high-quality solutions. Based on the characteristics of healthcare requests and the AMR working environment, scheduling AMRs reasonably can effectively provide medical services, improve the utilization of medical resources, and reduce hospital costs.


Introduction
In recent years, the aging population has become a prominent trend, which has subsequently increased the workload and pressure on medical staff.Autonomous mobile robots (AMRs) can alleviate the workload of medical staff, reduce their potential infection risks, and improve work efficiency by assisting in completing delivery tasks such as delivering medicines, meals, and documents [1].Scheduling plays a crucial role in rational and effective planning, as it is regarded as an effective tool for achieving high utilization of resources [2].Therefore, reasonable and effective planning of AMR service routes is necessary to ensure high-quality service.
The deterministic scheduling problem of mobile robots has garnered considerable attention in the literature.However, in practical scenarios, the travel speed of robots is subject to variations caused by road conditions, and the service time of each robot is uncertain due to diverse demands.This paper aims to investigate the scheduling problem of mobile robots operating in hospitals, where both travel and service times are subject to stochastic variations.Specifically, AMRs are employed for medicine delivery services, transporting medications from the warehouse (pharmacy) to designated points within the hospital (wards).Each delivery request must be completed within a specified time window.
This paper focuses on efficiently scheduling multiple AMRs in a stochastic environment.The primary objective is to minimize the hospital's daily cost, which includes AMR fixed costs, penalties for late arrivals, and transportation expenses.To solve this problem, various properties are identified and incorporated into an improved Tabu Search (I-TS) algorithm, which serves as a solution approach.
The aim of this research is to provide insights and practical strategies for optimizing the scheduling of AMRs in hospitals, taking into account the inherent uncertainties of travel and service times in a stochastic environment.
The organization of this paper is as follows.Section 2 is the literature review.A detailed description of the AMR scheduling problem is presented in Section 3. Section 4 presents the stochastic programming mathematical model.An improved tabu search (I-TS) algorithm is proposed in Section 5. Section 6 verifies the effectiveness of the algorithm with improved Solomon instances.The paper is concluded in Section 7.

Literature review
The scheduling problem of mobile robots has garnered significant attention in the literature.Most existing studies primarily focus on deterministic environments.Liu et al. [3] studied the vehicle routing problem with time windows and fixed running speed, where a robot may run multiple trips.They proposed an innovative two-index mixed integer programming model and obtained optimal solutions.Alitappeh and Jeddisaravi [4] studied multi-robot task allocation in deterministic environments to minimize the total system cost.The problem was partitioned into regions and routing sub-problems, which were solved by a multi-objective genetic algorithm and reinforcement learning approach.Jun et al. [5] also studied the AMR scheduling problem in the deterministic environment and introduced an innovative local search algorithm to solve it.
However, in practical scenarios, robots predominantly operate in stochastic environments.The scheduling problem of AMRs in a stochastic environment is a variant of the classic vehicle routing problem due to their service characteristics.The vehicle routing problem (VRP) typically involves three stochastic factors: (1) uncertainty in requests, including uncertain demands and random requests [6,7,8]; (2) uncertainty in service time [9][10][11]; and (3) uncertainty in travel time [12,13].Some researchers have studied different variants of VRP.For instance, Taş et al. [10] investigated the VRP with a soft time window and stochastic travel times, considering both cases with and without service times in the model.Pan et al. [14] focused on a multi-trip VRP with known service times, hard time windows, and variable running speeds.Similarly, Jie et al. [15] considered a time-dependent VRP that is affected by the traffic environment, while Da ´vila et al. [16] studied the VRP with hard time windows and stochastic service time.
In a stochastic environment, the VRP is typically modeled as a multi-stage stochastic programming model to minimize the expected total cost.There are two main types of stochastic programming models: chance-constrained programming (CCP) models and stochastic programming with recourse models [17].The CCP model, proposed by Charnes and Cooper [18], is a powerful tool for modeling stochastic decision systems.It requires that the probability of the constraint condition is no less than a certain confidence level [17].Zhang et al. [19] studied VRP with time windows and stochastic travel and service times.A stochastic programming model is established to ensure customer service levels.Ehmke et al. [20] analyzed the distribution of customers' start service time and arrival time with stochastic travel time, limiting the probability of violating the time window constraint by a chance constraint method.Li et al. [17] studied a stochastic VRP by formulating both chance-constrained programming and stochastic programming models with recourse.Shi et al. [21] solved the healthcare routing problem with stochastic travel and service times using a stochastic programming model with recourse.
The VRP is a well-known NP-hard problem.An exact algorithm cannot find the optimal solution within an acceptable time as the number of requests increases.Thus, heuristic algorithms are typically employed to obtain satisfactory solutions.The common heuristics algorithms include the genetic algorithm [22,23], variable neighborhood search algorithm [24,25], grey wolf optimizer [26], ant colony algorithm [27], gravitational search algorithm [28], and tabu search algorithm (TS) [29,30].The TS algorithm is an effective method for solving VRPs in stochastic environments.It can generate a solution close to the optimal one, but the running time is long [31].Therefore, many scholars have proposed improvements on the TS algorithm.For instance, Taş et al. [10] combined the TS algorithm with an adaptive large neighborhood search algorithm to solve VRP with random travel times.Ge et al. [32] solved electric VRPs with stochastic demands by combining Clarke and Wright's saving method [33] with the TS algorithm.Li and Li [34] proposed an improved TS algorithm based on a greedy insertion algorithm to solve VRPs with stochastic travel and service times.Pan et al. [35] and Taş et al. [10] combined the adaptive large neighborhood search algorithm and TS algorithm to solve time-dependent VRPs with time windows.
This paper is devoted to studying an AMR scheduling problem in a stochastic environment at hospitals.The following constrains are considered.(1) The medical requests need to be served within a specified time window; (2) The AMR has a limited load capacity; (3) Each AMR may run multiple trips per day; (4) The AMR's travel time and the elevator running time are affected by the environment; (5) The service time of the medical request is stochastic.Note that the previous study on routing problems didn't comprehensively consider the above five factors.The above practical features cause the analysis of the AMR scheduling problem to be challenging.The classical VRP model isn't applicable for this problem.It is necessary to develop a suitable model and design a tailored algorithm to solve this problem.

Problem description
In this paper, the AMR scheduling problem in a stochastic environment is studied.The hospital needs to plan the number of AMRs involved in the daily service and the routes from the depot (pharmacy) to each request point.Since AMRs continuously work for 10 hours after being fully recharged [1], the AMR does not need to recharge during the one-day service.
Determining the optimal numbers of vehicles is the fundamental problem in the management of an AMR system [36].Let m be the total number of AMRs participating in the service, and it is the decision variable.Each AMR has an identical capacity Q and fixed cost ξ 1 ($).Assume that D is the depot set, D = D 1 [ D 2 , D 1 is the set of starting depots, and D 2 is the set of ending depots.The set D 2 is a dummy copy of the set D 1 with the same depot.
Assume that the AMRs can take elevators.Because AMRs need to avoid obstacles such as pedestrians, the AMR travel time per unit distance V r (s/m) and the elevator running time per unit floor V f (s/level) are random variables.Let V r (s/m).follow a normal distribution with mean μ (V r ) and variance σ 2 (V r ), and V f (s/level) follow a normal distribution with mean μ (V f ) and variance σ 2 (V f ).For the pedestrian flow at hospitals, we follow the approach proposed by Ichoua et al. [37] and divide the 24 hours a day into multiple non-overlapping time zones, which are 6:00-8:00, 8:00-12:00, 12:00-14:00, 14:00-16:00 and 16:00-24:00, where 8:00-12:00 is the morning peak, 14:00-16:00 is the afternoon peak, and the other time zones are the nonpeak.μ (V r ) and μ (V f ) vary with the environment, as shown in Fig 1.
Let R = {1,2, � � �} denote the set of medical requests.For request i (i 2 R), the demand is q i (q i � Q), the service time is S i and the time window is [e i ,h i ], where the lower bound e i is hard (that is, the earliest service start time is e i ) and the upper bound h i is soft.If an AMR arrives later than h i , the penalty cost for violating the time window is ξ 2 .Let service time follow a normal distribution, i.e., S i * N (μ (S i ), σ 2 (S i )).The distance between medical requests i and j is d ij , and their floor difference is , where d i,ele is the distance from request i to the elevator, and d ele,j is the distance from the elevator to request j.
To improve the utilization of AMRs, each AMR can travel multiple trips.Let the route set traveled by the kth AMR be L k = {1,2, . ..}, and the unit travel cost be ξ 3 ($/s).The travel time spent by the kth AMR on the route p 2 L k from request i to request j is , where x k pij is a 0-1 variable and 1; the kth AMR serves requests i and j consecutively on its pth route; 0; others: , where The kth AMR's remaining loading capacity is denoted by u k pi when it arrives at request i on its pth path.And u k pi decreases q i after it completes the service of request i.The moment that it starts to serve request i is denoted by , where A k pi is the time that the kth AMR arrives at request i.If x k pij = 1, we have Fig 2 illustrates a simple example.It involves three AMRs, ten medical requests, and a depot (pharmacy).All AMRs depart from the depot and eventually return to the depot.The three elements in vector (l i level, q i kg, [e i ,h i ]) represent the floor, the demand, and the time window of the request point i, respectively.Some notations for the AMR scheduling problem are defined in Table 1.

Model formulation
Since the travel time of AMRs between any two requests is affected by environmental factors such as traffic, congestion, and elevator availability, the AMR arrival time to a request is random.Under the condition that the travel time of the AMR, elevator waiting times, and service time of AMRs are stochastic, the AMRs are scheduled to minimize the daily cost of the hospital (including the AMR fixed cost, penalty cost of violating the time window and transportation Objective function: s.t. The objective function ( 1) is to minimize the total cost which is formed by three parts: the AMR fixed cost, the penalty cost of violating the time window, and transportation cost.The cost of one AMR is usually higher than the penalty cost of violating the time window.Without losing generality, let ξ 1 > ξ 2 > ξ 3 .Constraint (2) ensures that each request is served in one and only one route.Constraint (3) indicates that the number of input arcs at each point is equal to the number of output arcs.The constraints (4)-( 5) represent the remaining loading capacity constraints of the AMR on any route.The constraints ( 6)-( 8) represent the time window constraints of the AMR arriving at every request on route p.The Eq (9) denotes a binary decision variable x k pij .To more precisely represent the objective function (1), we take the approach of Ehmke et al. [20] to approximate the arrival time by a normal distribution, i.e., . From Nadarajah and Kotz [38], we have where F (�) is the cumulative distribution function of the standard normal distribution and f (�) is the probability density function of the standard normal distribution.Since the travel time T k p;i;j and the service time S i are independent random variables, we have The probability of violating the time window P A k p;j > h j n o can be determined through

Improved tabu search algorithm
Due to computational complexity of the AMR scheduling problem, it is difficult to obtain an optimal solution within limited computation time.Hence, a heuristic algorithm is typically employed to find suboptimal solutions.Tabu Search (TS) algorithm is a heuristic algorithm based on neighborhood search proposed by Glover [39].It can solve a class of combinatorial optimization problems including variants of the VRP that involve stochastic factors.The TS algorithm starts from an initial feasible solution and prevents previously visited solutions from being accepted again by setting a tabu list and a tabu tenure during the iterative search.In this section, we propose an improved tabu search (I-TS) heuristic algorithm to improve the quality of the solution and the computation speed.The I-TS algorithm improves the standard TS algorithm by incorporating a greedy insertion algorithm, adopting an adaptive mechanism for selecting neighborhood operators, and setting more effective tabu tenure parameters.These enhance the performance and effectiveness of the algorithm in solving the scheduling problem at hand.The structure of Section 5 is outlined as follows: Section 5.1 covers the creation of an initial solution.In Section 5.2, we introduce three enhanced operators along with a repair operator.Section 5.3 delves into the tabu list and tabu tenure.Section 5.4 presents the aspiration criterion within the algorithm.Lastly, Section 5.5 introduces the termination condition for the I-TS algorithm.

Initial solutions
The I-TS algorithm performs an iterative search process to improve the solution by iteratively exploring the neighborhood of the current solution.The initial solution is crucial because it determines the starting point for the iterative search and affects the speed and quality of the algorithm's convergence to a good solution.To find a relative optimal solution more efficiently, the greedy insertion algorithm is adopted to generate a feasible initial solution.Algorithm 1 provides the pseudocode for the greedy insertion algorithm used to generate the initial solution for the I-TS algorithm.Requests are inserted sequentially into the current set of routes in ascending order by their time window, subject to capacity constraints, until all requests are processed.

Algorithm 1. Greedy Insertion Algorithm for a Feasible Solution
Step 1 Arrange the lower bound e i of the time window of all requests in ascending order to generate a sequence of service priorities for requests P = {p 1 ,p 2 ,. ..,p i ,. ..,p n }.Let i = 1 and the current route set is empty (R current = Φ).
Step 2 Assign p 1 to a new AMR, and generate sub-route Step 3 If i � n then repeat Step 4 Else then go to Step 5.
Step 4 If there exists a sub-route r j 2 R current , j = 1,2,. . .such that the request p i can be served at the end of r j , and the constraints of the time window and capacity are satisfied..
Else then assign p i to a new AMR and generate a new sub-route

End
Step 5 Let R current be the initial feasible solution x 0 , and output the corresponding objective function F (x 0 ).

Neighborhood structure
This study uses three operators to generate neighborhood solutions.It is worth noting that in the process of using operators to generate neighborhood solutions, the elements used for transformation are usually randomly selected.
Proof.Because request i 2 is served before i 1 by the kth AMR on its pth route, we have Remark: From Proposition 1, we find that if the time windows satisfy e i Proof.The probability that request i 1 breaks its time window is The probability that request i 2 breaks its time window is Note that A k p;i 1 and A k p;i 2 follow the same distribution.Let the density of A k p;i 1 and A k p;i 2 be p (x), then Remark: From Proposition 2 we find that if the time windows e i 1 ; h i 1 h i and e i 2 ; h i 2 h i satisfy 4. repair operator: In the metaheuristic algorithm, the search space may include infeasible solutions or tend towards suboptimal outcomes due to constraint violations [40].Therefore, the solutions generated by the neighborhood operators previously mentioned (swap*, 2-opt*, and relocation*) might be infeasible because they do not take into account load constraints.We introduce a repair operator, namely depot insertion.If a service route is not feasible due to overloading, a depot is inserted before the point where the remaining load does not meet the downward load demands, as shown in Fig 6 .By implementing this repair mechanism, the infeasible solutions caused by constraint violations can be effectively repaired.
To find a high-quality feasible solution that satisfies all problem constraints as quickly as possible, the selection of the operators follows a roulette wheel procedure, where the probability P i ¼ r i X 3 j¼1 r j of selecting operator i depends on its weight ρ i , i = 1,2,3.The greater the weight of operator i, the greater the probability of operator i being selected.The weights ρ i are dynamic updated according to a reward scheme.If the neighborhood solution generated by operator i is better than the current optimal solution, then ρ i = ρ i + δ 1 ; if the neighborhood solution generated by operator i is not tabu but produces a solution worse than the current optimal solution, then ρ i = ρ i + δ 2 , δ 1 > δ 2 � 0. The three operators in the initial state have equal weights and let ρ i = 1, i.e., the probability of operator i being selected is P i ¼ 1 3 .To find high-quality solutions more efficiently, the algorithm updates the weights ρ i of the operators after every ten iterations.

Tabu list and tabu tenure
The tabu mechanism in the I-TS algorithm can explore a wide range of solutions and avoid getting stuck in local optima in the search process.Here we use three tabu lists B i , 8i = 1,2,3 to store the solutions produced by applying each of the three neighborhood operators (swap*, 2-opt*, and relocation*) to each pair of requests, where the tabu list B i is a n × n symmetric matrix, and n is the total number of requests.For the operator i, the element B i (j 1 , j 2 ) in the tabu list B i represents the tabu state of the neighborhood action b i (j 1 , j 2 ), where j 1 , j 2 2 R are the two requests for swap, inversion or relocation.
For the tabu tenure in the I-TS algorithm, a long tabu tenure may cause the algorithm to overlook better solutions, while a short tabu tenure may lead to premature convergence to suboptimal solutions.Therefore, we consider choosing an appropriate tabu tenure value t that balances exploration and exploitation (See Section 6.2 for details).

Aspiration criterion
To prevent the algorithm from prematurely terminating in a suboptimal solution, an aspiration criterion is adopted.For a neighborhood solution that is currently tabu but better than the current optimal solution, we revoke the tabu operation and take the solution as the current optimal solution.

Algorithm stop condition
The algorithm stops after a predetermined maximum number of iterations N and outputs the current optimal solution.
Algorithm 2 provides the pseudocode for the I-TS algorithm.
Step 2 Let x 0 (obtained from Algorithm 1) be the initial solution of the algorithm, i.e., x current = x 0 , F(x current ) = F (x 0 ).And the current best solution is x best = x 0 , F(x best ) = F (x 0 ).
Step 3 Based on the current solution x current , use the roulette wheel procedure for the three operators (swap*, 2-opt*, and relocation*) to select the operator i and generate the corresponding neighborhood N (x current ).The depot insertion operator is used to repair neighborhood solutions.Find the optimal objective value F(x c_best ) and the corresponding neighborhood action b i j * , where x c_best 2 N (x current ). Step , the weight ρ i of the selected operator i is updated to ρ i = ρ i + δ 1 through the reward scheme, and update the tabu list.Let then find the optimal solution x 0 c best generated by the neighborhood action b i j 0 the weight ρ i of the selected operator i is updated to ρ i = ρ i + δ 2 through the reward scheme, and update the tabu list.Let B i j 0 1 ; Step 5 Let ite = ite + 1.The probability of each operator P i ¼ is updated after every 10 iterations.Repeat Steps 3-4.
When ite = N, stop the algorithm and output the current optimal solution F (x best ) and the corresponding set of routes best .

Numerical experiments
This section verifies the performance of the proposed I-TS algorithm.Section 6.1 introduces the improved Solomon instances.The impact of different tabu tenure t and the number of algorithm iterations N on the objective value is analyzed in Section 6.2.In Section 6.3, we compare the results of I-TS and CPLEX in a deterministic environment.For the stochastic scheduling of AMRs, we compare I-TS with VNS, TS, and greedy insertion algorithms.An AMR routing planning example is presented in Section 6.4.Section 6.5 presents numerical examples that provide managerial insights into the participation of AMRs in medical services.

Improved Solomon instances
As there is no suitable benchmark set of problems available for the AMRs service, we generate new instances based on three instances in the Solomon benchmark (C, R, and RC).The C instance has a clustered distribution of geographical locations for the requests, while the R instance has a uniform distribution, and the RC instance is relatively semi-clustered.Each instance comprises two subsets: type-1 and type-2.The time window of type-1 instances (C1, R1, and RC1) is narrow, whereas that of type-2 instances (C2, R2, and RC2) is relatively wide.Note that μ (V r ) and μ (V f ) are dependent on the environment.We consider three distinct environments at hospitals: morning peak (P1), afternoon peak (P2), and off-peak (P3).For each environment, six instances (C108, C208, R101, R202, RC101, and RC202) are analyzed.Each instance comprises 20, 50, or 100 requests, where the first 20 and first 50 requests are selected from the total 100 requests.For example, P1-C108-100 indicates the instance C108 with 100 requests during the morning peak.In total, 54 instances are generated based on geographical location distribution, time windows, environments, and the number of requests.
The Solomon benchmark has been modified by making the following adjustments: (1) The earliest service time of the pharmacy is 7:30 AM (with an initial time of 0), and the latest service time is 7:30 AM in the following day.(2) Based on hospital traffic in one day, 8:00-12:00 and 14:00-16:00 are designated as the morning and afternoon peak periods, respectively, while the rest of the time is considered non-peak.(3) The AMR travel and elevator running speeds are assigned as follows: μ (V r ) = 1.4s/m and μ (V f ) = 3.2s/level during the morning peak period, μ (V r ) = 1.3s/m and μ (V f ) = 3.0s/level during the afternoon peak period, and μ (V r ) = 1.1s/m and μ (V f ) = 2.7s/level during non-peak period.σ 2 (V r ) and σ 2 (V f ) are the same among the three periods.(4) The medical requests are distributed across floors 1 -6, and the elevator is located at the center of each floor.In the Solomon instance, μ (S i ) represents the requested service time, and its variance is represented by σ 2 (S i ) = 15.
All of the following experiments were implemented in Matlab 2018b and were run on a microcomputer with a 3.60GHz CPU and 16GB of RAM.The environment used an Inter(R) Core(TM) i9-9900K CPU@3.60GHz,16.00GB and Windows 10 operating system.Table 2 shows the parameter settings in the experiments.

Parameter tuning
Parameter tuning is crucial to ensure effective performance of the I-TS algorithm.This subsection presents experiments on two key parameters, tabu tenure t and number of iterations N, using examples with 50 and 100 requests during non-peak periods (P3) in hospitals.Results are shown in Figs 7 and 8. Based on the experiments described above, let the tabu tenure t = 40 and the maximum number of iterations N = 500 in the following subsections to effectively solve the AMR scheduling problems.

Validity test of I-TS algorithm
This section evaluates the effectiveness of the proposed model and algorithm.Since the CPLEX optimizer is limited to small instances, our algorithm is first validated by solving 20-request instances in a deterministic setting using CPLEX in Section 6.3.1.In Section 6.3.2, the performance of the I-TS algorithm, greedy insertion algorithm, tabu search algorithm, and variable neighborhood search algorithm are compared by 50-request and 100-request instances.

Results on the 20-request instances.
This subsection validates the correctness of the I-TS algorithm by solving six 20-request instances in non-peak periods.Let σ 2 (V r ) = 0, σ 2 (V f ) = 0.The results of the I-TS algorithm and CPLEX optimizer are compared.The maximum computational time of CPLEX optimizer is 30 minutes.The I-TS algorithm performs ten independent runs for each instance and computes the average value and best value.Table 3 summarizes the experimental results, where F avg is the average cost by the I-TS algorithm; F bst is the best objective value; F CPLEX is the objective value found by the CPLEX optimizer; and Time Table 2. Parameter settings.

Parameters Value
The daily fixed cost of each AMR ξ 1 30$ The penalty cost of violating time windows ξ 2 0.1$ The unit travel cost of the AMR ξ 1 0.01$/s The variance of the AMR's traveling time σ 2 (V r ) 0.15(s 2 /m 2 ) The variance of elevator running time σ 2 (V f ) 0.5(s 2 /level 2 ) https://doi.org/10.1371/journal.pone.0292002.t002 is the average runtime.Let The results indicate that CPLEX gets the optimal solution for only four instances (P3-C108-20, P3-C208-20, P3-R101-20, and P3-RC201-20) within 30 minutes.The optimal solution of the P3-R202-20 and P3-RC101-20 instances can't be found within 1800 seconds by CPLEX.But I-TS algorithm can find better solutions within 10 seconds.Table 3 shows that, the average error value of |G 1 | is 1.76%, and the average error value of |G 2 | is 2.00%.The difference of the optimal objective value by I-TS algorithm and CPLEX is small.But the I-TS algorithm can obtain good solutions in a relatively short time, and it even outperforms CPLEX in R202 and RC101 instances.This indicates the effectiveness of the I-TS algorithm in finding near-optimal solutions.The I-TS algorithm achieved competitive performance compared to CPLEX in terms of optimizing the objective function.
6.3.2Results on the 50-request and 100-request instances.In this subsection, the effectiveness of the proposed I-TS algorithm is verified by the 50-request and 100-request instances in various environments.The performance of the I-TS algorithm, tabu search algorithm, greedy insertion algorithm, and variable neighborhood search (VNS) algorithm are compared.
The I-TS algorithm proposed in this paper is an enhancement of the greedy insertion algorithm and TS.In addition, the VNS algorithm is a widely used heuristic method for solving complex optimization problems, including combinatorial optimization problems such as the shortest circuit [41,42].We apply the greedy insertion algorithm, TS algorithm, and VNS algorithm to solve the AMR scheduling problem and compare the results with those obtained by the I-TS algorithm.For the TS algorithm and VNS algorithm, we randomly generate initial solutions.To ensure fairness, let the number of iterations (N = 500) be equal for each algorithm.The results are presented in Table 4, where F is the average cost found by the algorithm over ten runs, Time denotes the average runtime required for obtaining the solutions over ten runs, and G 0 represents the percentage difference between the objective value achieved by a specific algorithm and that of the I-TS algorithm.Note that G 0 > 0 implies that the I-TS algorithm performs better.
The experimental results in Table 4 demonstrate that the I-TS algorithm significantly enhances the solution quality compared with the TS algorithm (G 0 = 5.3044%).A higher-quality solution is generated by the I-TS algorithm in comparison to the TS algorithm, as it incorporates the greedy insertion algorithm for generating an initial solution.Furthermore, G 0 = 0% for the greedy insertion algorithm indicates that the initial solution generated by the greedy insertion algorithm is of high quality and can greatly aid in finding better solutions.Similarly, the optimal solution obtained by the classical VNS algorithm using the same number of iterations is inferior to that achieved by the I-TS algorithm (by 11.38%).Although the I-TS algorithm takes longer to obtain the optimal solution, its computational time is acceptable considering the quality of the generated solution.When strict computation time requirements exist, the greedy insertion algorithm and VNS approach can be used to solve the problem, since their computational time is shorter than that of the I-TS algorithm.To further illustrate the performance of the I-TS algorithm, the fitness curves for the three algorithms (I-TS, TS, and VNS) in non-peak cases are depicted in Fig 9 .It shows that the I-TS algorithm achieves less objective value compared to the other algorithms while the number of iterations is large enough (bigger than 100).

AMR routing planning
In this section, we take an example to analyze the specific service routes of AMRs.Consider the RC101-20 instance in three periods (morning peak, afternoon peak, and non-peak).The AMR route planning of instance RC101-20 is shown in Table 5, where No. is the AMR sequence number, and Route is the running route of the AMR (0 represents the depot, 1-20 represents the medical request of instance P1-RC101-20, 21-40 represents the medical request of P2-RC101-20 instance, and 41-60 represents the medical request of P3-RC101-20 instance).AT is the time when the AMR arrives at the request, and r is the service probability of the route.
The results presented in Table 5 reveal the following findings: (1) In order to effectively handle the tasks, a minimum of 16 AMRs is required, with each AMR making at least two trips.(2) Half of the AMRs achieve a service probability of 1 on their planned routes.(3) As the number of requests on the route increases, the service probability tends to decrease.The minimum service probability can reach 0.97.These outcomes underscore the effectiveness of the proposed stochastic programming model in planning the number of AMRs and service routes across diverse environments.

Management insight
In order to demonstrate the service quality of AMRs and validate the stochastic programming model, we introduce the concept of the service probability (r), which represents the probability of medical requests being serviced within a specified time window.We compare the r values of 50-request and 100-request instances in different environments.Eq (12) defines the service probability r.

r ¼ min
Each instance is run ten times, and the average service probability r avg is given in Table 6.
According to Table 6, the service probability during the morning peak (represented by the red column) is less than or equal to that in the afternoon peak (represented by the green column) and non-peak hours (represented by the blue column).The average service probability is over 90% in all environments except for C208-100 in the morning peak.Even during the afternoon peak, the probability of medical requests receiving services within a specified time window can reach 0.99.These results are relatively satisfactory for route planning problems of AMRs with high randomness.
Fig 10 compares of the number of AMRs participating in service for different instances.It shows that in the same environment, the C1, R1, and RC1 datasets with narrower time windows require a greater number of AMRs than the C2, R2, and RC2 datasets with wider time windows.This difference arises because wider time windows have a lower likelihood of time window violations, leading to decreased penalty costs.During the morning peak period, the environment is more intricate, leading to heightened obstacles and extended travel durations for the AMRs.Consequently, to ensure the timely fulfillment of medical requests within their respective time windows, an increased number of AMRs becomes imperative.
The proposed stochastic programming model is feasible for the stochastic scheduling of AMRs in different environments at hospitals.Based on the environment of medical requests, we can allocate the appropriate number of AMRs to complete the service, thereby minimizing the hospital's daily cost and maximizing the AMR utilization rate.

Conclusion
This paper investigates the scheduling problem of AMRs at hospitals, where service time and AMR travel time are random.We establish a stochastic programming model for the AMR scheduling problem, which minimizes the sum of fixed cost, AMR operation cost, and delayed service cost.To solve the problem, we propose a heuristic algorithm that combines the greedy insertion algorithm and tabu search algorithm.A repair operator is introduced to transform infeasible solutions into feasible ones.The experimental results demonstrate that the I-TS algorithm can generate reliable service routes for AMRs in stochastic environments.Moreover, by allowing each AMR to handle multiple trips, the hospital's overall expenses can be minimized and the AMRs' efficiency can be increased.
In this study, we assume that both the AMR's running time and service time follow normal distributions, and all requests are known before planning the route.In the future, we can

Fig 2 .
Fig 2.An illustrated example.https://doi.org/10.1371/journal.pone.0292002.g002 prioritizing the service of request i 1 leads to a smaller probability of time window violation.To obtain improved solutions within a limited time, we enhance three operators, namely swap*, 2-opt*, and relocation*, based on Proposition 1 and Proposition 2.1.swap* operator: Fig3(A) illustrates a scenario where request 5 violates its time window constraints at its current position, while the upper limit of request 2's time window is more relaxed.Consequently, requests 2 and 5 are chosen for swapping.On the other hand, if all requests on the current route satisfy their time window constraints, to avoid getting stuck in local optima, two requests from the current solution are randomly selected for position swapping, while the remaining requests remained unchanged.Fig 3(B) displays an example where requests 3 and 6 are selected, resulting in a new solution generated through the swap operation.2. 2-opt* operator: As shown in Fig 4(A), a declining trend is observed in the lower bound of time windows for the sub-route between request 2 and request 5 in the existing route.Therefore, we reverse the order of this sub-route between requests 2 and 5 to improve the solution.For cases where there is no sub-route with decreasing time window lower bounds in the current solution, we randomly select two requests from the incumbent solution and reverse the order of points between them before inserting them back into the service route.As shown in Fig 4(B), requests 3 and 6 are randomly selected, and their routes are reversed to create a new feasible solution.3. relocation* operator: By examining the time windows of requests on the current route, as shown in Fig 5(A), we notice that request 5 violates its time window constraints.Therefore, we select request 5 and remove it from its current position, then insert it before request 3 which has a later time window.If none of the above conditions apply to the current route, we randomly select a request, remove it from its current position, and insert it at a random position.As shown in Fig 5(B), request 6 is randomly selected and placed after request 2 in the new solution.

Fig 7 .
depicts the algorithm's search for optimal solutions with tabu tenures of t = 20, 30, 40, 50.As in Fig 7, the algorithm converges faster and achieves relatively optimal objective values when the tabu tenure is t = 40.Fig 8 presents the fitness curve of total hospital cost generated by the I-TS algorithm for non-peak cases.As shown in Fig 8, the objective value gradually approaches the optimal value as the number of iterations increases and the objective value converges after around 400 iterations.To balance algorithm effectiveness and runtime, let the iteration number N equal to 500 for the I-TS algorithm.

Table 1 . Notation for the AMR scheduling problem.
ij Distance from request i to request j |f ij | Floor difference between requests i and j V r AMR travel time per unit distance V f Elevator running time per unit floor T k pij The travel time spent by the kth AMR on the route p 2 L k from request i to request j h 0 Any infinite large number Decision variables m Total number of AMRs x k pij 1 if the kth AMR travels arc (i,j) on its pth route; 0 otherwise https://doi.org/10.1371/journal.pone.0292002.t001 1 < h i 1 < e i 2 < h i 2 ,serving request i 1 first is preferred, otherwise the time window of request i 1 is broken definitely.Let the time windows of two requests i 1 and i 2 be e i 1 ; h i 1