Flexible job shop scheduling method based on improved bacterial foraging algorithm

The improved bacterial foraging optimization algorithm addresses early convergence and elite loss issues by using adaptive step lengths and migration probabilities, enhancing efficiency and accuracy in flexible job shop scheduling for manufacturing.

CN120317575APending Publication Date: 2025-07-15SHENYANG AEROSPACE UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510383191.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The existing flexible work workshop scheduling algorithms have shortcomings in taking into account efficiency and accuracy. They are prone to premature maturity and convergence, and elite individuals are prone to escape, making it difficult to effectively optimize the production cycle.

Method used

The improved bacterial foraging algorithm is adopted to generate initial populations through Logistic-Circle hybrid mapping, and an adaptive dynamic step size and political optimization algorithm are designed to improve replication operations, and an adaptive migration probability is introduced in the migration operation to optimize flexible operation workshop scheduling.

Benefits of technology

The optimization efficiency and accuracy of the algorithm are improved, premature convergence and elite individual escape are avoided, flexible operation workshop scheduling is optimized, and the production cycle of manufacturing enterprises is shortened.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120317575A_ABST
    Figure CN120317575A_ABST
Patent Text Reader

Abstract

The invention provides a flexible job shop scheduling method based on an improved bacterial foraging algorithm, and relates to the technical field of intelligent manufacturing. The method specifically comprises the following steps: acquiring original data of a flexible job shop, and constructing a flexible job shop scheduling optimization model; the method comprises the following steps: taking a flexible job shop scheduling scheme as an individual based on a flexible job shop scheduling optimization model, initializing parameters, and generating an initial population by adopting Logistic-Circle hybrid mapping; optimizing the initial population by adopting an improved bacterial foraging algorithm to obtain an optimal individual; and obtaining an individual position vector of the optimal individual, and converting the individual position vector of the optimal individual into a flexible job shop scheduling optimal scheme by using a conversion mechanism between the individual position vector and the scheduling scheme. According to the method, the production cycle of a manufacturing enterprise can be effectively shortened by optimizing flexible job shop scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent manufacturing, and in particular, to a flexible job shop scheduling method based on an improved bacterial foraging algorithm. Background Art

[0002] With the development and maturity of information technologies such as cloud computing and artificial intelligence, the manufacturing industry has been upgraded from manufacturing to "intelligent" manufacturing, and the demand has shifted towards personalization and customization. To cope with the production pressure brought about by demand customization and the fierce competition triggered by manufacturing intelligence, manufacturing enterprises must further optimize job shop scheduling to efficiently plan resources and shorten the production cycle. Job shop scheduling refers to the process of arranging the operations of workpieces to be processed on each machine in a machining system with a set of machines having different functions, and arranging the processing order and start time of each operation. Due to machine flexibility, traditional job shop scheduling no longer conforms to the current fast-paced production mode, and flexible job shop scheduling has emerged as the times require. Compared with traditional job shop scheduling, in flexible job shop scheduling, at least one operation is not restricted by machine constraints, and the scheduling is more complex, flexible, and has greater research value and practical significance.

[0003] The algorithm research for flexible job shop scheduling optimization is a research hotspot in this field. Mi Tianyi et al. proposed a variable neighborhood search algorithm integrating reinforcement learning for the flexible job shop scheduling problem. This method uses reinforcement learning to achieve dynamic adjustment of parameters, thereby improving the optimization efficiency and stability of the algorithm; Busra Tutumlu et al. studied the flexible job shop scheduling problem considering job splitting and proposed a hybrid genetic algorithm combined with job splitting. This method obtained the optimal solution for small-scale problems and feasible solutions for large-scale problems. Kashif Akram et al. proposed a multi-objective dynamic green flexible job shop scheduling problem and, by simulating the behavior of black widow spiders, proposed a multi-objective black widow spider algorithm to achieve the balance between production cycle and energy consumption. The above existing optimization algorithms have their own advantages, but there are still certain disadvantages, such as being only applicable to specific problems, being simple to implement but having low accuracy, and having high complexity and being not easy to apply in practice, etc. Therefore, although various optimization algorithms have been successively proposed, how to design a simple, efficient, stable, and accurate solution algorithm remains an important research direction in the field of flexible job shop scheduling. Based on this, it is intended to optimize and expand the application of the bacterial foraging algorithm to flexible job shop scheduling.

[0004] The bacterial foraging algorithm is a swarm intelligence algorithm with advantages such as simple implementation and parallel search, and has been widely applied to optimization problems such as image enhancement. However, when solving practical problems, the bacterial foraging algorithm still has problems such as being unable to balance efficiency and accuracy, being prone to premature convergence, and elite individuals being prone to "escaping". In recent years, there have been many improved studies on the bacterial foraging algorithm. For example, Niu Ben et al. introduced a multi-element learning strategy into the periodic bacterial foraging algorithm, improved the chemotaxis operation and replication operation of the algorithm, and ensured the population diversity while accelerating the convergence speed; however, this method did not solve the problem of elite individuals escaping. Pang et al. introduced an adaptive search step size into the chemotaxis operation of the bacterial foraging algorithm, reduced unnecessary tumbling and swimming behaviors of individuals, improved the optimization efficiency and avoided the algorithm falling into local optimum; Li Dongqin et al. introduced an adaptive dynamic step size and the memory step of the particle swarm algorithm into the chemotaxis operation of the bacterial foraging algorithm, improved the optimization efficiency and global search ability of the algorithm; however, the above two improvements did not solve the problems of "escaping" of elite individuals and premature convergence caused by the fixed migration probability in the bacterial foraging algorithm. Summary of the Invention

[0005] Aiming at the deficiencies of the above-mentioned existing technologies, based on the improved bacterial foraging algorithm, the present invention proposes a flexible job shop scheduling method based on the improved bacterial foraging algorithm, aiming to optimize the flexible job shop scheduling, thereby shortening the production cycle of manufacturing enterprises.

[0006] A flexible job shop scheduling method based on the improved bacterial foraging algorithm proposed by the present invention includes the following processes:

[0007] Obtain the original data of the flexible job shop and construct an optimization model for the flexible job shop scheduling;

[0008] Based on the optimization model for the flexible job shop scheduling, regard a flexible job shop scheduling scheme as an individual, initialize the parameters of the bacterial foraging algorithm, and generate an initial population by using the Logistic-Circle hybrid mapping;

[0009] Optimize the initial population by using the improved bacterial foraging algorithm to obtain the optimal individual;

[0010] The improved bacterial foraging algorithm is: design an adaptive dynamic step size to replace the fixed step size in the chemotaxis operation of the bacterial foraging algorithm to improve the optimization efficiency and accuracy; adopt the political optimization algorithm PO to improve the replication operation to ensure the population diversity; design an adaptive migration probability in the migration operation to replace the fixed migration probability to avoid the escape of elite individuals in the population optimization process;

[0011] Obtain the individual position vector of the optimal individual, and use the conversion mechanism between the individual position vector and the scheduling scheme to convert the individual position vector of the optimal individual into the optimal flexible job shop scheduling scheme.

[0012] Furthermore, the specific content of obtaining the original data of the flexible job shop and constructing the flexible job shop scheduling optimization model is as follows:

[0013] Obtain the original data of the flexible job shop, including: m workpieces, n machines, the number of processes for each workpiece, the optional machines for each process, and the processing time of each process on each optional machine;

[0014] Define the objective function of the flexible job shop scheduling optimization, establish the constraint conditions of the flexible job shop scheduling optimization, and construct the flexible job shop scheduling optimization model based on the objective function of the flexible job shop scheduling optimization and the constraint conditions of the flexible job shop scheduling optimization;

[0015] The objective function of the flexible job shop scheduling optimization is to minimize the makespan;

[0016] The constraint conditions of the flexible job shop scheduling optimization include:

[0017] Operation uniqueness constraint: At the same time, the same operation can only be processed on one machine;

[0018] Machine constraint: At the same time, only one operation is allowed to be processed on the same machine;

[0019] Processing time constraint: The processing time of each machine cannot exceed the total processing time of the machine;

[0020] Operation sequence constraint: All operations of the same workpiece are processed in the predetermined operation sequence, and the start time of each operation is not later than the completion time;

[0021] Completion time constraint: The processing time of each workpiece does not exceed the makespan;

[0022] Other constraints: Each operation does not interrupt during the processing process, and the start time, processing time on the machine, and completion time of each operation are non-negative, and the processing time of each machine is also non-negative.

[0023] Furthermore, the flexible job shop scheduling optimization model is expressed as:

[0024] z = minT max

