A Novel Scheduling Algorithm for Common Rail Dual Automatic Guided Vehicles Particle Filtering Algorithm for Industrial Process Control

This paper explores deep into the collaborative scheduling of common rail dual automatic guided vehicles (AGVs). Firstly, a dual AGV scheduling model was constructed to minimize the overall time of material distribution. Then, a novel scheduling algorithm was developed to dynamically plan the orders based on time windows. To eﬀectively minimize the distribution time, heuristic algorithms were adopted to initialize the distribution order of materials. On this basis, the collaboration between the two AGVs was innovatively designed based on dynamic planning and time windows, making up for the defects of traditional methods in AGV cooperation. This greatly shortens the running time of the entire system in material distribution. The computing results fully demonstrate the eﬃciency and rationality of our algorithm. Finally, our algorithm was proved to be superior to the benchmark method through experiments on actual industrial instances.


Introduction
With economic growth and industrial development, there is a rising demand for automation and intelligent transport. is gives birth to a series of automated logistics equipment, such as automatic identification system, automatic guided vehicle (AGV) system, and cargo tracking system. e AGV system boasts greater application potential than the other systems, owing to its advantages in automation and efficiency. e operations in many factories are faced with a nondeterministic polynomial-time (NP) hard problem: two AGVs at the opposite ends of a rail need to deliver materials to tanks along the rail, and the material distribution should be planned reasonably to minimize the distribution time.
is problem was defined by Erdogan in 2013 as the twin robots scheduling problem (TRSP) [1].
e TRSP applies widely in the robotic industry, where gantry robots are employed by job-shops for packaging, assembly, palletizing, and depalletizing [2]. Similar scheduling problems have arisen in the context of automated parking garages [3] and automated libraries [4]. In addition, the TRSP can be extended to multidimensional problems, namely, robots working on shelves, and multirobot problems like multirobot cooperation system [5,6]. e dispatching of common rail dual AGVs is a typical TRSP in factories to quickly dispatch materials between tanks or automatically schedule express delivery in warehouses. Traditionally, this novel and specific problem is solved by simple heuristic algorithms, such as genetic algorithms (GA) and [7][8][9][10] particle swarm optimization (PSO) [11][12][13]. Due to the sheer scale of the problem, it is difficult for these algorithms to converge to the global optimal solution. us, it is urgent an efficient and feasible scheduling algorithm for common rail dual AGVs.
is paper establishes a model of the common rail dual AGVs and presents an efficient solution to the model. e remainder of this paper is organized as follows: Section 2 sets up a dual AGV scheduling model to minimize the running time of the AGV system; Section 3 presents a novel heuristic scheduling algorithm that dynamically plans material distribution tasks based on time windows; Section 4 compares our method with the benchmark method through experiments on a set of benchmark instances; Section 5 wraps up this work.

Model Construction
To model the common rail dual AGV system, the actual factory scheduling problem was abstracted and redefined as follows (Table 1). e common rail dual AGV system has two AGVs, one rail, and two independent hangars. During the operation, the two AGVs automatically drive in opposite directions along the same rail. Each end of the rail leads to a hangar. e tanks are evenly arranged along one or both sides of the rail for material stacking. Multiple materials can be stacked in the same tank but can only be picked up from top to bottom.
Each AGV is preallocated by the system. e operation of each AGV includes three steps: picking, transporting, and placing along the rail. e AGV can only handle one material at a time. After completing all tasks, the AGV must return to its hangar to be reset for the next operation.
To avoid collisions, a safe distance must be maintained between the two AGVs. Suppose that the two AGVs operate at the same speed on the rail, which can be calculated at time t when passing by a tank. en, the two AGVs take the same amount of time (on average), T, to pick up and put down the material ( Figure 1).
After abstracting the actual problem, the objective is to design a dual AGV scheduling strategy that minimizes the times for the two AGVs to complete the assigned material tasks and return to their respective hangars.

Motion States and Directions of AGVs.
To clearly illustrate the coordinate change of AGVs, the rail was abstracted into a numerical axis with the leftmost end as the origin. It is assumed that the tanks are arranged at equal intervals. e length of each interval and the length of each tank are denoted as l1 and l2, respectively. en, the total length of each slot, that is, each tank and its left interval, can be calculated by (1) e current loading states of the two AGVs can be described by the state variable z Ai (i � 1, 2): Taking the picking and placing processes as static state (through which the two AGVs avoid collision), the current motion states of the two AGVs can be illustrated by another 0-1 decision variable m Ai (i � 1, 2):

