## 3 DFJSP Solution Based on the Multi-Objective Hybrid Salp Swarm Algorithm
### Multi-Objective Hybrid Salp Swarm Algorithm for Solving the DFJSP
#### 3.2.2 Encoding and Decoding Mechanisms  
The double-flexible job shop green scheduling problem needs to solve three subproblems: machine selection, worker selection, and process scheduling. According to the characteristics of the DFJSP, the multi-objective hybrid salp swarm algorithm designed in this paper needs three layers of salp individuals to represent: operation sequence (OS), machine assignment (MA), and worker assignment (WA). The length of each layer is equal to the total number of processes of all workpieces, as shown in Figure 2. The OS part adopts random key coding based on ascending arrangement, and the corresponding process sequencing is obtained by arranging the element values of each position in ascending order. The specific operation method is shown in the decoding process of the OS part in Figure 2. The MA part adopts machine codes arranged according to processes, which are arranged according to the order of workpieces and workpiece processes, and it is expressed by integers representing the machine number of the processing machine selected in the current process. The WA part adopts worker codes arranged according to processes, which are arranged according to the order of workpieces and workpiece processes, and it is expressed by integers representing the worker type number selected in the current process. For example, in Figure 2, the first numeral, 2, in the MA section indicates that the process \(O_{11}\) is arranged to be processed on the second machine, and the fourth numeral, 1, indicates that the process \(O_{21}\) is arranged to be processed on the first machine. The first number, 3, in the WA part indicates that the process \(O_{11}\) has selected the third type of worker to operate. The other numbers represent the same meaning as above.  
Figure 2: Individual coding and OS part decoding process of the salp agent.  
To sum up, the following information can be interpreted from Figure 2: in the scheduling scheme represented by the salp individual, process \(O_{11}\) is processed first, and it is operated by a third type of worker on the second machine. The second process to be processed is \(O_{21}\), which will be processed by a third type of worker on the first machine. Then, other processes will be operated.  
The processing sequence of each process and the corresponding processing machines and operators can be determined from the individual code of salp. Then, the method in [5] is adopted to decode and generate activity scheduling for the salp individual. The specific steps are as follows:  
(1) Determine the machine set required to process each workpiece and the process set processed on each machine.  
(2) Determine the allowable starting processing time \(AS\) of each process, that is, the processing end time of the previous process.  
(3) Adopt a process insertion method to determine the earliest starting processing time \(S\) of each process. The method is as follows: Find all interval idle time periods \([TS,TE]\) on the machine where the current process is located and judge whether each interval idle time period meets the insertion conditions from left to right. If so, insert it into the current idle time period, \(S=max(TS,AS)\). Otherwise, \(S=max(LM,AS)\), where \(LM\) represents the end time of the last operation of the current machine.  
(4) Calculate the processing completion time \(C\) of each operation, where \(C=S+P\) and \(P\) represents the processing time of the operation.  
By the above decoding process, the processing sequence of the workpieces on each machine and the corresponding start time and completion time can be obtained. After calculation, the corresponding objective function value can be obtained.