[0025]

[0026] S iq +T iqj ≤Skp +R(1 - Y iqkpj )

[0027] E i(q-1) ≤S iq +R(1 - Y i(q-1)iqj )

[0028] T j ≤T n

[0029] E i(q-1) ≤S iq

[0030] S iq +T iqj ·X iqj ≤E iq

[0031] T i ≤T max

[0032] E iq -S iq =T iqj

[0033] S iq ≥0, T iqj ≥0, E iq ≥0, T j ≥0

[0034] where z is the objective function representing the minimization of the makespan; T max represents the makespan; X iqj is a decision variable used to represent whether the q-th operation O i of workpiece M iq is processed on machine N j . If so, X iqj = 1; if not, X iqj = 0; i is the index value of the workpiece, and i = 1, 2, 3,..., m; j is the index value of the machine, and j = 1, 2, 3,..., n; S iq represents the start time of operation O iq ; T iqj represents the processing time of operation O iq on machine N j ; S kp represents the start time of operation O kp ; O kp represents the p-th operation of workpiece M k , where k = 1, 2, 3,..., m, and k ≠ i; R is a positive integer of infinity, Y iqkpj is used to represent that on machine N j the operation Oiq Whether it is prior to process O kp Decision variable for processing. If so, Y iqkpj = 1; if not, Y iqkpj = 0; E i(q-1) Represents the completion time of process O i(q-1) ; Y i(q-1)iqj For representing the processing time of machine N j for process O i(q-1) Whether it is prior to process O iq Decision variable for processing. If so, Y i(q-1)iqj = 1; if not, Y i(q-1)iqj = 0; T j Represents the processing time of machine N j ; T n Represents the total processing time of the machine; E iq Represents the completion time of process O iq ; T i Represents the completion time of workpiece M i .

[0035] Furthermore, the specific content of initializing the parameters of the bacterial foraging algorithm is as follows: Define the population size S, the maximum number of iterations E, the maximum number of chemotactic operations Nc, the maximum number of times an individual swims in the same direction during each chemotactic operation Ns, the fixed step size C0(α) for each individual's swim, the maximum number of reproduction operations Nre, the maximum number of elimination-dispersal operations Ned, and the elimination-dispersal probability Ped; where α represents the index value of the individual.

[0036] Furthermore, the specific content of generating the initial population using the Logistic-Circle hybrid mapping is as follows: Based on the set population size S, select an initial iteration value x0 within the defined iteration range, and generate a chaotic sequence using the Logistic-Circle hybrid mapping iteration formula;

[0037] The Logistic-Circle hybrid mapping iteration formula is expressed as:

[0038]

[0039] where x c+1 represents the iteration value of the (c + 1)-th iteration of the chaotic mapping; mod represents the modulo function operation; x c represents the iteration value of the c-th iteration of the chaotic mapping; a and b are control parameters, and there are:

[0040]

[0041] where b0 represents the initial value of the control parameter b; represents the output of the Logistic mapping, and there are:

[0042]

[0043] where r represents the control parameter of the Logistic map;

[0044] Use the chaotic sequence as the initial population, and at the same time generate the positions of each individual in the initial population, and store the positions of the individuals in the form of individual position vectors.

[0045] Furthermore, the individual position vector is a two-segment encoding with a length of 2l, denoted as X. Among them, the first l elements in the individual position vector X are the first segment of encoding, which is used to represent the machine selection scheme in the flexible job shop scheduling scheme; the last l elements in the individual position vector X are the second segment of encoding, which is used to represent the operation arrangement scheme in the flexible job shop scheduling scheme; each element in the individual position vector is a random key value within the range [-ε, ε], and ε is the number of workpieces in the individual;

[0046] For any operation μ in the individual, the element X(μ) in the individual position vector is used to determine the machine assigned to operation μ, and the element X(μ + l) in the individual position vector is used to determine the execution order of operation μ.

[0047] Furthermore, the specific content of using the improved bacterial foraging algorithm to optimize the initial population to obtain the optimal individual and use it as the optimal flexible job shop scheduling scheme is as follows:

[0048] Step S1: Define the current iteration round as e, the number of chemotaxis operations in the current iteration round as f, the number of reproduction operations as g, and the number of elimination-dispersal operations as h, and initialize f = 0, g = 0, and h = 0, and start the first iteration optimization of the initial population;

[0049] Step S2: Traverse all individuals in the current population, perform one chemotaxis operation on each individual, and obtain the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations;

[0050] Step S3: Assign f + 1 to f, and judge whether f ≥ Nc holds. If it holds, execute Step S4; otherwise, return to Step S2;

[0051] Step S4: Perform one reproduction operation on the current population to obtain the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations;

[0052] Step S5: Assign g + 1 to g, and judge whether g ≥ Nre holds. If it holds, execute Step S6; otherwise, reassign f = 0 and return to Step S2;

[0053] Step S6: Perform a migration operation on the current population to obtain the population after f trend operations, g replication operations, and h migration operations;

[0054] The specific content of step S6 is as follows: Count the health of each individual in the current population, sort the individuals in the current population in descending order according to their health, calculate the adaptive migration probability of each individual according to the sorting result, and perform a migration operation on each individual according to its adaptive migration probability. Generate the population after f trend operations, g replication operations, and h migration operations using the migrated individuals.

[0055] The calculation method of the adaptive migration probability is as follows:

[0056]

[0057] where Ped(α) is the adaptive migration probability of individual α; is the highest health value in the sorting result; is the lowest health value in the sorting result; is the health of individual α;

[0058] Step S7: Assign h + 1 to h, and determine whether h ≥ Ned holds. If it holds, execute step S8; otherwise, reassign f = 0, g = 0 and return to step S2;

[0059] Step S8: Assign e + 1 to e, and determine whether e ≥ E holds. If it holds, calculate the fitness values of the individuals in the current population respectively, and select the individual with the smallest fitness value in the current population as the optimal individual; otherwise, reassign f = 0, g = 0, h = 0 and return to step S2.

[0060] Furthermore, the specific content of step S2 is as follows:

[0061] Step S2.1: For any individual in the current population, calculate the swimming step of the individual using the method of adaptive step size. The individual randomly selects a swimming direction by flipping and calculates the fitness value of the individual.

[0062] The method of calculating the swimming step of the individual using the method of adaptive step size is as follows:

[0063]

[0064] where C(α) represents the swimming step of individual α;

[0065] Step S2.2: The individual starts to swim along the selected swimming direction. The distance of each swim of the individual is the swimming step length of one individual. When the individual completes one swim, calculate the fitness value of the individual after this swim, compare whether the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim, and at the same time determine whether the number of swims of the individual is greater than the maximum number of swims Ns of the individual along the same direction during each tendency operation. If the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim or the number of swims of the individual is greater than Ns, then end the swim of the individual in the current swimming direction; otherwise, the individual continues to swim along the current swimming direction;

[0066] Step S2.3: The individual randomly selects a swimming direction by flipping and calculates the fitness value of the individual. If the fitness value of the individual after this flip is greater than the fitness value of the individual before this flip, then complete one tendency operation of the individual and update the individual position; otherwise, execute Step S2.2;

[0067] The method for updating the individual position is as follows:

[0068]

[0069] where θ α (f + 1, g, h) represents the individual position of individual α after f + 1 tendency operations, g replication operations, and h migration operations; θ α (f, g, h) represents the individual position of individual α after f tendency operations, g replication operations, and h migration operations; φ(f) represents the swimming direction selected by individual α; Δ(α) is a random vector, and Δ(α) ∈ [-1, 1];

[0070] Step S2.4: Repeat Steps S2.1 - S2.3 until all individuals in the current population have completed position update, and then obtain the population after f tendency operations, g replication operations, and h migration operations.

[0071] Furthermore, the method for calculating the fitness value of the individual is as follows: For any individual, obtain the individual position vector of the individual, use the conversion mechanism between the individual position vector and the scheduling scheme to convert the individual position vector of the individual into a flexible job shop scheduling scheme, and based on the makespan of this flexible job shop scheduling scheme, take the calculated makespan as the fitness value of the individual;

[0072] The conversion mechanism between the individual position vector and the scheduling scheme is as follows: For the part of the individual position vector that represents the machine selection scheme, it is divided into two parts: converting the individual position vector into the machine selection results of each process and converting the machine selection results of each process into the individual position vector;

[0073] The specific content of converting the individual position vector into the machine selection results of each process is as follows: for any process μ, obtain all available machines of process μ, construct the set of available machines of process μ, and number all available machines in this set of available machines. Calculate the machine selection results corresponding to each element in the individual position vector respectively, which is expressed as:

