4.1. APC-Based Scheduling Architecture
The APC-based scheduling architecture employs a metaheuristic search strategy that integrates seeding, growing, and fruiting to efficiently guide the global search, local search, and fitness convergence process, as shown in
Figure 3.
In
Figure 3, the APC-based scheduling architecture defines the conflict-free human–machine collaborative manufacturing problem as a job-flow-shop scheduling problem with a lot of constraints. Our goal is to complete all manufacturing jobs while pursuing higher manufacturing performance, conflict-free human–machine collaboration, and low no-load energy consumption. The solution process is mainly implemented through the following four main steps.
Step 1: Job analysis and manufacturing system evaluation. This step involves systematic job analysis, data collection, organization, modeling, and mining centered around customer orders to support scientific decision-making in manufacturing, sales, inventory, operations, and customer management for enterprises. After evaluation and analysis, a job set, }, a human set,}, and a machine set, }, will be generated, where each job contains a series of operations, }.
Step 2: CHMCMP initialization.
The parameters of the CHMCMP will be initialized at first, including the total number of humans that can be scheduled, , the operation/transfer rate of each human, , the total number of machines that can be scheduled, , the distance between machines, , the loaded processing power of each machine, , the no-loaded processing power, , the total number of jobs that can be scheduled, , the total number of operations in each job, , and the loaded processing time of each job, . The conflict-free human–machine collaboration can be determined by the human–machine conflict time, , in Equation (7).
The manufacturing performance can be measured through the makespan of all jobs, , in Equation (6). The no-load energy consumption can be evaluated using the no-loaded processing energy consumption, , in Equation (4).
The parameters of the APC will be initialized also, i.e., the population size
of the APC, the seeding probability
, the growing probability
, and the fruiting probability
. Each APC individual is encoded as a binary string
:
The fitness of the APC can be calculated using
in Equation (8), but the larger the value, the higher the fitness, as follows:
The end condition of the APC iteration also needs to be initialized. When the intermediate calculation results meet the end condition, the iteration can be terminated and the solution with the best fitness will be output. The commonly used conditions for ending iterations are the maximum number of iterations and the iteration error threshold. They determine whether the APC iteration continues or ends.
Step 3: APC-based iterative search for the JFSP.
As a metaheuristic algorithm, the optimal solution of the APC is not constrained by initial values, but depends on the heuristic learning process.
Step 3-1: Seeding operation to generate random feasible solutions.
It is to randomly produce APC seeds in each iteration for global search, which is decided by the seeding probability
[0, 1]. The seeding population
in iteration
includes two parts: the random produced seeds
by
and the fruits
in the previous iteration by
. There is
It should be noted that, there are no fruits () in the first iteration (), and all seeds are randomly produced.
Step 3-2: Growing operation to select elite feasible solutions.
A random-pairwise single-elimination tournament system is introduced for elite selection, with a time complexity of
, better than
of GA [
13] and
of NSGA-II [
6]. It is to provide the fitness selection for the APC individuals, which is determined by a growing probability
. According to the fitness function in Equation (27), the optimal seeds
will be selected by
and the growing population size will decrease to
. We can obtain
Step 3-3: Fruiting operation to allow elites to produce more feasible solutions.
It is to produce more APC fruits in each iteration for local search, which is decided by a fruiting probability of
. The growing individuals
have opportunities to produce parthenogenesis fruits
by cloning and the crossing fruits by string concatenation, where
determines how much genetic material a growing individual
can retain. Assuming two parents,
and
, they can produce two fruits as follows:
where ‘//’ is the string concatenation.
A set of fruits can be randomly selected from Equation (30),
or
. Hence, the total fruiting population size has doubled as follows:
Step 3-4: End judgment to determine whether to terminate the search for feasible solutions.
End judgment can be based on the end conditions initialized in step 2, such as a predefined maximum number of iterations or the iteration error threshold. If the end conditions are not fit, the APC will return to step 3-2 for the next iterative seeding. Otherwise, the best solution can be output, and the iterative calculation terminated.
Step 4: Implementation of scheduling and manufacturing based on the optimal solution.
Publish the optimal solution to each workshop, clarify the tasks, processes, working hours, and quality standards for both humans and machines. Real-time tracking of progress using information management or data systems can be employed to ensure optimal execution of human–machine scheduling. Monitor and define anomaly types (such as human–machine conflicts, equipment failures, material shortages, quality issues, etc.), and respond quickly through manufacturing anomaly reports. When necessary, readjust scheduling, call backup resources, and even re-optimize human–machine scheduling or manufacturing resources.
4.3. Pseudocode
Algorithm 1 illustrates the pseudocode for the APC-based scheduling architecture. Before line 1, the inputs and outputs are set. Line 1 shows Step 1 job analysis and manufacturing system evaluation. Lines 2 through 6 are Step 2 CHMCMP initialization, including the objective function, constraints, APC parameter set, and the randomly initialized solution. Lines 7~24 determine Step 3 APC-based iterative search for the JFSP. Line 9 is the seeding operation, Line 10 is a random-pairwise single-elimination tournament system, and Line 11 is the growing operation and. Line 17 calculates the fitness, and Lines 19~20 are the fruiting operation. Line 21 checks whether the feasible solution meets the constraints in Equations (9)–(25), and invalid solutions that do not meet the constraints in Line 4 will be discarded. Line 22 implements the end judgment. If the end conditions are not fit, the APC will return to Line 8 for the next iterative seeding. Otherwise, the best solution can be output and the iterative calculation can be terminated. Lines 25~27 conduct Step 4, implementation of scheduling and manufacturing based on the optimal solution.
| Algorithm 1: APC-based scheduling architecture |
| Input: . |
|
| 1: | Step 1: job analysis and manufacturing system evaluation |
| 2: | Step 2: CHMCMP initialization |
| 3: | Objective function: Equations (4), (6) and (8) |
| 4: | Constraints: Equations (9)–(25) |
| 5: | . |
| 6: |
|
| 7: | Step 3: APC-based iterative search for the JFSP |
| 8: | |
| 9: |
|
| 10: | a random-pairwise single-elimination tournament system |
| 11: |
|
| 12: |
|
| 13: |
|
| 14: |
|
| 15: |
|
| 16: |
|
| 17: |
|
| 18: |
|
| 19: |
|
| 20: |
|
| 21: | invalid solutions that do not meet the constraints in Line 5 will be discarded |
| 22: | , then return to line 8 |
| 23: | end for |
| 24: | |
| 25: | Step 4: implementation of scheduling and manufacturing based on the optimal solution |
| 26: | } |
| 27: | } |
Algorithm 1 aims to complete all manufacturing jobs, }, while aiming to improve manufacturing performance (), realize conflict-free human–machine collaboration (), and minimize no-load energy consumption (). The time complexity of Algorithm 1 can be calculated as , is linearly related to the population size (), number of iterations (), and the cost of the fitness function evaluation . The cost of the fitness function evaluation depends on the total number of humans (), the total number of machines (), and the total number of jobs ().
The random-pairwise single-elimination tournament system is shown in Algorithm 2. The inputs and outputs are set before Line 1. Lines 1 to 8 form a large loop with
iterations. Therefore, the complexity of this algorithm depends on how many feasible solutions are eliminated, rather than selecting the optimal batch of solutions. On Line 2, two different seeds are randomly selected to form a pair. From Lines 3 to 7, these two seeds engage in fitness competition and elimination, with winner-up and loser-out. The seed with high fitness is retained in the seed population, while the other seed with low fitness is eliminated. After a round of competition, the size of the seed population is reduced by one. After
of comparisons, the seed population size decreased to
, and they became elite individuals, as shown in Lines 9–10.
| Algorithm 2: A random-pairwise single-elimination tournament system |
|
|
| 1: | |
| 2: | |
| 3: |
|
| 4: | is reserved |
| 5: | is eliminated |
| 6: |
|
| 7: | end if |
| 8: | end for |
| 9: | |
| 10: | |
Algorithm 2 is committed to quickly eliminating solutions with low fitness while ensuring that the solution with the highest fitness can be retained. The time complexity of Algorithm 2 can be calculated as or , and is linearly related to the population size ().
For ease of understanding, comparison of APC with GA [
13,
25] and NSGA-II [
8] is shown in
Table 1. It can be seen that the proposed APC algorithm has made significant improvements in global search capability and elite selection, abandoning the sorting-based elite selection algorithms. Our algorithm cannot guarantee that all selected elite individuals are the best, but it has a linear time complexity and the best individual can be retained by 100%.