Abstract
A new mathematical method and an optimization model are proposed in this study to solve the tool requirement and pre-scheduling optimization problems involved in the tool flow system of digital workshops. This model aims to minimize the system makespan under the constraint of the tool purchase cost. A double-layer genetic algorithm based on the heuristic algorithm is then developed. This algorithm not only combines the advantages but also avoids the weaknesses of the two algorithms. Finally, a case study is conducted to validate the effectiveness and superiority of the proposed algorithm and the tool-machine dual-resource pre-scheduling optimization model.
Introduction
In manufacturing workshops, the impact of tools on productivity can reach up to 25%–30%. The machine cost and labor charges account for 20% and 38%, respectively, of the total manufacture cost.1,2 Unreasonable tool allocation often leads to the following cases: 16% of the production scheduling becomes abnormal, 30%–60% of the inventory tools become out of control, mechanics spend 20% of their time finding the right tool, and supervisors spend 40%–80% of their time looking for tools or supplying them.3,4 These situations imply that the problems caused by tools seriously affect the production efficiency. The waiting time for production and the time spent on finding the tools would naturally decrease if a manufacturing system was configured with adequate tools. However, the tool purchase cost would increase. Therefore, a rational tool requirement should be planned within the allowable range of funds, which includes the configuration of tools with rational types, specifications, and quantity, not only to ensure the tool performance and durability, shorten the job processing time, and increase the productivity, but also to reduce the tool and manufacturing costs and improve the production scheduling efficiency. 5 Production scheduling is the core content and key technology of workshop production management. 6 Tools and machines coexist and influence each other during the scheduling process, which indicates that limited tool resources pose constraints on machine operation and scheduling decisions.7,8 The traditional production scheduling only considers machine resources and assumes that tool resources are unlimited. In contrast, a study on tool scheduling has shown that scheduling is limited to the tool itself, and the impact of the machine resources is disregarded.9,10 Thus, the pre-scheduling optimization proposed in this study is actually a comprehensive scheduling based on tool and machine, which finishes the job processing sequence and processing time under the limited production resources, thereby ultimately making the established goals optimal. 11
Two main types of tool scheduling methods presently exist: “simulation + rule” heuristic scheduling and optimal scheduling. 12 The goal of the “simulation + rule” heuristic scheduling is to obtain a better scheduling solution in a relatively fast time, instead of obtaining the optimal solution. Therefore, its advantages include high efficiency, favorable real-time performance, and small cost. Buyurgan et al. 13 proposed a heuristic algorithm for tool flexibility. This tool uses tool size/tool life as the evaluation criterion for allocating tools, but without considering the influence of the scheduling policy on tool planning. Kumar and Sridharan 14 studied three types of tool assignment rules. They then analyzed and compared the performance of the production system without considering the tool failure, process delay, and other factors. In allusion to the problems of tool assignment, Özpeynirci and colleagues15,16 considered maximizing the total weight as an optimization objective and established the mixed-integer linear programming model under the constraints of tool resources and tool storage capacity, which used branch and bound methods in problem solving. Accordingly, Zhang et al. 17 built an optimal scheduling model under fixed tool resources, considering the tool exchange times as the optimization objective, which he solved by improving genetic algorithm. However, this model was only developed for the already determined tool resources. Zhao et al. 18 built an integrated scheduling model for part flow and tool flow systems, whose optimization objective was to minimize the makespan through a double-layer genetic algorithm. However, the method only aimed at dynamic scheduling and ignored tool resource preparation and planning.
Currently, the research on tool requirement planning mainly focuses on the tool flow manufacturing system. Wang et al. 19 proposed a tool requirement planning method for the tool flow system. They made use of the tool scheduling policy, which is not sensitive to the cycle time, through recursive algorithm to solve the cycle time and tool waiting time. They then added a critical tool to optimize the tool allocation until it reached the constraint of the tool purchase cost. Guanghui 20 proposed that a genetic algorithm can be used to solve the tool requirement planning problem of the flexible manufacturing system (FMS) under a specific job scheduling policy with the tool purchase cost as a constraint and minimizing the makespan as the goal.
In terms of the tool flow system, some literature proved that the tool scheduling policy is not the main factor affecting the task completion time. Therefore, the job scheduling policy for planning the tool requirement of a tool flow system was assumed in the existing literature, which only considered the effects of the tool resource allocation. However, present digital workshops generally have part flow systems of mass and small batch production. Therefore, this study focuses on the part flow system and proposes a new double-layer genetic algorithm based on the heuristic algorithm, which considers the tool requirement planning and dual-resource pre-scheduling. In indefinite tool resources (considering the tool purchase cost), various types of tools should be rationally allocated. In addition, under the constraint of a determined tool allocation, the operation sequence and the processing time must be finished to optimize the defined overall objective.
Problem description
In this article, “tool” refers to the metal-cutting tools used in machining. Configuring rational tool specifications and quantity and relating the processing sequence of each job to each machine and processing time to define the overall objective are the main problems addressed in this study considering the case of an uncertain tool resource allocation and the tool purchase cost. As we know, the production environment is dynamic and constrained by machines and tools as well as different release times for each job. The specific assumptions are set as follows to simplify the problem analysis and reflect on the actual situation inside the workshop:
The job-processing route and the operation (step) processing time are all definite and identified;
Each machine can only process one operation at a specific time;
Each tool can only process one operation on one machine at a specific time;
The computer numerical control (CNC) and general machines can shut down the reblading step;
The machine center cannot stop when a work is in progress;
Fault does not happen during the automated guided vehicle (AGV) car and tool manipulator operation;
Tool clamping, positioning, and other auxiliary times are included in the processing time;
Job transportation time is neglected;
Tool and machine work properly.
Mathematical model
Indices and parameter description
The following indices and parameters are introduced to describe multi-resource and target processing problems:
Indices
i = job index, if there are n types of job,
j = operation index, if there are n1 operations,
o = step index, if there are n2 steps,
k = machine index, if there are m machines,
t = tool index, if there are w types of tools,
Y = tool allocation, the number of various tool types;
E = various types of tool cost;
Z = total tool purchase cost.
Parameters
Objective function
The processing time for job
The waiting tool time of job
The complete production time of job
The objective function-minimized production makespan is presented as follows
Constraint conditions 1. Each step of each job can be processed on a single machine using the following equation
2. The succeeding operation for one job starts after the preceding operation finishes
where
3. The tool stock restriction is determined as follows
4. The constraints on the decision variables are as follows
5. The constraint on the tool purchase cost is determined as follows
Algorithm-solving process
The tool resource allocation herein was first made indefinite by combining the tool-machine dual-resource pre-scheduling with the tool requirement planning, and then solving for the optimal scheduling and the appropriate tool allocation using the double-layer genetic algorithm based on the heuristic algorithm, in which the outer optimization function aims at the indefinite tool resource allocation during the selection process to utilize the advantages of the heuristic algorithm. The inner optimization function aims at the dual-resource pre-scheduling problem based on the optimization result of the outer function. The overall objective function is to minimize the makespan. Figure 1 shows the flow diagram.