[0074]

[0075] where u(μ) represents the number of the machine selected by process μ in the set of available machines of process μ; round(·) represents the function of rounding to the nearest integer; Z(μ) represents the number of machines in the set of available machines of process μ;

[0076] The method of converting the machine selection results of each process into an individual position vector is as follows:

[0077]

[0078] When Z(μ) = 1, X(μ) takes any value in [-ε, ε];

[0079] For the part of the individual position vector of an individual used to represent the process arrangement plan, it is divided into two parts: converting the individual position vector into the arrangement order of processes and converting the arrangement order of processes into the individual position vector;

[0080] The specific content of converting the individual position vector into the arrangement order of processes is as follows: use the ascending order rule to assign a unique ROV value to each element in the individual position vector, map the ROV values of each element to the corresponding processes, and generate the arrangement order of processes according to the ROV values;

[0081] The specific content of converting the arrangement order of processes into the individual position vector is as follows: generate l random key values within the range of [-ε, ε] as the elements in the individual position vector, assign an ROV value to each element according to the ascending order of the random key values, rearrange the ROV values according to the process numbers in the current arrangement order, and then arrange the elements corresponding to each ROV value to generate the individual position vector.

[0082] Furthermore, the specific content of step S4 is as follows: calculate the health degrees of all individuals in the current population respectively, sort all individuals in the current population in descending order according to the health degrees of the individuals, adopt the elite retention strategy, and retain the top K individuals in the arrangement result as elite individuals according to the set elite individual ratio. Randomly assign the remaining individuals in the current population into two subgroups with the same size, calculate the sum of the health degrees of all individuals in each subgroup respectively and use it as the total health degree of the subgroup;

[0083] The calculation method of the health degree of the individual is as follows: For any individual in the current population, obtain the fitness value of the individual after each chemotaxis operation and sum them up. Take the sum of all fitness values of the individual as the health degree of the individual, which is expressed as:

[0084]

[0085] where is the health degree of individual α; J α (α, f, g, h) is the fitness value of individual α after f chemotaxis operations, g replication operations, and h migration operations;

[0086] Randomly exchange the individuals in the two subgroups to obtain two new subgroups and calculate the total health degrees of the two new subgroups respectively. Adopt the greedy selection strategy to retain the subgroup with the highest total health degree;

[0087] For the retained subgroup, sort the individuals in the subgroup in descending order according to their health degrees, and eliminate the individuals in the last W% of the sorting result according to a preset ratio; where K and W% need to satisfy the expression

[0088] Merge the individuals retained in the subgroup and the elite individuals and copy the merged individuals to obtain the population after f chemotaxis operations, g replication operations, and h migration operations.

[0089] The beneficial effects produced by adopting the above technical solutions are as follows:

[0090] The method of the present invention makes a series of improvements to the defects of the bacterial foraging algorithm such as easy premature convergence, and proposes an improved scheme for the entire process of the bacterial foraging algorithm, that is, an improved bacterial foraging algorithm. This algorithm realizes the conversion between continuous individual positions and discrete scheduling solutions through two-stage individual coding based on random keys. This algorithm designs and introduces a Logistic-Circle hybrid mapping to optimize the initial population to improve the quality of the initial population. This algorithm designs an adaptive dynamic step size to replace the fixed step size in the chemotaxis operation, while ensuring the optimization efficiency and accuracy of the algorithm. This algorithm improves the replication operation through the political optimization algorithm, ensuring the population diversity and avoiding the algorithm falling into premature convergence. This algorithm designs an adaptive migration probability in the migration operation to avoid the "escape" of elite individuals caused by the fixed probability. The method of the present invention improves the algorithm performance by improving the existing problems of the bacterial foraging algorithm.

[0091] The method of the present invention establishes an optimization model with the goal of minimizing the makespan and solves it using the improved bacterial foraging algorithm, so as to realize the optimization of the flexible job shop scheduling and shorten the production cycle of manufacturing enterprises.

[0092] The method of the present invention conducts simulation tests on a large number of numerical examples, compares with algorithms such as the bacterial foraging algorithm and the particle swarm algorithm, tests the performance of the improved algorithm, and verifies the effectiveness of the improved algorithm in shortening the production cycle in the flexible job shop scheduling problem. Brief Description of the Drawings

[0093] Figure 1 is a flowchart of a flexible job shop scheduling method based on an improved bacterial foraging algorithm in this embodiment;

[0094] Figure 2 is a flowchart of the improved bacterial foraging algorithm in this embodiment;

[0095] Figure 3 is an iteration curve graph when applying three algorithms, ABFOA - A, ABFOA - B, and BFOA, to solve the numerical example MK05 in this embodiment;

[0096] Figure 4 is an iteration curve graph when applying three algorithms, ABFOA - A, ABFOA - B, and BFOA, to solve the numerical example MK09 in this embodiment. Specific Embodiments

[0097] To facilitate the understanding of the present application, the specific embodiments of the present invention will be further described in detail below in conjunction with the drawings and embodiments. The following embodiments are used to illustrate the present invention but are not used to limit the scope of the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly and comprehensively understood.

[0098] In this embodiment, the flexible job shop scheduling problem is the core problem of the production process. Optimizing the flexible job shop scheduling can shorten the production cycle of manufacturing enterprises. To optimize the flexible job shop scheduling, the bacterial foraging algorithm is preferably selected, and a series of improvements are made to the bacterial foraging algorithm in view of the characteristics of this problem and the problems that the bacterial foraging algorithm cannot balance efficiency and accuracy, is prone to premature convergence, and the elite individuals are prone to "escape", and an improved bacterial foraging algorithm is proposed.

[0099] A flexible job shop scheduling method based on an improved bacterial foraging algorithm in this embodiment, as Figure 1 shown, this method includes the following processes:

[0100] Obtain the original data of the flexible job shop and construct an optimization model for the flexible job shop scheduling.

[0101] In this embodiment, the flexible job shop scheduling problem (FJSP) can be described as assigning m workpieces to n machines for processing in a certain flexible job shop. The processing of each workpiece requires multiple processes in a determined order. Each process has at least 1 and at most n available machines. The processing times of different machines are different. Each machine can only process one process at the same time. The purpose of scheduling is to determine the processing machines for each process and the processing order of each process on each machine to efficiently complete the production plan. The flexible job shop scheduling problem needs to meet the following assumptions: First, all workpieces and machines are ready at the initial moment, that is, they can start processing immediately; Second, at the same moment, the same workpiece can only be processed on one machine; Third, at the same moment, the same machine can only process one process; Fourth, the processing operations must be continuous and interruptions are not allowed; Fifth, all workpieces have the same processing priority; Sixth, the same workpiece needs to be processed in the order of processes, and there is no order constraint between the processes of different workpieces.

[0102] The original data of the flexible job shop includes: m workpieces, n machines, the number of processes of each workpiece, the available machines for each process, and the processing times of each process on each available machine.

[0103] The construction method of the flexible job shop scheduling optimization model is: define the objective function of the flexible job shop scheduling optimization, establish the constraint conditions of the flexible job shop scheduling optimization, and construct the flexible job shop scheduling optimization model based on the objective function of the flexible job shop scheduling optimization and the constraint conditions of the flexible job shop scheduling optimization.

[0104] The objective function of the flexible job shop scheduling optimization is to minimize the makespan.

[0105] In this embodiment, the makespan is the maximum time when all workpieces are completed, that is, the time when the last workpiece is completed in the scheduling process. By optimizing the makespan, the production cycle can be effectively shortened.

[0106] The constraint conditions of the flexible job shop scheduling optimization include:

[0107] Process uniqueness constraint: At the same moment, the same process can only be processed on one machine.

[0108] Machine constraint: At the same moment, only one process is allowed to be processed on the same machine, and the processes assigned to the same machine are processed in the predetermined processing order.

[0109] In this embodiment, the processes arranged on the machine need to be processed in sequence, that is, only one process is allowed to be processed on the same machine at the same time.

[0110] Processing time constraint: The processing time of each machine cannot exceed the total processing time of the machine.

[0111] In this embodiment, for any machine, the sum of the processing times of all processes assigned to the machine cannot exceed the total available processing time of the machine.

[0112] Process sequence constraint: All processes of the same workpiece are processed in the predetermined process sequence, and the start time of each process is not later than the completion time.

[0113] In this embodiment, there is a sequence between processes during the processing, and the start time of all processes is not later than their completion time.

[0114] Completion time constraint: The processing time of each workpiece does not exceed the maximum completion time.