Tank
Constraints. e materials are handled by the lastin, first-out principle. at is, each material is transported to the current tank to the target tank CT F k , where k is the serial number of the target tank. e destination slot must be empty or only compatible before the material is placed: If CT F k � 1, there are incompatible materials. e number of noncompatible materials is denoted as j. en, it is necessary to judge the direction O Ai of the AGV. If O Ai � 0, the

Mathematical Problems in Engineering
AGV temporarily places the target material W inow in the right neighbor of the target tank CT F k+1 . If O Ai � 1, the material W inow is temporarily stored in the left neighbor of the target tank CT F k−1 , which can be recorded as T temp � T. Next, the AGV drives to CT F k and transports j incompatible materials to the left neighbor CT F k−1 or the right neighbor CT F k+1 without temporary storage of W inow until CT F k � 0 or − 1. e time it takes to empty the target tank is denoted as T clr � (2T + 2t)j. Figure 2 illustrates the rules for material delivery.

Distribution Constraint.
When being delivered to its destination tank, each material must be distributed by the specified AGV. Hence, an index φ(A i ) was introduced to judge whether AGV A i carries materials that are compatible with the target tank: and, then, at any moment, make both φ(A i ) values of the two AGVs zero: and this constraint ensures that each AGV is delivering the materials allocated to it at any time.

Safe Distance Constraint.
e positions of AGV1 and AGV2 on the rail, denoted as X A1 k1 and X A2 k2 , can be, respectively, derived as where k1 and k2 are tank numbers of AGV1 and AGV2, respectively. en, the distance between A 1 and A 2 can be represented by d k1k2 . ere is a phased conflict between the schedules of the two AGVs. To avoid directional conflict between A 1 and A 2 , at least one slot length L must be maintained between them as the safe distance [14]: us, the relationship between the locations of the two AGVs can be described as

Dual AGV Scheduling Model with Minimal Time.
Under the above constraints, a dual AGV scheduling model can be established to minimize the time of material distribution. e paths of the AGVs can be described by an undirected graph G � (CT, E), where CT � CT1, CT2, { . . . , CTm} is the set of tanks, and E � E1, E2, . . . , Ei { } is the set of intervals between tanks CT i and CT j . en, the length of the journey of each AGV can be described as an integer multiple of slot length L: Suppose that an AGV changes direction for b times on the way to deliver materials. Let CTi and CTj be the start and end points of the AGV at the second change of direction B (0 ≤ BB ≤ bb), respectively. en, the route of the AGV is denoted as E B ij . e travel length of the AGV can be expressed as Obviously, each AGV picks up the same amount of materials as those it delivers. Let n be the times of pick-ups (and also the times of placements) of the AGV, let t be the time to pass through a tank, and let T be the time of picking up and putting down materials. en, the time for each AGV to complete its tasks and return to its hangar can be determined. e total time for AGV1 to complete its tasks and return to its hangar can be calculated by where D 1 is the length of the journey of AGV1 and n 1 is the number of pick-ups or placements of AGV1. e total time for AGV2 to complete its tasks and return to its hangar can be calculated by where D 2 is the length of the journey of AGV2 and n 2 is the number of pick-ups or placements of AGV2. en, the total running time of the entire AGV system equals the longer running time between the two AGVs: In this way, a dual AGV scheduling model can be established aiming to let the two AGVs complete their tasks and return to their respective hangar as early as possible, that is, to minimize the running time of the entire AGV system: Mathematical Problems in Engineering 3 to move from the current tank k0 of the material to the target tank kF can be calculated by

Scheduling Algorithm
where L(f p k0 ) is the time to reach the starting tank K0 in a free time; t k0kF is the time to move from the starting tank K0 to the end tank KF without considering safe distance; t Δ is the additional time to move from K0 to KF incurred by the location and motion states of the other AGV [15].

Adding Safe Distance.
Under the safe distance, the tank r j i where AGV is located and its left neighbor r j i−1 and right neighbor r j i+1 are occupied simultaneously; moreover, the other AGV cannot appear in this section with this AGV at the same time. en, the current state v i of the current slot can be depicted as [16] v i � 0, the tank is occupied and the AGV is in the i th or i ± 1 th tank, 1, the tank is free and the AGV is not in the i th or i ± 1 th tank.
For every time t, the state of each slot needs to be changed with the location of the AGV. Figure 3 explains the occupation state of the time window.