Flow chart of the pre-scheduling problem solution.
The outer optimization function of the double-layer genetic algorithm is based on a heuristic algorithm
The outer layer optimization function of the double-layer genetic algorithm based on a heuristic algorithm was mainly used to solve the problem on the allocation of the rational tool resources and apply the algorithm to the inner-layer optimization function and obtain the optimal pre-scheduling scheme. The critical tools are then determined, and the number of critical tools is added using the heuristic algorithm. Finally, the tool resource allocation is updated and continuously optimized until the optimal solution is obtained and inherited by the next generation.
Encoding and decoding
A real number encoding method is adopted in this study for the tool resource allocation, in which the chromosome number of genes is equal to the total types of tools, and the value of each gene represents the number of the corresponding types of tools. For example, there are six types of tools, in which the number of the second and fourth types is 2 (Figure 2).

Chromosome encoding of tools.
The value of each position gene was decoded by scanning the tool resource chromosome from left to right, which indicated that the corresponding tool was categorized and quantified. Table 1 shows the tool allocation corresponding to the chromosome-decoding process.
Chromosome decoding of tools.
The corresponding minimum makespan and the waiting time for all types of tools are easily obtained by constructing the tool allocation scheme as a known condition included in the inner layer function.
Initial population
The genetic algorithm is a population type of operation algorithm, in which a certain number of chromosomes can be generated after encoding the variables of the solution space to construct the initial population of the genetic algorithm. 21 The static tool requirements need to be calculated for the input scheduling tasks considered in this article. A tool should then be added to each tool type. The initial population number is equal to the type of tools.
Chromosome selection and crossover
Selection is the process of selecting a strong individual from the population and including it in the new population. The optimal retention strategy is used, that is, keeping the best fit individual in the current population and passing their traits to the next generation. The most critical tool, which is the most needed by the system is then determined according to the formula,
The total number of tools for same-generation individuals is the same. Thus, the traditional crossover method is not available. A new method is designed in this study. The specific operation proceeded as follows: first, the differences between the parent chromosome and the other random individuals are identified, and the gene positions that have been added tools in the parent chromosome are determined (another individual is used if the individual is the same as the parent generation); the total number of tools are then randomly added to the other genes that do not certainly contain added tools; finally, the respective filial chromosomes are produced (Figure 3).