[0115] Other constraints: Each process is not interrupted during processing, and the start time, processing time on the machine, and completion time of each process are non - negative, and the processing time of each machine is also non - negative.

[0116] The flexible job - shop scheduling optimization model is expressed as:

[0117] z = minT max (1)

[0118]

[0119] S iq +T iqj ≤S kp +R(1 - Y iqkpj ) (3)

[0120] E i(q-1) ≤S iq +R(1 - Y i(q-1)iqj ) (4)

[0121] T j ≤T n (5)

[0122] E i(q-1) ≤S iq (6)

[0123] S iq +T iqj ·X iqj ≤E iq (7)

[0124] T i ≤T max (8)

[0125] E iq -S iq =T iqj (9)

[0126] S iq ≥0, T iqj ≥0, E iq ≥0, T j ≥0 (10)

[0127] where z is the objective function representing the minimization of the makespan; T max represents the makespan; X iqj is a decision variable used to represent whether the q-th operation O i of workpiece M iq is processed on machine N j . If so, X iqj = 1; if not, X iqj = 0; i is the index value of the workpiece, and i = 1, 2, 3,..., m; j is the index value of the machine, and j = 1, 2, 3,..., n; S iq represents the start time of operation O iq ; T iqj represents the processing time of operation O iq on machine N j ; S kp represents the start time of operation O kp ; O kp represents the p-th operation of workpiece M k , where k = 1, 2, 3,..., m, and k ≠ i; R is a positive integer of infinity, Y iqkpj is a decision variable used to represent whether operation O j on machine N iq is processed before operation O kp . If so, Y iqkpj = 1; if not, Y iqkpj = 0; E i(q-1) represents the completion time of operation O i(q-1) ; Y i(q-1)iqj is a decision variable used to represent whether operation O j on machine N i(q-1) is processed before operation O iq . If so, Y i(q-1)iqj = 1; if not, Y i(q-1)iqj = 0; T j represents the processing time of machine N j ; T n represents the total processing time of the machine; E iqDenote the completion time of process O iq ; T i Denote the completion time of workpiece M i .

[0128] In this embodiment, Formula (3) and Formula (4) represent the machine constraints in the processing, that is, only one process is allowed to be processed on a certain machine at the same time, and there is a processing order for the processes on the machine. Formula (5) represents that the processing time of each machine cannot exceed the total processing time of the machine. Formulas (6) and (7) represent that there is a sequential order for the processes in the processing, and the start time of all processes cannot be greater than their completion time. Formula (8) represents that the processing time of each workpiece cannot exceed the maximum completion time. Formula (9) represents that the processing process cannot be interrupted, that is, the difference between the completion time and the start time is equal to the fixed processing time; Formula (10) represents the non - negative constraint. When S iq ≥0, T iqj ≥0, E iq ≥0, T j ≥0, it can be proved that all times are non - negative.

[0129] Based on the flexible job - shop scheduling optimization model, regard a flexible job - shop scheduling scheme as an individual, initialize the parameters of the bacterial foraging algorithm, and generate the initial population by using the Logistic - Circle hybrid mapping.

[0130] The specific content of the initialization of the bacterial foraging algorithm parameters is as follows: Define the population size S, the maximum number of iterations E, the maximum number of chemotaxis operations Nc, the maximum number of times an individual swims in the same direction during each chemotaxis operation Ns, the fixed step size C0(α) of each individual's swim, the maximum number of reproduction operations Nre, the maximum number of elimination - dispersal operations Ned, and the elimination - dispersal probability Ped; where α represents the index value of the individual.

[0131] The specific content of generating the initial population by using the Logistic - Circle hybrid mapping is as follows: Based on the set population size S, select an initial iteration value x0 within the defined iteration range, and generate a chaotic sequence by using the Logistic - Circle hybrid mapping iteration formula.

[0132] In this embodiment, the initial population of the bacterial foraging algorithm is usually randomly generated. However, the quality of the generated population cannot be guaranteed, which affects the optimization accuracy of the algorithm. Therefore, the Circle mapping is introduced into the process of population initialization to improve the quality of the initial population. The Circle mapping is a chaotic mapping based on circular motion, with good ergodicity and stability. However, since the initial population output by the Circle mapping is relatively regular and the population diversity is low, this embodiment proposes to perturb the control parameter b in the Circle mapping using the Logistic mapping with strong randomness. The Logistic mapping is one of the commonly used chaotic mappings. By designing and introducing the Logistic-Circle hybrid mapping, the diversity of the initial population is enhanced to avoid premature convergence of the algorithm.

[0133] The iteration formula of the Logistic-Circle hybrid mapping is expressed as:

[0134]

[0135] where x c+1 represents the iteration value of the (c + 1)-th iteration of the chaotic mapping; mod represents the modulo function operation; x c represents the iteration value of the c-th iteration of the chaotic mapping; a and b are control parameters, usually taking values of 0.5 and 0.2, and there is:

[0136]

[0137] where b0 represents the initial value of the control parameter b, taking a value of 0.2; represents the output of the Logistic mapping, and there is:

[0138]

[0139] where r represents the control parameter of the Logistic mapping, and when the control parameter r takes a value of 4, the dynamic process of the chaotic system, i.e., the Logistic mapping, is in a completely chaotic state.

[0140] The chaotic sequence is used as the initial population. Meanwhile, the positions of each individual in the initial population are generated, and the positions of the individuals are stored in the form of individual position vectors.

[0141] The individual position vector is a two-segment encoding with a length of 2l, denoted as X. Among them, the first l elements in the individual position vector X are the first segment of the encoding, which is used to represent the machine selection scheme in the flexible job shop scheduling plan; the last l elements in the individual position vector X are the second segment of the encoding, which is used to represent the operation arrangement scheme in the flexible job shop scheduling plan.

[0142] In this embodiment, the flexible job shop scheduling problem actually includes two sub - problems, namely operation sequencing and machine selection. Therefore, the individual position vector adopts a two - segment encoding with equal lengths before and after. The lengths of each segment are equal and correspond to the machine selection scheme and the operation sequencing scheme respectively. Machine selection refers to the processing machine selected for each operation, and operation sequencing refers to determining the order of each operation processed by each machine.

[0143] The individual position vector is represented as X = {X(1),..., X(l), X(l + 1),..., X(2l)}, where l represents the total number of operations of all workpieces in the individual; X(1) represents the first element in the individual position vector; X(l) represents the l - th element in the individual position vector; X(l + 1) represents the (l + 1) - th element in the individual position vector; X(2l) represents the 2l - th element in the individual position vector; and each element in the individual position vector is a random key value within the range [-ε, ε], where ε is the number of workpieces in the individual.

[0144] For any operation μ in the individual, the element X(μ) in the individual position vector is used to determine the machine assigned to operation μ, and the element X(μ + l) in the individual position vector is used to determine the execution order of operation μ.

[0145] In this embodiment, the numbers are usually assigned in the order of workpieces and operations. For example, taking three workpieces with two operations per workpiece as an example, in the corresponding individual, the operation numbers of the first workpiece are 1 and 2, the operation numbers of the second workpiece are 3 and 4, and the operation numbers of the third workpiece are 5 and 6. The individual position vector of the individual is denoted as X = {X(1),..., X(6), X(7),..., X(12)}.

[0146] The improved bacterial foraging algorithm is used to optimize the initial population to obtain the optimal individual.

[0147] The improved bacterial foraging algorithm is as follows: In the chemotaxis operation of the bacterial foraging algorithm, an adaptive dynamic step size is designed to replace the fixed step size to improve the optimization efficiency and accuracy; the political optimization algorithm PO is used to improve the reproduction operation to ensure the diversity of the population; in the elimination - dispersal operation, an adaptive elimination - dispersal probability is designed to replace the fixed elimination - dispersal probability to avoid the escape of elite individuals during the population optimization process.

[0148] In this embodiment, the bacterial foraging optimization algorithm (BFOA), proposed by Professor Passino, is a bio - inspired swarm intelligence optimization algorithm. The bacterial foraging algorithm is based on the foraging behavior of Escherichia coli and realizes optimization by simulating the chemotaxis operation, reproduction operation, and elimination - dispersal operation in the bacterial foraging process. Among them, as Figure 2As shown, the chemotaxis operation simulates the movement behavior composed of the flipping and swimming of individuals, the reproduction operation simulates the survival-of-the-fittest and reproduction behavior of individuals, and the migration operation simulates the migration of individuals caused by environmental mutations and other situations. The bacterial foraging algorithm has the advantages of being simple and easy to implement, parallel search, and strong robustness, but it still has the disadvantages of being unable to balance efficiency and accuracy, and being prone to premature convergence. Therefore, in this embodiment, the problems existing in the bacterial foraging algorithm are improved. For the problem of low quality of the initial solution, a Logistic-Circle hybrid mapping is designed and introduced; for the problem of being unable to balance efficiency and accuracy at the same time, an adaptive dynamic step size is designed and introduced; for the problem of being prone to premature convergence, the reproduction operation is improved by combining the political optimization algorithm; for the problem of elite individuals being prone to "escape", an adaptive migration probability is designed and introduced.