Workflow
Step 1. Find the shortest time delivery sequence for the independent delivery state of each AGV by the genetic algorithm (GA) (1) Parameter initialization Initialize the selection, crossover, and mutation probabilities according to the performance of the AGVs. (2) Encoding Set up a coding string of the length n Ai and values between 1 and n Ai , where n Ai is the total number of materials assigned to A i .
(3) Generating the initial solution Randomly generate a coded string of length n Ai ; that is, randomly arrange the order of material delivery, as the initial solution. Use the Tournament Selection Method (TSM) [17,18] to remove some individuals from the population, and select one of the best fit individuals to enter the next population. Repeat this process until the new population equals the original population in size. (6) Crossover and mutation Implement the reverse mutation operator [19] and exchange the order of material distribution.   Obtain the new population and repeat Step (4) until the 10,000-th iteration to get the best fit individuals.

(8) Decoding
Decode the genetic sequence of the order of local material distribution for each AGV. Store the results of AGV1 and AGV2 in one-dimensional (1D) arrays p 1 0 and p 2 0 , respectively, which reflect the minimum running time in the case of independent interaction.
Step 2. Order distribution based on the initial minimum running time As shown in Figure 4, distribute the first task to AGV1 and AGV2 according to the initial scheduling plan p 1 0 , obtain the time window of the first task of each AGV, and judge whether there is an overlapping section RP(S) between the routes of the two AGVs. If yes, let the AGV closer to the destination tank continue with its delivery, and halt the other AGV until the overlapping section is cleared. If not, repeat Step 2 after the delivery to assign the second task as per the initial plan until an overlapping section arises. Once an overlapping section occurs, go to Step 3 for dynamic planning of the next task.
Step 3. Dynamic planning of the next task based on time windows Assign the next task RW i+1 (K0, KF, t i+1 ) to an AGV after it has placed the current task material and entered the unloaded state z Ai � 0.
(1) Case 1: the two AGVs do not end the current task in a synchronized manner.
If A1 terminates the current task but A2 continues with the current task, dynamically plan the next task of A1 in combination with the time window of A2; conversely, dynamically plan the next task of A2 in combination with the time window of A1. Firstly, search for the nearest tanks on the left and right of the current slot of A1, and denote them as optional task points RW1 and RW2, following the greedy strategy. Take the number of the next materials in the original plan p 1 0 as alternative task point RW3. Next, obtain the time window of the alternative tank separately, and plan the route and time to reach the starting and target tanks. Finally, compare A2 with the time windows of the current target tank, measure the set of overlapping sections RP1(SS), RP2(SS), and RP3(SS), and take the RW corresponding to min{RP1(SS), RP 2(SS), RP3(SS)} as the next task.
(2) Case 2: the two AGVs end the current task in a synchronized manner.
If A1 and A2 terminate the current task at the same time and if the distribution of the next task to one of them affects that of the other, then A1 and A2 search for the nearest tanks on the left and right of their current slots and denote them as optional task points (RW A1 1 , RW A1 2 ) and (RW A2 1 , RW A2 2 ) following the greedy strategy and also take the number of the next materials in the original plan p 1 0 as alternative task points RW A1 3 and RW A2 3 . Next, obtain the time windows of the three alternative task points of A1 and A2, respectively, and plan the route and time for each AGV to reach the starting and target tanks. Finally, establish the set of overlapping sections, and take the least overlapping combinations as the next task of the two AGVs.
Step 4. Determine the motion state for the next task (1) Case 1: the two AGVs do not end the current task in a synchronized manner.
Let an AGV receive the next task as a collaborator, compare the time windows for transporting the current materials, and choose to stop or stay away for cooperation with the AGV still engaged in material delivery at the end of the overlapping section, according to its location k i and whether k i−2 /k i+2 is busy at the next moment:

Mathematical Problems in Engineering
(2) Case 2: the two AGVs end the current task in a synchronized manner.
Since there is an overlapping section between the two AGVs, choose the collaborator based on their distances from the starting tank to the target tank. Make the AGV farther away from its target tank as the collaborator, and choose to stop or stay away. e determination of the motion state for the next task is illustrated in Figure 5.
Step 5. Repeating Steps 3 and 4 until the end of material distribution Repeat Steps 3 and 4 until all material tasks are completed, return to the hangar, count the transport time of each task, and obtain the shortest time min T total .
(2) Running time optimization To minimize the overall time cost of placing the target materials, the two AGVs can cooperate with each other to empty their target tank under the following conditions.
One AGV can issue an emptying request to the other AGV if their distance d k1k2 satisfies Suppose that AGV1 is the one issuing the request. Let k 2 and k A2 be the current position and starting tank of AGV2, respectively; let k A1 be the target tank of AGV1 (k 2 < k A1 < k A2 ). If AGV2 is unloaded currently and moves in the same direction (right) as AGV1, then AGV2 will accept the request under the following conditions: Suppose that AGV2 is the one issuing the request. Let k 1 and k A1 be the current position and starting tank of AGV1, respectively; let k A2 be the target tank of AGV2 (k 1 < k A2 < k A1 ). If AGV1 is unloaded currently and moves in the same direction (right) as AGV2, then AGV1 will accept the request under the following conditions: Figure 6 explains the process of dual AGVs collaborating with each other. Figure 7 presents the workflow of the proposed algorithm.

Computational Results in Industrial Implementation
To verify its performance, the proposed algorithm was applied to minimize the overall time of the common rail dual AGVs in handling 16 actual orders from a factory. For comparison, the classical GA was also tested to test whether our algorithm can outshine the common baseline search algorithm. Tables 2 to 17 provide the details of the 16 orders. As shown in Table 18, our algorithm greatly shortened the overall distribution time of the GA, an evidence to its rationality and high performance. Take order 7 as an If there is no overlapping section, assign the next task as per the initial plan.
If there is an overlapping section, go to step 3 for dynamic planning of the next task. If the two AGVs have an overlapping section and complete the current tasks at the same time.
If the two AGVs have an overlapping section but fail to complete the current tasks at the same time.
If R2 < R1, then AGV1 stops and acts as the collaborator, and AGV2 continues to move forward.
If AGV1 has completed the task but AGV2 has not, then AGV1 acts as the collaborator, while AGV2 continues to move forward.

R1
AGV1 AGV2 AGV1 AGV2 Figure 5: e determination of the motion state for the next task.

R2
Send a request for help to empty the incompatible materials of the target tank Accept requests Empty incompatible materials AGV2 AGV2 can help empty the incompatible materials of AGV1, because the target tank of AGV1 is empty and before the target tank of AGV2.

Material serial number
Allocated AGV Current tank Target  tank  1  1  1  18  2  2  2  2  3  1  2  14  4  1  3  17  5  2  4  20  6  2  7  8  7  2  8  13  8  2  8  16  9  1  8  9  10  1  9  12  11  2  10  9  12  2  10  5  13  2  11  12  14  1  13  11  15  1  13  1  16  1  13  12  17  2  15  20  18  1  18  12  19  1  20  7 8 Mathematical Problems in Engineering example to illustrate the rationality and effectiveness of our algorithm. Figure 8 explains the next routes of the two AGVs in the event of a conflict [20]. By our algorithm, the final results of AGV operations and order of material distribution were obtained. en, the distribution order was randomly changed to obtain new solutions to AGV running time. After the changes, the running time of the AGVs and the relevant solutions were observed to see if our algorithm could lead to the best solution. Figure 9 presents the randomly changed order and the new running time of the 30 orders in Tables 2 to 17. It can be seen that all the new solutions were greater than the original running time, indicating that the scheduling plan of our algorithm is the best possible solution. e next step is to verify whether any solution in the 16 solutions is the optimal solution. Taking order 7 as the object, the order of material distributions was changed randomly twice, three times, and four times, respectively. e running time of each change is shown in Figure 10.

Conclusions
is paper models and solves the problem of common rail dual AGVs scheduling in a novel way. e proposed solving algorithm for the problem consists of five steps, each of which is described in detail, and provides the scheduling plans considering the various situations of AGV motions. e performance of our algorithm was fully verified through experiments. e results show that our algorithm can solve the problem more efficiently and is more effective than the GA in all cases. Even if the solution structure was partly changed by random, our algorithm could still find the optimal solution very quickly. e future research will extend proposed method to multi-AGV cooperative scheduling or develop even more efficient online dynamic programming algorithms for this problem.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest. Mathematical Problems in Engineering 13