Chromosome crossover.
Parent generations 1 and 2 yield sets [4, 4, 5, 4, 3] and [3, 3, 7, 4, 3], respectively. First, the difference between parent generations 1 and 2 is calculated, thereby generating a difference set of [1, 1, –2, 0, 0]. Second, a new set is randomly generated based on the difference sets, in which the number of elements is equal to “0” and the sum of the elements in the new set is equal to the positive elements. Third, the value of the new set is added to the corresponding parent gene position, where the value of the difference set is “0” and further increased to “1” at the left most difference set for “0,” which corresponds to the parent generation gene position. For example, filial generation 1 randomly generates set
This new crossover method is an absolute new approach that can ensure that the total number of tools in the filial generation has more 1 than the parent generation. The method also satisfies the purport put forward by this study. The demand of the chromosome crossover cannot be realized if the crossover method of the traditional genetic algorithm (e.g. PMX, OX, and LOX), whose total number of tools in every generation is the same, is used.
Chromosome variation
The swap variation method in the outer-layer function chromosome variation is designed. In this method, two gene positions are randomly selected; 1 is then added on the left-side position; and the genes are swapped. This method guarantees that the total number of tools in the filial generation has more 1 than the parent generation (Figure 4).

Chromosome variation in the parental and filial generations.
The chromosome of the parent generation is [4, 4, 5, 4, 3]. The third gene in the parent generation is increased to 1, and then exchanged with the fifth gene, which results in the filial generation [4, 4, 3, 4, 6].
Similarly, the chromosome variation of the traditional genetic algorithm is only selecting the gene positions and swapping them, which cannot realize the purpose of having the filial generation have more 1s than the parent generation. However, the new chromosome variation method designed in this study satisfied the requirements well, which ensures that the total number of tools in the filial generation has more 1s than the parent generation.
The inner optimization function of the double-layer genetic algorithms based on the heuristic algorithm
The inner optimization function, which is under the tool resource allocation of the outer optimization function, optimizes the tool-machine pre-scheduling and doubling of resources with the objective of minimizing the makespan.
Chromosome encoding
In this article, one chromosome represents one scheduling solution of the inner optimization function. Thus, the inner function also uses the real number encoding method. The chromosome is divided into three parts. The first part is the operation chromosome, which encodes for the operation determining the processing sequence of each operation. The second part is the machine chromosome, which encodes for the machine corresponding to the operation. The third part is the tool chromosome, which encodes for the tool usage information for each step. Considering the tool lifespan, tool cutting parameters, and other factors, taking the tools that can satisfy the processing time in just one grinding and can avoid production delay and quality problems caused by stopping is required to change the tools during processing.
The definite configuration of the tool resources
Processing information.
This case contains five operations with a chromosome length of 15. The chromosome has three parts, namely, operation chromosome, machine chromosome, and tool chromosome. These parts represent the scheduling solution shown in Figure 5.

Chromosome samples.
Chromosome decoding
The chromosome decodes from left to right starting with the operation, proceeding to the machine, and, finally, to the tool chromosome. The decoding processes are discussed as follows:
Decoding of the operation chromosome
The quantity of the genes in the operation chromosome is the same as that of the machine chromosome. Furthermore, each gene position uses a job number to decode from left to right. An appearing job sequence represents the processing sequence. The job appearing frequency indicates the quantity of operations. Figure 6 shows the decoding of the operation chromosome in this case.

Operation chromosome decoding.
Decoding of the machine chromosome
The quantity of genes in the machine chromosome is equal to that of the operation gene. Moreover, the machine gene sequence is arranged by the operation processing sequence of each job. Every gene position represents an optional machine set

Decoding of the machine chromosome.
Decoding of the cutting tool chromosome
The quantity of the tool gene position is consistent with the whole operations of jobs. The gene sequence is arranged by operations. Each gene position corresponds to a tool set for each step. The number of the gene position represents the tool number used by all steps. Figure 8 illustrates the decoding of the tool chromosome.

Decoding of the tool chromosome.
A plan for the tool allocation and its corresponding scheduling scheme can be obtained according to the decoding of the operation, machine, and tool. Figure 9 shows the decoding of the chromosome.