[0149] The specific content of optimizing the initial population using the improved bacterial foraging algorithm to obtain the optimal individual is as follows:

[0150] Step S1: Define the current iteration round as e, the number of chemotaxis operations in the current iteration round as f, the number of reproduction operations as g, and the number of migration operations as h, and initialize f = 0, g = 0, and h = 0, and start the first iteration optimization of the initial population.

[0151] Step S2: Traverse all individuals in the current population, perform a chemotaxis operation on each individual, and obtain the population after f chemotaxis operations, g reproduction operations, and h migration operations.

[0152] Step S2.1: For any individual in the current population, calculate the swimming step size of the individual using the method of adaptive step size. The individual randomly selects a swimming direction by flipping, and calculates the fitness value of the individual.

[0153] In this embodiment, in the chemotaxis operation, the individual determines the swimming direction by flipping. If swimming in this direction will result in a better value, the individual will swim in this direction. When the maximum swimming step number is reached or the fitness value starts to decrease, the individual will flip again according to the fitness and re-determine the swimming direction. In the bacterial foraging algorithm, the swimming step size uses a fixed value, but the fixed step size will lead to a decrease in the convergence speed of the algorithm or falling into a local extreme value. Therefore, in this embodiment, an adaptive dynamic step size is designed in the chemotaxis operation to achieve the purpose of using a larger step size in the early stage of the algorithm to accelerate the convergence speed, using a smaller step size in the later stage of the algorithm to improve the solution accuracy, and at the same time ensuring the optimization efficiency and accuracy of the algorithm. The cosine function decreases in the interval (0, π), and the slope change law fits the requirements of the chemotaxis operation step size. Therefore, the cosine function is introduced into the calculation of the adaptive dynamic step size.

[0154] The method of calculating the swimming step size of the individual using the method of adaptive step size is as follows:

[0155]

[0156] Among them, C(α) represents the moving step size of individual α.

[0157] The calculation method of the fitness value of the individual is as follows: for any individual, obtain the individual position vector of the individual, use the conversion mechanism between the individual position vector and the scheduling scheme to convert the individual position vector of the individual into a flexible job shop scheduling scheme, and take the calculated makespan as the fitness value of the individual according to the makespan of the flexible job shop scheduling scheme.

[0158] In this embodiment, in order to establish the mapping between the continuous individual positions and the discrete scheduling solutions, encoding and conversion are required when applying the bacterial foraging algorithm to solve the flexible job shop scheduling problem, and different conversion mechanisms are adopted in the process arrangement and machine selection parts respectively to realize the conversion between the algorithm solution space and the problem space.

[0159] The conversion mechanism between the individual position vector and the scheduling scheme is as follows: for the part of the individual position vector of the individual that represents the machine selection scheme, it is divided into two parts: converting the individual position vector into the machine selection results of each process and converting the machine selection results of each process into the individual position vector.

[0160] The specific content of converting the individual position vector into the machine selection results of each process is as follows: for any process μ, obtain all available machines of process μ, construct the set of available machines of process μ, and number all available machines in the set of available machines of process μ. Calculate the machine selection results corresponding to each element in the individual position vector respectively, which is expressed as:

[0161]

[0162] where u(μ) represents the number of the machine selected by process μ in the set of available machines of process μ; round(·) represents the function of rounding to the nearest integer; Z(μ) represents the number of machines in the set of available machines of process μ.

[0163] The method of converting the machine selection results of each process into the individual position vector is as follows:

[0164]

[0165] When Z(μ) = 1, X(μ) takes any value in [-ε, ε].

[0166] For the part of the individual position vector of the individual that represents the process arrangement scheme, it is divided into two parts: converting the individual position vector into the arrangement order of the processes and converting the arrangement order of the processes into the individual position vector.

[0167] The specific content of converting the individual position vector into the arrangement order of processes is as follows: The ranked order value (ROV) rule is used to assign a unique ROV value to each element in the individual position vector, map the ROV values of the elements to the corresponding processes, and generate the arrangement order of the processes according to the ROV values.

[0168] In this embodiment, the values of the elements in the individual position vector are sorted in ascending order, and a unique ROV value is assigned to each element according to the sorting result, that is, the first element after sorting is assigned the ROV value 1, the second element is assigned the ROV value 2, and so on until the last element.

[0169] The specific content of converting the arrangement order of processes into the individual position vector is as follows: l random key values are generated within the range of [-ε, ε] as the elements in the individual position vector, a ROV value is assigned to each element according to the ascending order of the random key values, and the ROV values are rearranged according to the process numbers in the current arrangement order, and then the elements corresponding to the ROV values are arranged to generate the individual position vector.

[0170] Step S2.2: The individual starts to swim along the selected swimming direction. The distance of each swim of the individual is the swimming step length of one individual. When the individual completes one swim, calculate the fitness value of the individual after this swim, compare whether the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim, and at the same time judge whether the number of swims of the individual is greater than the maximum number of swims Ns of the individual along the same direction during each tendency operation. If the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim or the number of swims of the individual is greater than Ns, then end the swim of the individual in the current swimming direction; otherwise, the individual continues to swim along the current swimming direction.

[0171] Step S2.3: The individual randomly selects a swimming direction by flipping and calculates the fitness value of the individual. If the fitness value of the individual after this flip is greater than the fitness value of the individual before this flip, then complete one tendency operation of the individual and update the individual position; otherwise, execute Step S2.2.

[0172] The method for updating the individual position is as follows:

[0173]

[0174] where θ α (f + 1, g, h) represents the individual position of individual α after f + 1 tendency operations, g replication operations, and h migration operations; θ α(f, g, h) represents the position of individual α after f chemotactic operations, g replication operations, and h migration operations; φ(f) represents the swimming direction selected by individual α; Δ(α) is a random vector, and Δ(α) ∈ [-1, 1].

[0175] Step S2.4: Repeat steps S2.1 - S2.3 until all individuals in the current population have completed position update, then obtain the population after f chemotactic operations, g replication operations, and h migration operations.

[0176] Step S3: Assign f + 1 to f, and determine whether f ≥ Nc holds. If it holds, execute step S4; otherwise, return to step S2.

[0177] Step S4: Perform a replication operation on the current population to obtain the population after f chemotactic operations, g replication operations, and h migration operations.

[0178] In this embodiment, during the replication operation, individuals with lower health are eliminated, and the remaining individuals split into two identical individuals at the same position, so as to replace the inferior half of the individuals with the superior half, thereby accelerating the convergence speed. However, such an operation will reduce the population diversity and lead to premature convergence of the algorithm. To ensure the population diversity, the idea of "party switching" in the Political optimizer (Po) is introduced to improve the replication operation.

[0179] The specific content of step S4 is as follows: Calculate the health of all individuals in the current population respectively, sort all individuals in the current population in descending order according to the health of the individuals, adopt the elitist retention strategy, and retain the first K individuals in the sorting result as elite individuals according to the set elite individual ratio. Randomly divide the remaining individuals in the current population into two subgroups with the same size, and sum the health of all individuals in each subgroup as the total health of the subgroup.

[0180] The calculation method of the health of the individual is as follows: For any individual in the current population, obtain the fitness value of the individual after each chemotactic operation and sum them up, and take the sum of all fitness values of the individual as the health of the individual, which is expressed as:

[0181]

[0182] where is the health of individual α; J α (α, f, g, h) is the fitness value of individual α after f chemotactic operations, g replication operations, and h migration operations.

[0183] Randomly exchange the individuals in the two subgroups to obtain two new subgroups, and calculate the total health of the two new subgroups respectively. Then, use the greedy selection strategy to retain the subgroup with the highest total health.

[0184] For the retained subgroup, sort the individuals in the subgroup in descending order of health, and eliminate the last W% of the individuals in the sorted result according to a preset ratio; where K and W% need to satisfy the expression

[0185] Merge the retained individuals in the subgroup and the elite individuals, and copy the merged individuals to obtain the population after f tendency operations, g replication operations, and h migration operations.

