## 4 Materials and Methods
### Mathematical Expression of the Feasible Solution of the Three-Stage DAPFSP  
The representation of feasible solutions is a crucial and important step in every metaheuristic approach. The addition of a transportation process to the DAPFSP solved in this paper. The result is that the original expression for the process permutation of the PFSP is not adequate for this scheduling problem. Therefore, in this section, the feasible solution is divided into a sequence of products and a sequence of \(s\) processes based on the model of the three-stage DAPFSP model and the properties of the bat algorithm. Each sequence of these \(s\) processes corresponds to a product. The processes of a part can be viewed as the sequence of product assembly on the assembly flowshop. In the production and transportation stages, parts need to be allocated one by one according to the product order. When allocating parts, their processes are sequentially arranged to the corresponding factories according to the process order of the product, and a minimum manufacturing cycle is obtained. Only after all the processes included in the current part are completed can the next part be produced. When a product has completed all processes, the product can proceed to the assembly stage for the installation and assembly stages. As an example, suppose a set of sequences \(f\) is used to represent a feasible solution, and each plant has one and only one solution. Each sequence is an ordering of all the parts assigned to that plant, indicating the order in which the parts enter the flow shop. Thus, the order of processed products in the assembly stage is also implied, and the feasible solution can be expressed as \(\pi=\left\{\pi_{1},\pi_{2},\ldots,\pi_{f}\right\}\), where \(\pi_{k}=\left(\pi_{k,1},\pi_{k,2},\ldots,\pi_{k,pk}\right),k=1,2,\ldots,f\) is the sequence associated with sequence associated with plant \(k\) and \(\eta_{k}\) is the total number of parts assigned to plant \(k\). For the example in Section 3, the representation corresponding to this feasible solution is \(\pi=\left\{\pi_{1},\pi_{2}\right\}\) and \(\pi_{1}=\left\{4,3,5\right\},\quad\pi_{2}=\left\{1,2,8,6,7\right\}\). In the feasible solution of the original DAPFSP problem, the first stage represents the arrangement of all \(N\) processes, and the second stage represents the plants to which these \(N\) processes are assigned respectively. In this section, the concept of product priority is introduced to determine the order of product assembly, and a novel feasible solution of the three-stage DAPFSP is proposed. Specifically, the feasible solution in the first stage is expressed as the processing priority of the product, and the parts assembly of each product is equal to the number of processes that constitute that product. The specific steps are, firstly, calculating the total processing time of the product at each stage and randomly initializing the sequence of products. Second, the first two products in the initial product sequence are selected for evaluation, and whichever sequence is better is chosen as the current sequence. Again, this is done by placing it among the product sequences that are already scheduled properly. Finally, an optimal schedule can be obtained to select the current best sequence for the next iteration of the process. The second stage is represented as the processing priority of all processes, where the processes belonging to the same product are arranged in a random order. The smaller the number of its columns, the higher the priority of the element values; the third stage is the plant priority assignment vector, where each part is represented as the plant assigned to the corresponding process. The specific steps are to assign a part of the processes to the factories one by one in order, then select a process and find the minimum completion time by placing it after the last process in each factory. The best part assignment is selected for the next iteration. Table 2 describes how the three-stage DAPFSP representation is decoded into a schedule.