**2. Mathematical Model**

### *2.1. Problem Description*

Figure 1 illustrates the scheduling problem in which n jobs are required to be processed in *m* stages [15]. At least one stage in the *m* stages includes multiple parallel machines. Each job is needed to be assigned one machine at each stage. Also, buffers with given capacity exist between stages. The completed job enters the buffer and waits for the availability of the next stage. If the buffer is full, the completed job of the previous stage will stay on its current machine. In this situation, the machine is unavailable and cannot process other jobs until the buffer has available spaces. The buffers contains multiple lanes, and each lane has a limited number of spaces. The job enters the lane from one side and exits the lane from the other side. The jobs that wait for processing form a waiting queue in each lane. When the job enters this buffer, it needs to select one of the lanes and enter its waiting queue. When there is an idle machine in the next stage, it is necessary to select one bus in multiple waiting queues to move out of the buffer for processing. When all the lanes of this buffer reach the upper limit of the capacity, there will also be cases where the job is blocked at the machine of the previous stage. When the job is assigned to the machine, the setup time should also be added besides the standard processing time if the property of the job did not match that of the previous job. The standard processing time of the job at each stage, the online sequence of the job in the production process and the job's setup times, start time, and completion time at each stage can be obtained through the scheduling, so as to achieve better scheduling results.

**Figure 1.** Model for the multi-queue limited buffers scheduling problems in a flexible flow shop.

#### *2.2. Parameters in the Model*

The parameters used in this paper are as follows:

*n*: number of jobs to be scheduled;

*m*: number of stages;

*Ji*: job *i*, *i* ∈ {1, ... , *n*};

*Operj*: stage *j*, *j* ∈ {1, ... , *m*};

*Mj*: number of machines in each stage, *j* ∈ {1, ... , *m*};

*WSj*,*l*: machine *l* of stage *Operj*, *j* ∈ {1, ... , *m*}, *l* ∈ 1, ... , *Mj* ;

*Buj*: the buffer of stage *Operj*, *j* ∈ {2, ... , *m*};

*Aj*: number of waiting queue in the buffer of stage *Operj*, *j* ∈ {2, ... , *m*};

*Bsj*,*a*: the *ath* lane of buffer *Buj* at stage *Operj*, *j* ∈ {2, ... , *m*}, *a* ∈ 1, ... , *Aj* ;

*Kj*,*a*: number of spaces in lane *Bsj*,*<sup>a</sup>* of buffer *Buj* at stage *Operj*, *j* ∈ {2, ... , *m*}, *a* ∈ 1, ... , *Aj* ;

*bj*,*a*,*k*: space *k* in lane *Bsj*,*<sup>a</sup>* of buffer *Buj*, *j* ∈ {2, ... , *m*}, *a* ∈ 1, ... , *Aj* , *k* ∈ 1, ... ,*Kj*,*<sup>a</sup>* ;

*WAj*,*a*(*t*): at time *t*, the waiting queue in the *ath* lane *Bsj*,*<sup>a</sup>* of buffer *Buj*, *j* ∈ {2, ... , *m*}, *a* ∈ 1, ... , *Aj* ;

*Si*,*j*: the start time to process job *Ji* at stage *Operj*;

*Ci*,*j*: the completion time to process job *Ji* at stage *Operj*;

*Tbi*,*j*: the standard processing time of job *Ji* at stage *Operj*, *j* ∈ {1, ... , *m*};

*Tei*,*j*: the entry time of job *Ji* into buffer *Buj*, *j* ∈ {2, ... , *m*};

*Tli*,*j*: the departure time of job *Ji* out of buffer *Buj*, *j* ∈ {2, ... , *m*};

*Toi*,*j*: the departure time of job *Ji* on its machine after job *Ji* is processed at stage *Operj*, *j* ∈ {1, ... , *m*}; *Twi*,*j*: the waiting time of job *Ji* in buffer *Buj*, *j* ∈ {2, ... , *m*};