[0186] In this embodiment, first, count the health of the individuals in the current population and sort them in descending order; second, adopt the elite retention strategy to retain the top 20% of the elite individuals in terms of health, and randomly assign the remaining 80% of the individuals to form two subgroups of the same size, and calculate the total health of each subgroup. It should be noted that the number of elite individuals is not fixed at 20%. In this embodiment, it is considered that taking 20% is relatively optimal under the condition of satisfying Then, the members in the two subgroups are randomly exchanged, that is, the exchange ratio is randomly determined, and the exchanged individuals are also random, so as to form two new subgroups and calculate the total health of each new subgroup respectively. Use the greedy selection strategy to retain the subgroup with the highest total health; finally, perform elimination between subgroups, eliminate the individuals with the lowest 25% health in the retained subgroup, and copy the 50% individuals retained after this operation.

[0187] Step S5: Assign g + 1 to g, and determine whether g ≥ Nre holds. If it holds, execute Step S6; if not, reassign f = 0 and return to Step S2.

[0188] Step S6: Perform a migration operation on the current population to obtain the population after f tendency operations, g replication operations, and h migration operations.

[0189] In the migration operation, the migration event occurs with a fixed probability. When migration occurs, some individuals will suddenly disappear, and then the same number of new individuals will be randomly generated in the search space. The migration operation is beneficial for the algorithm to jump out of the local optimum, but the fixed migration probability is likely to cause high-quality individuals to disappear and the "escape" phenomenon, reducing the algorithm accuracy. Therefore, in this embodiment, an adaptive migration probability is proposed to reduce the migration probability of better individuals, so as to retain the sub-optimal solutions in the optimization process.

[0190] The specific content of step S6 is as follows: count the health of each individual in the current population, sort the individuals in the current population in descending order according to their health, calculate the adaptive migration probability of each individual according to the sorting result, and perform a migration operation on each individual according to its adaptive migration probability. Generate a population after f trend operations, g replication operations, and h migration operations using the migrated individuals.

[0191] The calculation method of the adaptive migration probability is as follows:

[0192]

[0193] where Ped(α) is the adaptive migration probability of individual α; is the highest health value in the sorting result; is the lowest health value in the sorting result; is the health of individual α, and the larger it is, the smaller the adaptive migration probability of the individual.

[0194] Step S7: Assign h + 1 to h, determine whether h ≥ Ned holds. If it holds, execute step S8; otherwise, reassign f = 0, g = 0 and return to step S2.

[0195] Step S8: Assign e + 1 to e, determine whether e ≥ E holds. If it holds, calculate the fitness values of the individuals in the current population respectively, and select the individual with the smallest fitness value as the optimal individual; otherwise, reassign f = 0, g = 0, h = 0 and return to step S2.

[0196] Obtain the individual position vector of the optimal individual, and use the conversion mechanism between the individual position vector and the scheduling scheme to convert the individual position vector of the optimal individual into the optimal flexible job shop scheduling scheme.

[0197] In this embodiment, three initialization schemes, namely random initialization, Circle mapping initialization, and Logistic-Circle hybrid mapping initialization, are tested. The hardware used for the test is a computer with 16GB of RAM and a processor of 11th Gen Intel(R) Core(TM) i5-11320H@3.20GHz 3.19GHz under the Win11 system; the software used for the test is MATLAB R2021a. The algorithm parameters are set as follows: the population size S is 100, the maximum number of iterations is 400, the number of chemotaxis operations Nc is 25, the maximum number of times Ns that bacteria individuals swim in the same direction during each chemotaxis operation is 4, the unit step size C0(α) for one swim is 0.1, the number of reproduction operations Nre is 4, the number of migration operations Ned is 4, and the migration probability Ped is 0.6. The test cases use Brandimarte test cases MK01, MK07, and MK10. The results obtained after running each case independently 10 times are shown in Table 1. In Table 1, m×n is the problem size, BEST is the optimal objective value obtained after running 10 times, and AVG is the average value of the objective values obtained after running 10 times.

[0198] Table 1 Comparison of Test Results of Initialization Schemes

[0199]

[0200] As can be seen from Table 1, overall, the optimal BEST and average AVG of the three test cases solved using chaotic mapping initialization are both smaller than those solved using random initialization, indicating that chaotic mapping initialization is superior to random initialization; for the smaller-scale test case MK01 solved using Circle mapping initialization, the BEST and AVG are 68 and 74.9 respectively, which are both higher than the BEST of 65 and AVG of 70.1 of test case MK01 solved using random initialization, indicating that the performance of Circle mapping initialization for solving small-scale problems is poor; the Logistic-Circle hybrid mapping initialization obtained the optimal values of BEST and AVG for 3 test cases, indicating that the Logistic-Circle hybrid mapping proposed in this embodiment has good global search ability and is applicable to problems of various scales. Therefore, the Logistic-Circle hybrid mapping initialization method is more effective.

[0201] To test whether the adaptive dynamic step size proposed in this embodiment is effective, the bacterial foraging algorithm with different adaptive dynamic step sizes is applied to solve the Brandimarte cases MK05, MK06, and MK09, and compared with the bacterial foraging algorithm BFOA without applying the adaptive dynamic step size. The software and hardware conditions and algorithm parameter settings used in the test are the same as those in the above test. The two bacterial foraging algorithms with different adaptive step sizes are respectively called ABFOA-A and ABFOA-B. Among them, ABFOA-B introduces the adaptive dynamic step size proposed in this embodiment, and ABFOA-A introduces the adaptive dynamic step size proposed in "Stereoscopic Warehouse Location Optimization Based on Adaptive Bacterial Foraging Algorithm", and its formula is:

[0202]

[0203] where λ is the control coefficient. After experimental testing, the optimal accuracy is obtained when λ takes the value of 13. Therefore, λ takes the value of 13 in this test.

[0204] The results obtained after independently running 10 times for each case using three bacterial foraging algorithms are shown in Table 2. In Table 2, m×n is the problem scale, TIME is the average value of the running time obtained after running this case 10 times, and ZAVG is the average value of the objective value obtained after running this case 10 times.

[0205] Table 2 Comparison of Test Results of Adaptive Step Size

[0206]

[0207] As can be seen from Table 2, the TIME values of ABFOA-A are the smallest and the ZAVG values are the highest under the three cases, indicating that the adaptive dynamic step size proposed in "Stereoscopic Warehouse Location Optimization Based on Adaptive Bacterial Foraging Algorithm" can improve the optimization efficiency but cannot guarantee the solution accuracy; the TIME value of ABFOA-B is higher than that of ABFOA-A but still lower than that of BFOA under the three cases, and the ZAVG value of ABFOA-B is smaller than the ZAVG values of ABFOA-A and BFOA, indicating that the adaptive dynamic step size proposed in this embodiment can balance the optimization efficiency and accuracy.

[0208] Examples of the iteration curves obtained by applying three bacterial foraging algorithms to solve MK05 and MK09 respectively are shown in Figure 3 and Figure 4 as shown. In Figure 3 and Figure 4 the triangular line is the iteration curve of ABFOA-A; the star line is the iteration curve of ABFOA-B; the circular line is the iteration curve of BFOA. From Figure 3 and Figure 4It can be seen that ABFOA-A is prone to premature convergence and has a low solution accuracy, while ABFOA-B is not prone to premature convergence and has a higher solution accuracy. Therefore, introducing the adaptive dynamic step size proposed in this embodiment can further improve the performance of the bacterial foraging algorithm.

[0209] To further verify the effectiveness of the improved bacterial foraging algorithm proposed in this embodiment, the examples MK01 to MK10 in Brandimarte are solved, and compared with the particle swarm algorithm, fruit fly algorithm, bacterial foraging algorithm, and the adaptive bacterial foraging algorithm proposed in "Stereoscopic Warehouse Location Optimization Based on Adaptive Bacterial Foraging Algorithm". The software and hardware conditions used in the test are the same as those set for the random initialization test. The example data is shown in Table 3.

[0210] Table 3 Example Data

[0211]

[0212] In Table 3, Nop represents the range of the number of processes of each workpiece in the example. For example, [5,7] in the fourth column of the second row means that the number of processes of each workpiece in example MK01 is in the range of [5,7]; Proc represents the range of the processing duration of each process in the example. For example, [1,7] in the fifth column of the second row means that the processing duration of each process in example MK01 is in the range of [1,7].

[0213] In the test, the main parameters of the fruit fly algorithm are set as follows: the population size is 100, and the maximum number of iterations is 400; the main parameters of the particle swarm algorithm are set as follows: the population size is 100, the maximum number of iterations is 400, c1 and c2 are 1.5, w is 0.7, and V max is 1.5; the parameter settings of the three bacterial foraging algorithms are the same as those set for the random initialization test.