Chromosome decoding.
Initial population
First, a processing line is randomly selected, and the processing sequence of different jobs is randomly arranged for the operation encoding. Second, a processing machine is randomly selected for the machine encoding according to the set of operations of the optional machine. The tools whose lifespans do not satisfy the processing conditions are then eliminated from the optional tool set, and the tool numbers are set for tool encoding. Finally, the initial population is produced.
Chromosome selection and crossover
Chromosome selection still uses the optimal retention policy to enable the best-fit individuals to directly pass their traits to the next generation, which will not be destroyed by chromosome selection, crossover, and variation operations. As for the crossover, the chromosome is divided into three parts. The operation chromosome segment is cut using the IPOX crossover method. The machine and tool chromosome segments are cut using the multi-point crossover method.
For example, the tool chromosome segment is obtained through the same method used in the machine chromosome segment. The genes, where 0 corresponds to the gene position, are exchanged, and the genes, where 1 corresponds to the gene position, are retained by generating a set (Rand0-1) randomly composed by 0 and 1 and which is equal to the tool chromosomal segment gene number (Figure 10;

Chromosome crossover operation of tools.
Chromosome variation
The variation in the operation chromosome requires the exchange variation method, which randomly selects two positions to exchange genes. The positions corresponding to the machine and the tool also need to exchange genes. The machine chromosome variation randomly selects a different machine in the machine set that corresponds to the operation, whereas the corresponding tool genes should follow the variation machine encoding for re-selected tools.
Experiment verification and result analysis
The following case verifies the planning for the tool requirement and the methods of the tool-machine dual-resource pre-scheduling based on a tool flow system in a digital workshop. The case data are as follows: four machines were used, including
Process information.
Genetic algorithm’s basic parameters.
Table 5 presents the case-solving results, which shows that the waiting tool time and the makespan are different with different tool allocations. The critical tool section provides the critical tools under each allocation case. A continuous addition of the appropriate critical tools to the next generation is conducted according to the method proposed in this study until the optimal allocation of the tool requirement and the pre-scheduling scheme of the tool-machine dual-resource is determined. The sixth tool allocation is better than the seventh and eighth. Although their makespans are the same (i.e. 156), the sixth program has a lower cost. Therefore, the sixth program is the optimal scheme for this case, meaning three of
Maximum completion time under different tool allocations.

Optimal pre-scheduling scheme.

Usage of tools.
The case or data for the tool requirement or dual-resource pre-scheduling optimization in the tool flow system of digital workshops barely exist at the present. Therefore, there is no way to compare the results with any other cases. However, in Figure 13, the decrease of the average makespan over 10 runs for the sixth tool allocation program with four jobs, four machines, and five types of tools is drawn. Noting that the algorithm presented in this article improves the average makespan at a very fast speed is possible. Furthermore, the best makespan equal to 156 is reached after 10 generations and is optimal. With regard to the self-built case, although the scale is not too large or cannot better reflect the superiority of the proposed intelligent optimization algorithm, it can effectively and quickly obtain the optimal solution.

Decrease of the makespan.
Conclusion
This study aimed to address the tool requirement and pre-scheduling optimization problems in the tool flow system of a digital workshop. Accordingly, an optimization model was initially built and a new intelligent optimization algorithm (i.e. a double-layer genetic algorithm based on a heuristic algorithm) was proposed for the tool requirement and pre-scheduling for the tool-machine dual-resource with the primary objective of minimizing the system makespan under the constraint of the tool purchase cost. A more complex flexible scheduling case was chosen to better verify the performance of the algorithm in dealing with large-scale and complex problems. An optimal allocation for the tool requirement and pre-scheduling scheme for the tool-machine dual-resource was obtained by utilizing the proposed algorithm. At the same time, the decrease of the makespan was drawn to prove that the algorithm can quickly and effectively obtain the optimal solution in a very short time as well as the effectiveness and superiority of the algorithm in dealing with large-scale and complex problems. The case study verified that the rational tool requirement plan and the pre-scheduling optimization model of the tool-machine dual-resource in the tool flow system of a digital workshop are effective.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The research is supported by the National Natural Science Foundation of China (NSFC) under Grant No. 51205429, the Program for Innovative Research Team in University of Ministry of Education of China under Grant No.IRT_15R64, the Science and Technology Project of Chongqing under Grant No. cstc2014zktjccxyyBX0019, and the National Science and Technology Pillar Program during the 12th Five-year Plan Period of China under Grant No.2012BAF01B01.