*Tsi*,*j*,*l*: the setup time of machine *WSj*,*<sup>l</sup>* when job *Ji* is processed on machine *WSj*,*l*, *j* ∈ {2, ... , *m*};

*Nsrv<sup>l</sup> x*,*i* ,*i* : the relationship between properties of job continuously processed on machine *WSj*,*l*, *i* , *i* ∈ {1, ... *n*} and *i i* .

### *2.3. Constraints*

#### 2.3.1. Assumptions

The variables used in this paper are as follows:

$$At\_{i,j,l} = \begin{cases} 1, & \text{Job } f\_i \text{ is assigned to be processed} \\ & \text{on machine } WS\_{j,i} \text{ at stage } Opr\_{j} \\ & \text{Job } f\_i \text{ isn't assigned to be processed} \\ 0, & \text{on machine } WS\_{j,i} \text{ at stage } Opr\_{j} \end{cases} \tag{1}$$

$$OA\_{i,j,a}(t) = \begin{cases} 1, & \text{At time } t, \text{ job } f\_i \text{ is in waiting} \\ 1, & \text{Procossing queue } MA\_{j,a}(t) \text{ at stage } Opr\_{j} \\ 0, & \text{At time } t, \text{ job } f\_i \text{ isn't in waiting} \\ & \text{procossing queue } MA\_{j,a}(t) \text{ at stage } Opr\_{j} \end{cases} \tag{2}$$

$$QBC\_{j,a}(t) = \begin{cases} 1, & \text{At time } t, \text{ the number of jobs in lane } Bs\_{j,a} \text{ at stage } \\ 0, & \text{Oopry}\_{j} \text{ is greater than zero, namely, } \text{card}(WA\_{j,a}(t)) > 0 \\ 0, & \text{At time } t, \text{ the number of jobs in lane }Bs\_{j,a} \text{ at stage } \end{cases} \tag{3}$$

2.3.2. General Constraint of Flexible Flow Shops Scheduling

0,

The general constraint of flexible flow shops scheduling are as follows:

$$\sum\_{l=1}^{M\_j} A t\_{i,j,l} = 1\tag{4}$$

*WAj*,*a*(*t*) = 0

$$C\_{i,j} = S\_{i,j} + Tb\_{i,j}, i \in \{1, 2, \dots, n\}, j \in \{1, 2, \dots, m\} \tag{5}$$

$$\{\mathbb{C}\_{i,j-1} \le S\_{i,j}, i \in \{1, 2, \dots, n\}, j \in \{1, 2, \dots, m\} \tag{6}$$

Equation (4) indicates job *Ji* at stage *Operj* can only be processed on one machine. Equation (5) constrains the relationship between the start time and completion time for job *Ji* at stage *Operj*. Equation (6) represents that job *Ji* needs to complete the current stage before proceeding to the next stage. The general constraints of flexible flow shops are still valid for the multi-queue limited buffers scheduling problem in a flexible flow shop with setup times.

*Operj* is equal to zero, namely, *card*

#### 2.3.3. Constraints of Limited Buffers

The constraints of limited buffers are as follows:

$$T o\_{i,j} = \begin{cases} T e\_{i,j+1} & j = \{1, \dots, m-1\} \\ C\_{i,j} & j = m \end{cases} \tag{7}$$

In Equation (7), when the job is at stage *Operj* (*i* = {1, ... , *m* − 1}), the departure time of the job on the machine is equal to the entry time of the job into the buffer. When the job is at stage *Operm*, the departure time of the job on the machine equals the completion time.

$$T e\_{i,j} \ge \mathbb{C}\_{i,j-1}, j \in \{2, \dots, m\}. \tag{8}$$

Equation (8) indicates that the entry time of the job into the buffer is greater than or equal to the completion time of the job in the previous stage. If the limited buffers are blocked, the job will be retained on the machine after completing the previous stage.

$$WA\_{j,\mathfrak{a}}(t) = \left\{ I\_i \middle| OA\_{i,j,\mathfrak{a}}(t) = 1 \right\}.\tag{9}$$

Equation (9) shows all jobs contained in the waiting queue of limited buffers at time *t*.

$$
card(\mathsf{V}A\_{j,a}(t)) \le \mathsf{K}\_{j,a}.\tag{10}$$

Equation (10) denotes that at any time, the number of jobs in the waiting queue *WAj*,*<sup>a</sup>* is less than or equal to the maximum number of spaces (*Kj*,*a*) in the lane where *WAj*,*<sup>a</sup>* is located.

### 2.3.4. Constraints of Multi-Queue Limited Buffers

Two new constraints of Equations (11) and (12) are added based on the constraints of Equations (8) and (10).

$$\sum\_{a=1}^{A\_j} \sum\_{i=1}^n OA\_{i,j,a}(t) \le n. \tag{11}$$

In Equation (11), when *Aj* > 1, at any time, the number of jobs to be processed in the waiting queue of multi-queue limited buffers is less than or equal to the number of jobs *n*.

$$\sum\_{a=1}^{A\_j} QBC\_{j,a}(t) \le n. \tag{12}$$

In Equation (12), when *Aj* > 1, at any time, the number of jobs, which can proceed to the machine of stage *Operj*, in the waiting queue of multi-queue limited buffers is less than or equal to the number of jobs *n*.

If ∃*i* , *i* ∈ *i OAi*,*j*,*a*(*t*) <sup>=</sup> <sup>1</sup> , *Tei* ,*<sup>j</sup>* ≤ *Tei* ,*j*, *Tli* ,*<sup>j</sup>* and *Tli* ,*<sup>j</sup>* will satisfy the following relationship

$$T l\_{i',j} \le T l\_{i'',j}.\tag{13}$$

In Equation (13), when *Aj* > 1, the job of the *ath* lane must meet the requirement that the job entering the queue first should depart from the queue first.

#### 2.3.5. Constraints of Setup Times

The constraints of setup times are as follows:

$$\sum\_{l=1}^{M\_j} \left( \mathbf{T}\_{\bar{\mathbf{s}}, \mathbf{j}, \mathbf{l}'} A \mathbf{t}\_{\bar{\mathbf{i}}, \mathbf{j}} \right) + \mathbf{C}\_{\bar{\mathbf{i}}, \mathbf{j} - 1} \le \mathbf{S}\_{\bar{\mathbf{i}}, \mathbf{j}}, \ i \in \{1, \dots, n\}, \ l \in \{1, \dots, M\_j\}, \ j \in \{2, \dots, m\}. \tag{14}$$

Equation (14) extends the basic constraint of Equation (6) of a flexible flow shop to obtain the relationship between setup times and start time as well as completion time. Equation (14) indicates that the start time of the current stage is greater than or equal to the completion time of the previous stage plus setup times.

*<sup>X</sup>* denotes the number of job's properties. *propx*,*<sup>i</sup>* represents the property of job *Ji*. *Propi* <sup>=</sup> *propx*,*<sup>i</sup>* represents the collection of properties of job *Ji*, and *x* ∈ {1, ... , *X*}.

$$\text{Nsrv}^{l}\_{\text{x,i'},j\prime} = \begin{cases} 1 & \text{prop}\_{\text{x,i'}} \neq \text{prop}\_{\text{x,i'}}\\ 0 & \text{prop}\_{\text{x,i'}} = \text{prop}\_{\text{x,i'}} \end{cases} . \tag{15}$$

*Ji* and *Ji* (*i* , *i* ∈ {1, ... , *n*}) are jobs continuously processed on machine *WSj*,*l*. When *Nsrvl x*,*i* ,*i* = 0, it means that when property *propx*,*<sup>i</sup>* of job *Ji* and property *propx*,*<sup>i</sup>* of job *Ji* are the same, no setup time is required to process the latter job on the machine. When *Nsrvl x*,*i* ,*i* = 1, it represents that when property *propx*,*<sup>i</sup>* of job *Ji* and property *propx*,*<sup>i</sup>* of job *Ji* are different, the setup time is required to process the latter job on the machine.

$$\mathbf{T} \mathbf{s}\_{\mathbf{i'}, \mathbf{j}, \mathbf{l}} = \sum\_{\mathbf{x} = \mathbf{l}}^{\mathbf{X}} \mathbf{T} \mathbf{s} p\_{\mathbf{j}, \mathbf{x'}} \mathbf{N} \mathbf{s} \mathbf{r} \mathbf{r}\_{\mathbf{x}, \mathbf{i'}, \mathbf{j}, \mathbf{i'}}^{l}, \mathbf{i'}, \mathbf{i'} \in \{1, \dots, n\}, \ j \in \{2, \dots, m\}, \ l \in \{1, \dots, M\}. \tag{16}$$

In Equation (16), at stage *Operj*, *Tspj*,*<sup>x</sup>* represents the required setup times when there is a change in one property *propx*,*<sup>i</sup>* of two consecutively processed jobs. *TSPj* <sup>=</sup> *Tspj*,*<sup>x</sup>* denotes the collection of setup times when there is a change in the property of two consecutively processed jobs at stage *Operj*, and *x* ∈ {1, ... , *X*}. *Tsi* ,*j*,*<sup>l</sup>* is the required setup time when several properties of job *Ji* processed on machine *WSj*,*<sup>l</sup>* at stage *Operj* are different from those of the previous job processed on the same machine.

Other constraints are as follows. Uninterruptible constraint: if the job has been started on the machine, it cannot be interrupted until the production process on the machine is completed. Machine availability constraint: all machines in the scheduling are available at production time. Time simplification constraint: not to consider the time of jobs transferred among spaces in the multi-queue limited buffers, and the time of jobs transferred between machines in front and back stages, that is to say, only consider the processing time of the job processed in each stage and setup times when the property of jobs processed successively on the machine is changed.

#### *2.4. Evaluation Index of the Scheduling Result*

• Makespan

$$\mathbb{C}\_{\text{max}} = \max \{ \mathbb{C}\_{i,m} \}, i \in \{ 1, 2, \dots, n \}. \tag{17}$$

In Equation (17), *Cmax* indicates the maximum completion time of all jobs processed at the last stage, which is also the time for all jobs to complete the process.

• Waiting processing time for total job

$$TWIP = \sum\_{j=2}^{m} \sum\_{i=1}^{n} \left(\mathbb{S}\_{ij} - \mathbb{C}\_{i,j-1}\right). \tag{18}$$

In Equation (18), the waiting time of the job is from the completion moment *Ci*,*j*−<sup>1</sup> of job *Ji* at stage *Operj*<sup>−</sup><sup>1</sup> to the start moment *Sij* at the next stage *Operj*. *TWIP* represents the sum of the waiting times of all jobs processed in the entire production. In the production shop of limited buffers, the waiting time of each job between stages is equal to the sum of time for the job staying on the buffer (*Tli*,*<sup>j</sup>* − *Tei*,*j*),

blocking time of the job on the machine (*Tei*,*<sup>j</sup>* − *Ci*,*j*<sup>−</sup>1), and setup times ( *M j l*=1 *Tsi*,*j*,*l*·*Ati*,*j*,*<sup>l</sup>* ).

• Idle time for total machine

$$T\mathcal{W}T = \sum\_{j=1}^{m} \sum\_{l=1}^{M\_j} \left( \left( \max\{ T o\_{i,j} \cdot A t\_{i,j,l} \} - \min\{ S\_{i,j} \cdot A t\_{i,j,l} \} \right) - \sum\_{i=1}^{n} \left( T b\_{i,j} \cdot A t\_{i,j,l} \right) \right) . \tag{19}$$

The idle time for the machine in Equation (19) represents the time between the start time of the first job and completion time of the last job on each machine. *TWT* is the sum of idle time for all machines. *Processes* **2019**, *7*, 302

• Total device availability

$$FLR = \frac{\sum\_{j=1}^{m} \sum\_{i=1}^{n} \left( Tb\_{i,j} \right)}{\sum\_{j=1}^{m} \sum\_{l=1}^{M\_j} \left( \max \{ To\_{i,j} \cdot At\_{i,j,l} \} - \min \{S\_{i,j} \cdot At\_{i,j,l} \} \right)} . \tag{20}$$

In Equation (20), *FUR* represents the total device availability of all machines in a flexible flow shop, which is the ratio of the effective processing time of all machines to the occupied time span of the machine. This time span starts from the first job processed on the machine to the last job that is finished and has left the machine.

• Total machine setup times

$$TS = \sum\_{i=1}^{n} \sum\_{j=1}^{m} \sum\_{l=1}^{M\_j} \left( Ts\_{i,j,l'} A t\_{i,j,l} \right) . \tag{21}$$

In Equation (21), *TS* is the sum of all stages' setup times in a flexible flow shop.

• Total job blocking time

$$TPB = \sum\_{i=1}^{n} \sum\_{j=2}^{m} \left( T \varepsilon\_{i,j} - C\_{i,j-1} \right) . \tag{22}$$

In Equation (22), *TPB* is the sum of blocking time of all jobs stuck on the machine due to the buffers being full after all jobs finish the processing in a flexible flow shop.

#### **3. Improved Compact Genetic Algorithm**

In the evolution of standard CGA, new individuals are generated based on probability distribution of the probabilistic model, and individuals conforming to the evolutionary trend are selected to update the distribution probability. The elements in the model, namely the probability values, represent the distribution of feasible solutions. The continuously accumulated optimization information in the evolution is reflected in the probability values of the probabilistic model. The CGA adopts the single individual to update the probabilistic model in each generation, and the new individual of each generation is also generated in the model. After several generations, if one of the probability values on the model's column (or row), which controlled the generation of individual gene fragments, is extremely large, it leads to similar genes appearing in the same position of new individuals generated in later evolutions, decreasing the diversity of new individuals. As the individuals generated from the probabilistic model will update the model conversely, the probability values will further increase. When elements (probability values) in the probabilistic model all become 0 or 1, the CGA will terminate the evolution process. Therefore, it is difficult for the CGA to jump out of the local extremum once it falls into this situation. Afterward, the overall trend for evolution is irreversible, leading to a premature convergence of the algorithm. As such, if only an expanding the number of new individuals generated by the model is considered, the optimization effect of the algorithm cannot be significantly improved, and the advantage of the CGA in the fast search will be lost. The probabilistic model and the process of generating new individuals from the model were explored to prevent the prematurity of the CGA and improve the quality and diversity of new individuals. First, the distribution of probability values in a column (or a row) that were related to gene fragments of new individuals in the probabilistic model were determined, and then the probability density function of the Gaussian distribution was introduced to map the probabilistic model from the original one to the new one. Under the premise of keeping the probability values' distribution of the original probabilistic model unchanged, the search ability of feasible solutions could be expanded, thereby developing the diversity of new individuals.

#### *3.1. Establishing and Initializing the Probabilistic Model*

The probabilistic model was responsible for counting and recording the distribution of genes in the individual after the evolution of the algorithm. According to the individual coding information, namely online sequence and machine assignment, the *n* × *n* matrix *P<sup>L</sup>* was established as the online-sequence probabilistic model of the CGA to optimize the scheduling online sequence. In the probabilistic model, the 1st to *n*th rows corresponded to jobs *J*<sup>1</sup> to *Ji*, and the 1st to *n*th columns corresponded to individuals 1 to *n*. *P*<sup>1</sup> *<sup>i</sup>*,*<sup>s</sup>* indicated the probability of job *Ji* appearing at position *s* of the online processing queue.

The probabilistic model was initialized by a uniform assignment. This method directly set the equal probability of each job appearing at each position, providing a more balanced optimization starting point for the algorithm. It used the uniform assignment to initialize the probabilistic model *P*, namely ∀(*i*,*s*), *P*<sup>1</sup> *<sup>i</sup>*,*<sup>s</sup>* = 1/*n*, which could expand the search range of the algorithm's feasible solution.

In addition, it was restricted by the constraint that <sup>∀</sup>(*s*), *<sup>n</sup> i*=1 *P*1 *<sup>i</sup>*,*<sup>s</sup>* = 1.

#### *3.2. Mapping the Original Probabilistic Model to the New Probabilistic Model*

Some scholars used information entropy to evaluate the distribution of probability values in the probabilistic model [16]. This approach is not quite sensitive to the distribution of probability values. This study adopted the method of calculating the standard deviation of probability values in the probabilistic model to assess the probability distribution in the original probabilistic model so as to judge and evaluate the ability of the current model to search for feasible solutions.

The ICGA consisted of two models: the original probabilistic model *PL* and the new probabilistic model *FL*. The element *PL <sup>i</sup>*,*<sup>s</sup>* in the probabilistic model referred to the probability of job *Ji* appearing at position *s* in online processing queue.

The probability value distribution in *PL* was judged by calculating each column of standard deviation σ*<sup>s</sup> <sup>L</sup>* in the original probability model *PL*. Meanwhile, the standard deviation-based threshold value σ*<sup>T</sup>* which started the mapping operation was set to judge whether the probability density function of the Gaussian distribution can be started to map *PL* to the new probability model *FL*. When σ*<sup>s</sup> <sup>L</sup>* > σ*T*, mapping the *PL* to the *F<sup>L</sup>* using the probability density function of the Gaussian distribution shown in Equation (23). Then, a new feasible solution *I <sup>L</sup>* (new individual) of the problem was generated in accordance with the *FL*. The original probability model *P<sup>L</sup>* was updated through this new feasible solution. After that, this new feasible solution was applied to update the *PL*. The scope of searching a feasible solution was magnified through expanding the ability of the *PL* to select new feasible solutions.

$$f(\mathbf{x}|\mu\_s^L, \sigma\_s^L) = \frac{1}{\sigma\_s^L \cdot \sqrt{2\pi}} e^{-\frac{\left(\mathbf{x} - \mu\_s^L\right)^2}{2\sigma\_s^L \cdot 2}}.\tag{23}$$

Equation (23) is the probability density function of the Gaussian distribution, where μ*<sup>L</sup> <sup>s</sup>* is the expectation value of the *sth* column in the probabilistic model *PL*, and the calculation formula is shown in Equation (24). σ*<sup>s</sup> <sup>L</sup>* is the standard deviation of the *sth* column in the probabilistic model *PL*, and the calculation formula is shown in Equation (25). The size of the standard deviation determines the degree of steepness or flatness of the Gaussian distribution curve. The smaller the σ, the steeper the curve; and the larger the σ, the flatter the curve. With the evolution of the CGA, the distribution of probability values in the probabilistic model decreases, and the value of σ becomes larger (a probability value is dominant, while others are small and far from the average value). Further, the selection range after the mapping will become larger.

$$
\mu\_s^L = \sum\_{i=1}^n P\_{i,s}^L \cdot i \tag{24}
$$

$$
\sigma\_s^{\;L} = \sqrt{\frac{1}{n} \cdot \sum\_{s=1}^{n} \left( P\_{i,s}^L - \frac{1}{n} \right)^2} \,. \tag{25}
$$

At the beginning of evolution *PL <sup>i</sup>*,*<sup>s</sup>* = 1/*n*, and the initial value of σ*<sup>s</sup> <sup>L</sup>* is 0. If the value of σ*<sup>s</sup> <sup>L</sup>* is too small, the Gaussian distribution curve is too steep, the probability value after mapping is smaller. As such, the standard deviation adjustment parameter ξ is added to Equation (25) to obtain the standard deviation σ*<sup>s</sup>* <sup>ξ</sup>*<sup>L</sup>* after adjustment in Equation (26).

$$
\sigma\_s^{\xi L} = \xi \cdot \sqrt{\frac{1}{n} \cdot \sum\_{s=1}^{n} \left( P\_{i,s}^L - \frac{1}{n} \right)^2} \tag{26}
$$

$$\xi = \frac{n \cdot \max\left\{P\_{i,s}^L\right\}}{\sum\_{i=1}^n P\_{i,s}^L - \max\left\{P\_{i,s}^L\right\}}.\tag{27}$$

In Equation (27), the standard deviation adjustment parameter ξ satisfies the constraints: when *max PL i*,*s* <sup>=</sup> 1 or *<sup>n</sup> i*=1 *PL <sup>i</sup>*,*<sup>s</sup>* <sup>−</sup> *max PL i*,*s* <sup>=</sup> 0, <sup>ξ</sup> <sup>=</sup> <sup>√</sup> *n*.

After determining the probability density function of the Gaussian distribution corresponding to each column element in the *PL*, this function was used to obtain the corresponding probability value *GPL <sup>i</sup>*,*<sup>s</sup>* of each probability value *PL <sup>i</sup>*,*<sup>s</sup>* in this column in the new probabilistic model *FL*. The specific operations were: first, determine the range [*X*1, *X*2] for each probability value *PL <sup>i</sup>*,*<sup>s</sup>* on the *X* axis, where *<sup>X</sup>*<sup>1</sup> <sup>=</sup> *<sup>i</sup>* −1 *h*=1 *PL h*,*s* , *<sup>X</sup>*<sup>2</sup> <sup>=</sup> *<sup>i</sup> h*=1 *PL h*,*s* . Then, determine the position of expectation value μ*<sup>L</sup> <sup>s</sup>* on the *X* axis. Finally, the corresponding probability value *GPL <sup>i</sup>*,*<sup>s</sup>* of probability value *PL <sup>i</sup>*,*<sup>s</sup>* in the *<sup>F</sup><sup>L</sup>* is obtained by using Equation (28)

$$GP\_{i,s}^{L} = \begin{cases} \left| f(\mathbf{X}\_1) - f(\mathbf{X}\_2) \right| & \mu\_s^L \notin [\mathbf{X}\_1, \mathbf{X}\_2] \\ 2 \cdot f(\mu\_s^L) - f(\mathbf{X}\_1) - f(\mathbf{X}\_2) & \mu\_s^L \in [\mathbf{X}\_1, \mathbf{X}\_2] \end{cases} \tag{28}$$

After all the columns in the *PL* have been mapped, the probability values in each column of the new probabilistic model *FL* were normalized to ensure that the sum of the probability values in each column was 1. Then, the roulette was used to choose the positions of jobs which were arranged in the processing queue based on the *FL*, so as to generate new individuals in more diversities. The superior individual among new individuals was chosen to update the original probabilistic model *PL* through Equation (29).

$$P\_{i,s}^{L+1} = \left(1 - \frac{\beta}{n}\right) \cdot P\_{i,s}^L + \frac{\beta}{n} \cdot St,\ St = \begin{cases} 1 & \text{Gene}\_s = i \\ 0 & \text{Gene}\_s \neq i \end{cases} \tag{29}$$

where *St* is the learning coefficient; *n* is the number of jobs to be processed; and β is the adjustment override of the learning rate. In each generation, the superior individual is selected to update the probabilistic model. The genetic value *Genes* in the individual represents the sequential position of job *Ji* in online processing queue. Equation (29) shows that when the value of *Genes* is *i*, the probability value *P*<sup>1</sup> *<sup>i</sup>*,*<sup>s</sup>* in the *sth* column of the model which combines with learning coefficient *St* further increases the probability of job *Ji* being chosen on the position *s* in the online processing queue. In addition, other probability values of this column subtract <sup>β</sup> *<sup>n</sup>* ·*PL i*,*s* .

#### *3.3. Encoding and Decoding of New Individuals*

Based on the probabilistic model, *NP* new individuals were generated. The process of generating each new individual was: in the probabilistic model *PL*, based on the probability *Pi*,*s*, the genetic value of individual from the 1st to nth referred to the probability *Pi*,*<sup>s</sup>* of the job *Ji* which appeared on the *sth* position. The job numbers were chosen on the basis of roulette in turn, that is, the job online order. In the process of individual decoding, the individual genetic value was decoded into the online processing sequence of *n* jobs in the first stage.

#### *3.4. Procedure of the ICGA*

Step 1: Initialize probabilistic model *PL*. According to the principle of the maximum entropy, the probabilistic model *PL* is initialized, where ∀(*i*,*s*)*PL <sup>i</sup>*,*<sup>s</sup>* = 1/*n*. Meanwhile, the evolutionary generation is set as *L* = 0.

Step 2: Map the probability value *PL <sup>i</sup>*,*<sup>s</sup>* in the original probabilistic model *PL* to the new probabilistic model *FL*. Calculate the standard deviation σ*<sup>s</sup> <sup>L</sup>* of the probability value of the *sth* column in the original probabilistic model *PL*, and judge whether σ*<sup>s</sup> <sup>L</sup>* is larger than the threshold value σ*<sup>T</sup>* for initiating the mapping operation. If σ*<sup>s</sup> <sup>L</sup>* ≤ σ*T*, the probability value of the *sth* column in the *PL* is taken as the *sth* column probability value in the new probabilistic model *FL*. If σ*<sup>s</sup> <sup>L</sup>* > σ*T*, execute Step 3.

Step 3: Calculate the expectation value μ*<sup>L</sup> <sup>s</sup>* of the probability value of the *sth* column in the original probabilistic model *PL*. Determine its corresponding probability density function of the Gaussian distribution, and calculate the probability value *GPL <sup>i</sup>*,*<sup>s</sup>* in the new probabilistic model *<sup>F</sup><sup>L</sup>* corresponding to each probability value *PL <sup>i</sup>*,*<sup>s</sup>* in the *sth* column.

Step 4: Repeat Step 2 until all the columns in the original probabilistic model *PL* are all mapped into the new probabilistic model *FL*.

Step 5: Generate new individuals based on the new probabilistic model *FL*. Through the roulette, the individual genetic sampling values are selected in turn according to the probability values of each column in the *FL*, and these genetic values represent the positions of the jobs to be machined in the online queue. Once a job is selected, it no longer participates in the subsequent selection, while the unselected jobs go on to take part in the selection process until all jobs are arranged so as to generate a new individual. After that, *NP* new individuals *I*1, *I*2, ... , *INP* are generated.

Step 6: *NP* new individuals are decoded and the fitness function value for each new individual can be calculated.

Step 7: Compare the fitness function values of *NP* new individuals, and select the optimal individual *Ibetter* among them, and its fitness function value is *fbetter*.

Step 8: Judge whether *fbetter* is better than the fitness function value *fbest* of the historically optimal individual *Ibest*. If *fbetter* is better than *fbest*, replace *Ibest* with *Ibetter* and replace *fbest* with *fbetter*.

Step 9: The historically optimal individual *Ibest* is used to update the probabilistic model *PL*, and the update operation is performed according to Equation (29). At the same time, evolutionary generation *L* is processed as *L* = *L* + 1.

Step 10: Judge whether the updated original probabilistic model *PL* converges, that is, whether all probability values of model *PL* are 1 or 0. If the convergence is met, the historically optimal individual *Ibest* is output and the evolution process ends. Otherwise, execute Step 11.

Step 11: Judge whether the evolutionary generation *L* reaches the set maximum evolutionary generation *L*max. If *L* = *L*max, the historically optimal individual *Ibest* is output and the evolution process ends. Otherwise, Step 2 is performed again.

The flowchart of the ICGA is shown in Figure 2.

**Figure 2.** The flowchart of ICGA.