[0214] The results obtained after independently running the examples MK01 to MK10 10 times each are shown in Table 4. In Table 4, PSO is the particle swarm algorithm; FOA is the fruit fly algorithm; BFOA is the bacterial foraging algorithm; ABFOA is the adaptive bacterial foraging algorithm proposed in "Stereoscopic Warehouse Location Optimization Based on Adaptive Bacterial Foraging Algorithm"; IBFOA is the improved bacterial foraging algorithm proposed in this embodiment; m×n is the problem scale; BEST is the optimal objective value obtained after running 10 times, that is, the optimal value of the production cycle; AVG is the average value of the objective values obtained after running 10 times, that is, the average value of the production cycle; MEAN represents the average value of the RPD of this algorithm under 10 examples. The smaller the MEAN value, the better the solution performance of the algorithm; RPD is the relative percentage deviation, calculated as follows:

[0215]

[0216] Among them, MIN represents the minimum value of the BEST value in this example.

[0217] Table 4 Comparison of operation results

[0218]

[0219]

[0220] As can be seen from Table 4, compared with the particle swarm optimization algorithm and the fruit fly algorithm, the bacterial foraging algorithm obtains better values of BEST and AVG in 7 out of 10 examples except MK01, MK03, and MK09. Moreover, the MEAN value of the bacterial foraging algorithm is 9.746, which is less than 10.181 of the particle swarm optimization algorithm and 29.227 of the fruit fly algorithm. Therefore, the bacterial foraging algorithm has better performance. The improved bacterial foraging algorithm proposed in this embodiment is superior to the bacterial foraging algorithm and the adaptive bacterial foraging algorithm proposed in "Stereoscopic Warehouse Location Optimization Based on Adaptive Bacterial Foraging Algorithm" in terms of all values in the solution of 10 examples. At the same time, it obtains the optimal values of BEST and AVG in 9 out of 10 examples except MK01. Moreover, the MEAN value of the improved bacterial foraging algorithm proposed in this embodiment is 0.577, which is significantly less than other algorithms. Therefore, the improved bacterial foraging algorithm proposed in this embodiment has certain superiority. The improved bacterial foraging algorithm can optimize the flexible job shop scheduling and shorten the production cycle. For example, compared with the bacterial foraging algorithm, the AVG value of example MK01 solved by the improved bacterial foraging algorithm is 57.9, which is about 17.404% shorter than the AVG value of 70.1 of example MK01 solved by the bacterial foraging algorithm. Compared with the bacterial foraging algorithm, the AVG values of the 10 examples solved by the improved bacterial foraging algorithm are reduced by about 7.763% on average, that is, the average production cycle is shortened by about 7.763% on average. Therefore, the proposed improved bacterial foraging algorithm is effective in optimizing the flexible job shop scheduling.

[0221] To sum up, the effectiveness of the proposed improved mechanism is proved by testing the Logistic-Circle hybrid mapping initialization and the adaptive dynamic step size proposed in this embodiment. Through the example simulation test, the MEAN value of the proposed improved bacterial foraging algorithm in the simulation results is 0.577, which is significantly less than other algorithms, proving the superiority of the improved algorithm. The production cycle of the 10 examples solved by the improved bacterial foraging algorithm is shortened by about 7.763% on average compared with the bacterial foraging algorithm, proving that the improved bacterial foraging algorithm is effective in optimizing the flexible job shop scheduling and shortening the production cycle.

[0222] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A flexible job shop scheduling method based on an improved bacterial foraging algorithm, characterized in that, The method includes the following steps: Obtain the original data of the flexible job shop and construct an optimization model for flexible job shop scheduling; Based on the optimization model for flexible job shop scheduling, regard a flexible job shop scheduling scheme as an individual, initialize the parameters of the bacterial foraging algorithm, and generate an initial population using the Logistic-Circle hybrid mapping; Optimize the initial population using the improved bacterial foraging algorithm to obtain the optimal individual; The improved bacterial foraging algorithm is as follows: in the chemotaxis operation of the bacterial foraging algorithm, design an adaptive dynamic step size to replace the fixed step size to improve the optimization efficiency and accuracy; use the political optimization algorithm PO to improve the reproduction operation to ensure the diversity of the population; in the elimination-dispersal operation, design an adaptive elimination-dispersal probability to replace the fixed elimination-dispersal probability to avoid the escape of elite individuals during the population optimization process; Obtain the individual position vector of the optimal individual, and use the conversion mechanism between the individual position vector and the scheduling scheme to convert the individual position vector of the optimal individual into the optimal flexible job shop scheduling scheme.

2. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 1, characterized in that The specific content of obtaining the original data of the flexible job shop and constructing an optimization model for flexible job shop scheduling is as follows: Obtain the original data of the flexible job shop, including: m workpieces, n machines, the number of processes of each workpiece, the optional machines for each process, and the processing time of each process on each optional machine; Define the objective function for flexible job shop scheduling optimization, establish the constraint conditions for flexible job shop scheduling optimization, and construct an optimization model for flexible job shop scheduling based on the objective function and constraint conditions for flexible job shop scheduling optimization; The objective function for flexible job shop scheduling optimization is to minimize the makespan; The constraint conditions for flexible job shop scheduling optimization include: Operation uniqueness constraint: At the same time, the same operation can only be processed on one machine; Machine constraint: At the same time, only one operation is allowed to be processed on the same machine; Processing time constraint: The processing time of each machine cannot exceed the total processing time of the machine; Operation sequence constraint: All operations of the same workpiece are processed in the predetermined operation sequence, and the start time of each operation is not later than the completion time; Completion time constraint: The processing time of each workpiece does not exceed the makespan; Other constraints: Each operation is not interrupted during the processing, and the start time, processing time on the machine, and completion time of each operation are non-negative, and the processing time of each machine is also non-negative.

3. The flexible job shop scheduling method based on the improved bacterial foraging algorithm according to claim 2, characterized in that The optimization model for flexible job shop scheduling is expressed as: z = minT max S iq +T iqj ≤S kp +R(1 - Y iqkpj ) E i(q-1) ≤S iq +R(1 - Y i(q-1)iqj ) T j ≤T n E i(q-1) ≤S iq S iq +T iqj ·X iqj ≤E iq T i ≤T max E iq -S iq = T iqj S iq ≥0, T iqj ≥0, E iq ≥0, T j ≥0 where z represents the objective function for minimizing the makespan; T max represents the makespan; X iqj is a decision variable used to represent whether the q-th operation O i of workpiece M iq is processed on machine N j . If so, X iqj = 1; if not, X iqj = 0; i is the index value of the workpiece, and i = 1, 2, 3,..., m; j is the index value of the machine, and j = 1, 2, 3,..., n; S iq represents the start time of operation O iq ; T iqj represents the processing time of operation O iq on machine N j ; S kp represents the start time of operation O kp ; O kp represents the p-th operation of workpiece M k , where k = 1, 2, 3,..., m, and k ≠ i; R is a positive integer of infinity, Y iqkpj is a decision variable used to represent whether the operation O j on machine N iq is processed before operation O kp . If so, Y iqkpj = 1; if not, Y iqkpj = 0; E i(q-1) represents the completion time of operation O i(q-1) ; Y i(q-1)iqj is a decision variable used to represent whether the operation O j on machine N i(q-1) is processed before operation O iq . If so, Y i(q-1)iqj = 1; if not, Y i(q-1)iqj = 0; T j represents the processing time of machine N j ; T n represents the total processing time of the machine; E iq represents the completion time of operation O iq ; T i represents the completion time of workpiece M i .

4. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 3, characterized in that The specific content of initializing the parameters of the bacterial foraging algorithm is as follows: Define the population size S, the maximum number of iterations E, the maximum number of chemotaxis operations Nc, the maximum number of times an individual swims in the same direction during each chemotaxis operation Ns, the fixed step size C0(α) for each individual's swim, the maximum number of reproduction operations Nre, the maximum number of elimination-dispersal operations Ned, and the elimination-dispersal probability Ped; where α represents the index value of the individual.

5. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 4, characterized in that The specific content of generating the initial population using the Logistic-Circle hybrid mapping is as follows: Based on the set population size S, an initial iteration value x0 is selected within the defined iteration range, and a chaotic sequence is generated using the Logistic-Circle hybrid mapping iteration formula. The Logistic-Circle hybrid mapping iteration formula is expressed as: where x c+1 represents the iteration value of the (c + 1)-th iteration of the chaotic map; mod represents the modulo function operation; x c represents the iteration value of the c-th iteration of the chaotic map; a and b are control parameters, and there are: where b0 represents the initial value of the control parameter b; represents the output of the Logistic map, and there is: where r represents the control parameter of the Logistic mapping. The chaotic sequence is used as the initial population. Meanwhile, the positions of each individual in the initial population are generated, and the positions of the individuals are stored in the form of individual position vectors.

6. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 5, characterized in that The individual position vector is a two-segment encoding with a length of 2l, denoted as X. Among them, the first l elements in the individual position vector X are the first segment of the encoding, which is used to represent the machine selection scheme in the flexible job shop scheduling plan; the last l elements in the individual position vector X are the second segment of the encoding, which is used to represent the operation arrangement scheme in the flexible job shop scheduling plan; each element in the individual position vector is a random key value within the range [-ε, ε], and ε is the number of workpieces in the individual. For any operation μ in the individual, the element X(μ) in the individual position vector is used to determine the machine to which the operation μ is assigned, and the element X(μ + l) in the individual position vector is used to determine the execution order of the operation μ.

7. The flexible job shop scheduling method based on the improved bacterial foraging algorithm according to claim 6, characterized in that, The specific content of optimizing the initial population using the improved bacterial foraging algorithm to obtain the optimal individual is as follows: Step S1: Define the current iteration round as e, the number of chemotaxis operations in the current iteration round as f, the number of reproduction operations as g, and the number of elimination-dispersal operations as h. Initialize f = 0, g = 0, and h = 0, and start the first iteration optimization of the initial population. Step S2: Traverse all individuals in the current population, perform one chemotaxis operation on each individual, and obtain the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations. Step S3: Assign f + 1 to f, and determine whether f ≥ Nc holds. If it holds, execute Step S4; otherwise, return to Step S2. Step S4: Perform one reproduction operation on the current population to obtain the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations. Step S5: Assign g + 1 to g, and determine whether g ≥ Nre holds. If it holds, execute Step S6; otherwise, reassign f = 0 and return to Step S2. Step S6: Perform one elimination-dispersal operation on the current population to obtain the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations. The specific content of Step S6 is as follows: Statistically calculate the health of each individual in the current population, arrange the individuals in the current population in descending order according to their health, calculate the adaptive elimination-dispersal probability for each individual according to the sorting result, and perform one elimination-dispersal operation on each individual according to its adaptive elimination-dispersal probability. Use the individuals after elimination-dispersal to generate the population after f chemotaxis operations, g reproduction operations, and h elimination-dispersal operations. The calculation method of the adaptive elimination-dispersal probability is: Among them, Ped(α) is the adaptive migration probability of individual α; is the highest health value in the sorting result; is the lowest health value in the sorting result; is the health of individual α; Step S7: Assign h + 1 to h, and determine whether h ≥ Ned holds. If it holds, execute Step S8; otherwise, re-assign f = 0, g = 0 and return to Step S2; Step S8: Assign e + 1 to e, and determine whether e ≥ E holds. If it holds, calculate the fitness values of the individuals in the current population respectively, and select the individual with the smallest fitness value in the current population as the optimal individual; otherwise, re-assign f = 0, g = 0, h = 0 and return to Step S2.

8. The flexible job shop scheduling method based on the improved bacterial foraging algorithm according to claim 7, wherein The specific content of the said Step S2 is as follows: Step S2.1: For any individual in the current population, calculate the individual's swimming step size by using the method of adaptive step size. The individual randomly selects a swimming direction by flipping, and calculates the fitness value of the individual; The method of calculating the individual's swimming step size by using the method of adaptive step size is as follows: where C(α) represents the swimming step size of individual α; Step S2.2: The individual starts to swim along the selected swimming direction. The distance of each swim of the individual is one individual's swimming step size. When the individual completes each swim, calculate the fitness value of the individual after this swim, and compare whether the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim. At the same time, determine whether the number of swims of the individual is greater than the maximum number of swims Ns that the individual swims along the same direction during each tendency operation. If the fitness value of the individual after this swim is greater than the fitness value of the individual before this swim or the number of swims of the individual is greater than Ns, end the swim of the individual in the current swimming direction; otherwise, the individual continues to swim along the current swimming direction; Step S2.3: The individual randomly selects a swimming direction by flipping and calculates the fitness value of the individual. If the fitness value of the individual after this flip is greater than the fitness value of the individual before this flip, complete one tendency operation of the individual and update the individual's position; otherwise, execute Step S2.2; The method of updating the individual's position is as follows: where θ α (f + 1, g, h) represents the individual position of individual α after performing f + 1 tendency operations, g replication operations, and h migration operations; θ α (f, g, h) represents the individual position of individual α after performing f tendency operations, g replication operations, and h migration operations; φ(f) represents the swimming direction selected by individual α; Δ(α) is a random vector, and Δ(α) ∈ [-1, 1]; Step S2.4: Repeat Steps S2.1 - S2.3 until all individuals in the current population have completed position update, and obtain the population after f times of tendency operations, g times of replication operations and h times of migration operations.

9. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 8, wherein The method of calculating the fitness value of the individual is as follows: For any individual, obtain the individual's position vector, use the conversion mechanism between the individual's position vector and the scheduling scheme to convert the individual's position vector into a flexible job shop scheduling scheme, and take the calculated makespan as the fitness value of the individual according to the makespan of this flexible job shop scheduling scheme; The conversion mechanism between the individual's position vector and the scheduling scheme is as follows: For the part of the individual's position vector used to represent the machine selection scheme, it is divided into two parts: converting the individual's position vector into the machine selection results of each process and converting the machine selection results of each process into the individual's position vector; The specific content of converting the individual position vector into the machine selection results for each process is as follows: For any process μ, all available machines for process μ are obtained, and the set of available machines for process μ is constructed. At the same time, all available machines in this set of available machines are numbered. The machine selection results corresponding to each element in the individual position vector are calculated respectively, expressed as: where u(μ) represents the number of the machine selected for process μ in the set of available machines for process μ; round(·) represents a function of rounding to the nearest integer; Z(μ) represents the number of machines in the set of available machines for process μ; The method of converting the machine selection results for each process into an individual position vector is as follows: When Z(μ) = 1, X(μ) takes any value in [-ε, ε]; For the part of the individual position vector of an individual used to represent the process arrangement plan, it is divided into two parts: converting the individual position vector into the arrangement order of processes and converting the arrangement order of processes into the individual position vector; The specific content of converting the individual position vector into the arrangement order of processes is as follows: The ascending order rule is used to assign a unique ROV value to each element in the individual position vector, map the ROV values of each element to the corresponding processes, and generate the arrangement order of processes according to the ROV values; The specific content of converting the arrangement order of processes into the individual position vector is as follows: l random key values are generated in the range of [-ε, ε] as the elements in the individual position vector, and an ROV value is assigned to each element according to the ascending order of the random key values. The ROV values are rearranged according to the process numbers in the current arrangement order, and then the elements corresponding to each ROV value are arranged to generate the individual position vector.

10. The flexible job shop scheduling method based on an improved bacterial foraging algorithm according to claim 9, characterized in that, The specific content of step S4 is as follows: Calculate the healthiness of all individuals in the current population respectively, sort all individuals in the current population in descending order according to the healthiness of the individuals, adopt the elitist retention strategy, and retain the top K individuals in the sorting result as elitist individuals according to the set proportion of elitist individuals. The remaining individuals in the current population are randomly assigned to two subgroups of the same size, and the healthiness of all individuals in each subgroup is summed up as the total healthiness of the subgroup; The calculation method of the healthiness of an individual is as follows: For any individual in the current population, obtain the fitness values of the individual after each tendency operation and sum them up. The sum of all fitness values of the individual is used as the healthiness of the individual, expressed as: wherein is the health of individual α; J α (α, f, g, h) is the fitness value of individual α after f tendency operations, g replication operations, and h migration operations; Randomly exchange the individuals in the two subgroups to obtain two new subgroups and calculate the total healthiness of the two new subgroups respectively. Adopt the greedy selection strategy to retain the subgroup with the highest total healthiness; For the retained subgroup, arrange the individuals in the subgroup in descending order of health, and eliminate the last W% of the individuals in the arrangement result according to a preset ratio; where K and W% need to satisfy the expression Merge the individuals retained in the subgroup and the elitist individuals and copy the merged individuals to obtain the population after f tendency operations, g copy operations and h migration operations.

Citation Information

Cited By

  • Process control method and system of mushroom tray conveying line based on flexible scheduling

    CN120841119A