A method for generating tool scheduling rules in a workshop based on a genetic algorithm
By optimizing tool scheduling rules through genetic algorithms, and taking into account tool life, quantity, and machine tool magazine capacity, the problem of ineffective tool configuration optimization in existing technologies is solved, thereby improving production efficiency and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIANGNAN UNIV
- Filing Date
- 2024-10-18
- Publication Date
- 2026-04-14
AI Technical Summary
Existing tool configuration optimization methods fail to comprehensively consider tool life, quantity, size, and machine tool magazine capacity, resulting in poor scheduling optimization effects.
A workshop tool scheduling rule generation method based on genetic algorithm is adopted. By constructing a scheduling model and combining heuristic rules of machine priority, initial tool and tool change, a three-layer real number code is generated. The tool allocation is optimized by roulette wheel selection, crossover operation and mutation operation, taking into account tool life and quantity, size and machine tool magazine capacity.
It improves tool scheduling optimization, reduces tool resource conflicts and tool change frequency, and increases production efficiency and machine utilization.
Smart Images

Figure CN119417122B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for generating workshop tool scheduling rules based on genetic algorithms. Background Technology
[0002] Customized equipment companies primarily design and manufacture equipment to meet the specific needs of industries or customers. Their products typically contain a large number of specialized parts, such as specialized medical equipment and specialized industrial machinery. These products involve a wide variety of workpieces and processes, and the machining process involves a large number of different types of cutting tools. This creates a significant demand for optimizing the allocation of cutting tool resources. Optimizing the tool configuration can not only effectively improve machine utilization and production efficiency and reduce idling energy consumption during the production process, but also reduce the number of cutting tools required for the machining process and improve tool utilization, thereby increasing cost-effectiveness.
[0003] However, existing methods for optimizing tool configuration are relatively simple and do not take into account factors such as tool life and quantity, tool size, and machine tool magazine capacity, resulting in low optimization efficiency. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a method for generating workshop tool scheduling rules based on genetic algorithms to solve the above-mentioned problems.
[0005] The technical solution adopted by this invention to solve its technical problem is: a method for generating workshop tool scheduling rules based on genetic algorithms, comprising the following steps:
[0006] S1: Utilizing the set of workpieces in the machine The process set of the workpiece set , workpiece process Processing time Number of processes Machine serial number Tool number The number of secondary tools (h) and tool life Construct a scheduling model that minimizes the maximum completion time and minimizes the number of tool changes;
[0007] S2: Obtain the priority of each machine based on the heuristic rule of machine priority. ;
[0008] S3: Assign tools to each machine according to the heuristic rules of the tool number of the initial tool set and the tool number of the tool change;
[0009] S4: Output the tool allocation combination for each machine machining task set;
[0010] S5: The machine number, the initial tool set number, and the tool change number are respectively encoded with real numbers to form three gene chains;
[0011] S6: The initial population is formed using the machine priority heuristic rule, the initial tool set tool number heuristic rule, and the tool change tool number heuristic rule.
[0012] S7: Evolve the initial population, where the evolution includes roulette wheel selection, crossover, and mutation operations, to obtain the optimal population individuals that minimize the maximum completion time and the number of tool changes.
[0013] It is worth noting that in step S2, the priority of each machine is obtained. Before the next step, the following steps will also be performed: initialize the time step on each machine. Obtain the set of workpieces on each machine. Process set Obtain the machine serial number The machine at the current time step workpiece process Processing time Set of secondary tool numbers and tool life .
[0014] Preferably, step S2 includes the following sub-steps:
[0015] S21: Obtain the set of workpieces on each machine Process set and its processing time Initialize to set the machine number ;
[0016] S22: Determine the machine serial number Is it equal to the maximum number of machines? If so, proceed to step S26;
[0017] S23: Execution ; Total machine hours ;in For the workpiece number, For the last workpiece, This is the process number. This is the last process;
[0018] S24: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S25; otherwise, update the process. Then proceed to step S23;
[0019] S25: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S22; otherwise, update the workpiece. and update process Then proceed to step S23;
[0020] S26: Utilize the total working hours of all machines The value is used to assign machine priorities based on a machine priority heuristic. The machine priority heuristic rules include the PLPT rule, which prioritizes machines with longer total working hours, and the PSPT rule, which prioritizes machines with shorter total working hours.
[0021] S27: Output the machine priorities of each machine under different machine priority heuristic rules. value.
[0022] Optionally, in step S3, assigning tools to each machine according to the heuristic rule of the tool number in the initial tool set includes the following sub-steps:
[0023] S31: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S32.
[0024] S32: Execution ,like Then update , , Then proceed to step S33; where For tool life, Number the machine The machine at the current time step workpiece process Processing time;
[0025] S33: Obtain the current time step using a heuristic rule based on the tool number of the initial tool set. machine workpieces Process knives Allocation and combination;
[0026] S34: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S35; otherwise, update the process. Then proceed to step S33;
[0027] S35: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S36; otherwise, update the workpiece. and update process Then proceed to step S33;
[0028] S36: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
[0029] Specifically, in step S3, assigning tools to each machine according to the heuristic rule of the tool number during tool changing includes the following sub-steps:
[0030] S37: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S38.
[0031] S38: Execution ,like Then update , and Then proceed to step S39; where For tool life, Number the machine The machine at the current time step workpiece process Processing time, Number the machine The machine at the current time step workpiece process The remaining processing time;
[0032] S39: Obtain the current time step using a heuristic rule based on the tool number of the tool changer. machine workpieces Process Remaining process time knife pairing Assign combinations and proceed to step S310;
[0033] S310: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S311; otherwise, update the process. Then proceed to step S39;
[0034] S311: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S312; otherwise, update the workpiece. and update process Then proceed to step S39;
[0035] S312: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
[0036] It is worth noting that step S33 includes the following sub-steps:
[0037] S331: Obtain the machine At the current time step workpiece process Processing time Set of secondary tool numbers and tool life ;
[0038] S332: Combining the rules KTLL (lowest remaining tool life priority), KTHL (highest remaining tool life priority), and KTLEPT (tool life equal to operation time priority), we obtain the KTLL tool scheduling rule, KTHL tool scheduling rule, KTHL&KTLEPT tool scheduling rule, and KTLL&KTLEPT tool scheduling rule. Tools are then allocated according to these rules. Give the current time step machine workpieces Process It also outputs the initial tool allocation under different tool scheduling rules. Allocation and combination.
[0039] Preferably, step S39 includes the following sub-steps:
[0040] S391: Obtain the machine At the current time step workpiece process Remaining processing time Set of secondary tool numbers and tool life ;
[0041] S392: Machine workpieces process Divided into processed steps and unprocessed processes ;
[0042] S393: Combining the minimum remaining tool life priority KTLL rule, the maximum remaining tool life priority KTHL rule, and the tool-equivalent operation time priority KTLEPT rule, we obtain the KTLL tool scheduling rule, the KTHL tool scheduling rule, the KTHL & KTLEPT tool scheduling rule, and the KTLL & KTLEPT tool scheduling rule. Tools are then allocated according to these rules. For unprocessed processes It also outputs the tool during tool change under different tool scheduling rules. Allocation and combination.
[0043] Specifically, step S6 includes the following sub-steps:
[0044] S61: Initialize environment and information;
[0045] S62: Obtain the heuristic rules for machine priority, the heuristic rules for the tool number of the initial tool set, and the heuristic rules for the tool number of the tool change, and generate uniform distribution probabilities based on the number of the corresponding heuristic rules; perform roulette wheel betting based on the probability distribution to select the population generation rule; obtain the real number encoding of the gene chain based on the selected population generation rule.
[0046] The beneficial effects of this invention are as follows: In the workshop tool scheduling rule generation method based on genetic algorithm, tool life and quantity, tool size and machine tool magazine capacity are comprehensively considered. Three-layer real number encoding is generated by using heuristic rules of machine priority, heuristic rules of tool number of initial tool set and heuristic rules of tool number of tool change. The initial population of genetic algorithm is generated by combining heuristic information and random strategy. Based on this, a genetic algorithm based on heuristic information is constructed to solve the problem. By comprehensively considering tool life and quantity, tool size and machine tool magazine capacity, the scheduling optimization degree is improved. Attached Figure Description
[0047] Figure 1 This is a flowchart of a workshop tool scheduling rule generation method based on a genetic algorithm in one embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of intelligent workshop tool scheduling in one embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the tool allocation in one embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of the tool change allocation in one embodiment of the present invention;
[0051] Figure 5 This is a genetic algorithm framework diagram in one embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of three gene chains in one embodiment of the present invention. Detailed Implementation
[0053] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings. It should be noted that these descriptions are for the purpose of aiding understanding the present invention, but do not constitute a limitation thereof. Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0054] The following relationships exist during the modeling process:
[0055] 1) Collection of workpieces from various machines The workpieces have a defined predecessor-successor relationship;
[0056] 2) There are defined predecessor and successor relationships between the processes within each workpiece;
[0057] 3) One type of cutting tool can only perform one process;
[0058] 4) The same knife cannot be used on more than one machine at the same time;
[0059] 5) There is no difference between the tool magazines of the machines, and they can all accommodate the seeded tools, but each type of tool has only one tool slot available;
[0060] 6) The number of a certain type of auxiliary tool in all machine tool magazines at any given time shall not exceed h;
[0061] 7) Unless the tool life reaches zero during the machining process, the tool cannot be adjusted until the current process is completed;
[0062] 8) The current process can only begin when the tool life for the current process in the machine is not zero;
[0063] 9) Assume that all required tools are initially in the machine's tool magazine;
[0064] 10) Ignore the time for transporting the tool between the tool holder and the machine tool magazine, and the time for changing the tool.
[0065] A method for generating workshop tool scheduling rules based on genetic algorithms includes the following steps:
[0066] S1: This solution can be understood as a parallel machine scheduling optimization problem that considers multiple machines, tool life and quantity, uneven tool size, and limited machine tool magazine capacity. Figure 2 As shown, the set of workpieces in the machine is used. The process set of the workpiece set , workpiece process Processing time Number of processes Machine serial number Tool number The number of secondary tools (h) and tool life Construct a scheduling model that minimizes the maximum completion time and the minimum number of tool changes; where each machine is numbered... The collection of workpieces The process set of each workpiece set has been predetermined. It is known that this batch of processing tasks contains a total of Each process, each workpiece Each process Processing time They may be the same or different, depending on the actual order. Meanwhile, the workshop contains... machine Types of cutting tools (among which) One type of tool represents a type of tool size, and each tool contains... Secondary knives, lifespan of each knife The results may be the same or different, depending on the actual tool library information; the optimization objective is to minimize the maximum completion time. and minimize the number of tool changes The weighted sum is used to obtain the tool configuration for each process of each machine;
[0067] The parameters used in the scheduling model constructed in this scheme are as follows:
[0068] Machine number index;
[0069] : Workpiece number index;
[0070] Workpiece process number index;
[0071] , Tool type number index, using and This represents two different types of processes, and so on;
[0072] , : Single-type secondary tool number index, using and This indicates two different types of secondary knives, and so on;
[0073] , , Time step number index, used , and ;
[0074] : Tool life index at the current time step;
[0075] Processing time index;
[0076] The processing timers on each machine are 0-1 variables;
[0077] : is a weighting factor between 0 and 1, used to adjust the trade-off between two objectives;
[0078] Maximum completion time;
[0079] Number of tool changes;
[0080] Machine ID set: v is the maximum number of machines;
[0081] The set of workpiece numbers for each machine: , For the last workpiece;
[0082] The set of process numbers for each workpiece: , This is the last process, in which ; This represents the maximum number of process types.
[0083] Set of machining task operation types (tool types) numbering: ; This represents the maximum number of process types.
[0084] Single-type secondary tool number set: ; This represents the maximum number of secondary blades.
[0085] Time step number set: ; This represents the maximum number of time steps.
[0086] The decision variables of the scheduling model constructed in this scheme are as follows:
[0087] ;
[0088] ;
[0089] ;
[0090] The objective function of the scheduling model constructed in this scheme is as follows:
[0091] ; represents minimizing the weighted sum of the maximum completion time and the number of tool changes, where It is a weighting factor between 0 and 1, used to adjust the weight between two objectives;
[0092] The constraints of the scheduling model constructed in this scheme are as follows:
[0093] This indicates the method for calculating the maximum completion time;
[0094] This indicates the method for calculating the number of tool changes;
[0095] , This indicates that there is a sequential relationship between the workpieces in each set of machine processing tasks; , This indicates that there is a sequential relationship between the processing steps of each workpiece; these two constraints represent constraints where the workpiece's process sequence information is known.
[0096] This indicates that a single cutting tool can only perform one process.
[0097] This means that the same knife cannot be on more than one machine at the same time;
[0098] This indicates that there is no more than one secondary blade of the same type on a single machine;
[0099] This indicates that the number of cutting tool types on a machine is no more than the capacity 'a' of cutting slot types.
[0100] This means that at any given moment, the number of auxiliary tools of all types on all machines is no more than the total number of auxiliary tools of that type in the workshop.
[0101] , It is equivalent to a virtual timer, which means that the processing time of each set of machine workpieces is timed until the last process of the machine is completed.
[0102] This means that the current process can only begin when the tool life for the current process in the machine is not zero.
[0103] This means ensuring that tool changes due to the end of tool life occur within the tool's lifespan. When the value is 0 or after the value is 0, that is, once the tool is moved out of the central tool magazine, it must wait until the end of its service life or the completion of all machining tasks of all machines before it can return to the central tool magazine.
[0104] , This indicates a tool change that occurs not due to the end of the tool's life (tool borrowing between machines).
[0105] , indicating the guarantee time The lifespan of a new knife replaced due to the end of its lifespan Not equal to 0;
[0106] , This indicates the method for updating and calculating tool life at each time step;
[0107] , ; This indicates that unless the tool life becomes zero during the machining process, tool adjustment can not be performed until the current process is completed, meaning that the machining process is not interrupted.
[0108] This represents the upper bound constraint on the time step, which is the maximum completion time for all processing tasks in the workshop;
[0109] , , which represents the non-negativity constraint of the decision variable.
[0110] Regarding the characteristics of workpiece processes, customized equipment companies produce products containing a large number of specialized parts. Their processing tasks are characterized by a wide variety of workpiece types and processes. The main issues with workpiece and process processing are that each workpiece has processes with varying processing times (or possibly the same, depending on the actual workpiece processing information), and each workpiece has a different number of processes (again, possibly the same). The processing time for each process may also differ. This unequal number of processes and processing times between workpieces necessitates considering both the overall processing time of the machine's workpiece set and the processing time of individual processes when scheduling tools.
[0111] Regarding tool characteristics, this solution sets constraints on the number of tool size types, the quantity of tools, tool life, and machine tool magazine capacity. Furthermore, the lifespan of each tool, which serves as the information input, is finite and may vary. These characteristics may cause the following phenomena and problems during production:
[0112] 1. Due to the limited nature of tooling resources, the larger the workpiece and process scale, the greater the probability of tooling resource conflicts when multiple machines simultaneously request the same tool. This leads to the problem of tool allocation decisions. 2. Due to the limited tool life, tool replacement decisions triggered by the end of tool life are also an issue that needs to be considered.
[0113] Based on the above phenomena, the following three key points can be identified for solving optimization problems:
[0114] 1. Properly handle tool resource conflicts; 2. Reduce the probability of tool resource conflicts; 3. Make sound tool replacement decisions when tool life ends, which are the key optimization problems in this paper.
[0115] S2: Obtain the priority of each machine based on the heuristic rule of machine priority. ;
[0116] Among them, in obtaining the priority of each machine Before that, the following steps will be performed: Initialize the time step on each machine. Obtain the set of workpieces on each machine. Process set Obtain the machine serial number The machine at the current time step workpiece process Processing time Set of secondary tool numbers and tool life ;
[0117] Step S2 includes the following sub-steps:
[0118] S21: Obtain the set of workpieces on each machine Process set and its processing time Initialize to set the machine number ;
[0119] S22: Determine the machine serial number Is it equal to the maximum number of machines? If so, proceed to step S26;
[0120] S23: Execution ; Total machine hours ;in For the workpiece number, For the last workpiece, This is the process number. This is the last process;
[0121] S24: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S25; otherwise, update the process. Then proceed to step S23;
[0122] S25: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S22; otherwise, update the workpiece. and update process Then proceed to step S23;
[0123] S26: Utilize the total working hours of all machines The value is used to assign machine priorities based on a machine priority heuristic. The machine priority heuristic rules include the PLPT rule, which prioritizes machines with longer total working hours, and the PSPT rule, which prioritizes machines with shorter total working hours.
[0124] S27: Output the machine priorities of each machine under different machine priority heuristic rules. value;
[0125] S3: Assign tools to each machine according to the heuristic rules of the tool number of the initial tool set and the tool number of the tool change;
[0126] Assigning tools to each machine according to the heuristic rule of the tool numbering in the initial tool set includes the following sub-steps:
[0127] S31: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S32.
[0128] S32: Execution ,like Then update , , Then proceed to step S33; where For tool life, Number the machine The machine at the current time step workpiece process Processing time;
[0129] S33: Obtain the current time step using a heuristic rule based on the tool number of the initial tool set. machine workpieces Process knives Allocation and combination;
[0130] S34: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S35; otherwise, update the process. Then proceed to step S33;
[0131] S35: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S36; otherwise, update the workpiece. and update process Then proceed to step S33;
[0132] S36: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
[0133] Assigning tools to each machine based on the heuristic rule of the tool number during tool change includes the following sub-steps:
[0134] S37: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S38.
[0135] S38: Execution ,like Then update , and Then proceed to step S39; where For tool life, Number the machine The machine at the current time step workpiece process Processing time, Number the machine The machine at the current time step workpiece process The remaining processing time;
[0136] S39: Obtain the current time step using a heuristic rule based on the tool number of the tool changer. machine workpieces Process Remaining process time knife pairing Assign combinations and proceed to step S310;
[0137] S310: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S311; otherwise, update the process. Then proceed to step S39;
[0138] S311: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S312; otherwise, update the workpiece. and update process Then proceed to step S39;
[0139] S312: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
[0140] Step S33 includes the following sub-steps:
[0141] S331: Obtain the machine At the current time step workpiece process Processing time Set of secondary tool numbers and tool life ;
[0142] S332: Combining the rules KTLL (lowest remaining tool life priority), KTHL (highest remaining tool life priority), and KTLEPT (tool life equal to operation time priority), we obtain the KTLL tool scheduling rule, KTHL tool scheduling rule, KTHL&KTLEPT tool scheduling rule, and KTLL&KTLEPT tool scheduling rule. Tools are then allocated according to these rules. Give the current time step machine workpieces Process It also outputs the initial tool allocation under different tool scheduling rules. Allocation and combination;
[0143] like Figure 3 As shown, each machine time step The tool life is reduced and its process time They are closely related: from a local perspective, find a... Using high-quality cutting tools can effectively reduce the number of tool changes. However, this might lead to excessively long waiting times for other processes that require the knife, and could increase the probability of subsequent processes encountering tool resource conflicts; finding a knife... Using different cutting tools can make machining more flexible, but may increase the number of tool changes. From a holistic perspective, allocating suitable tools to all processes can effectively reduce the probability of tool resource conflicts, thereby reducing... Value and number of tool changes Therefore, and Based on the relationships between them, the following three scheduling rules are obtained:
[0144] 1. Keep tool lowest lifetime (KTLL) priority;
[0145] 2. Keep tool highest lifetime (KTHL) priority;
[0146] 3. Keep tool lifetime equal to processing time (KTLEPT), meaning the current time step... Appear When necessary, prioritize the allocation of this cutting tool. Give process .
[0147] It is worth noting that the KTLEPT tool scheduling rule applies only if tool life is affected. Equal to process time The KTLEPT tool scheduling rule can only be used when the KTLL or KTHL tool scheduling rule is set up. Therefore, the KTLEPT tool scheduling rule is used as an additional rule alongside the KTLL or KTHL tool scheduling rule, connected to it using the '&' symbol as a connector, such as KTHL&KTLEPT or KTLL&KTLEPT. The logic for using the KTLEPT tool scheduling rule as an additional rule is as follows: when determining to use the KTHL&KTLEPT or KTLL&KTLEPT tool scheduling rule, it should first be determined whether the tool to be allocated meets the required tool life. Equal to process time If the conditions are met, the tool will be directly used as the decision object for tool allocation; otherwise, the KTHL tool scheduling rule or KTLL tool scheduling rule will be used for tool decision allocation.
[0148] Step S39 includes the following sub-steps:
[0149] S391: Obtain the machine At the current time step workpiece process Remaining processing time Set of secondary tool numbers and tool life ;
[0150] S392: Machine workpieces process Divided into processed steps and unprocessed processes ;
[0151] S393: Combining the minimum remaining tool life priority KTLL rule, the maximum remaining tool life priority KTHL rule, and the tool-equivalent operation time priority KTLEPT rule, we obtain the KTLL tool scheduling rule, the KTHL tool scheduling rule, the KTHL & KTLEPT tool scheduling rule, and the KTLL & KTLEPT tool scheduling rule. Tools are then allocated according to these rules. For unprocessed processes It also outputs the tool during tool change under different tool scheduling rules. Allocation and combination;
[0152] like Figure 4 As shown, after the initial tool life ends, the problem is also a decision about tool allocation. Therefore, the relationship between tool life and process time is used as the basis to form the following three rules: the minimum remaining tool life priority KTLL rule, the maximum remaining tool life priority KTHL rule, and the tool equivalent process time priority KTLEPT rule.
[0153] S4: Output the tool allocation combination for each machine machining task set.
[0154] Thus, based on the machine priority rules (PLPT and PSPT) and the tools at the initial tool allocation... The tool scheduling rules (KTLL, KTHL, KTHL&KTLEPT, and KTLL&KTLEPT) and the tools used during tool changes are assigned to the corresponding combinations. By combining the tool scheduling rules (KTLL, KTHL, KTHL&KTLEPT, and KTLL&KTLEPT) corresponding to the allocation combinations in sequence, 32 algorithms can be formed, as follows:
[0155] PLPT-KTHL-KTHL (Algorithm 1), PLPT-KTHL-KTHL&KTLEPT (Algorithm 2), PLPT-KTHL-KTLL (Algorithm 3), PLPT-KTHL-KTLL&KTLEPT (Algorithm 4), PLPT-KTHL&KTLEPT-KTHL (Algorithm 5), PLPT-KTHL&KTLEPT-KTHL&KTLEPT (Algorithm 6), PLPT-KTHL&KTLEPT-KTLL (Algorithm 7), PLPT-KTHL&KTLEPT-KTLL&KTLEPT (Algorithm 8), PLPT- KTLL-KTHL (Algorithm 9), PLPT-KTLL-KTHL&KTLEPT (Algorithm 10), PLPT-KTHL-KTHL (Algorithm 11), PLPT-KTLL-KTLL&KTLEPT (Algorithm 12), PLPT-KTLL&KTLEPT-KTHL (Algorithm 13), PLPT-KTLL&KTLEPT-KTHL&KTLEPT (Algorithm 14), PLPT-KTLL&KTLEPT-KTLL (Algorithm 15), PLPT-KTLL&KTLEPT-KTLL&KTLEPT (Algorithm 16), PSPT -KTHL-KTHL (Algorithm 17), PSPT-KTHL-KTHL&KTLEPT (Algorithm 18), PSPT-KTHL-KTLL (Algorithm 19), PSPT-KTHL-KTLL&KTLEPT (Algorithm 20), PSPT-KTHL&KTLEPT-KTHL (Algorithm 21), PSPT-KTHL&KTLEPT-KTHL&KTLEPT (Algorithm 22), PSPT-KTHL&KTLEPT-KTLL (Algorithm 23), PSPT-KTHL&KTLEPT-KTLL&KTLEPT (Algorithm 24), PS PT-KTLL-KTHL (Algorithm 25), PSPT-KTLL-KTHL&KTLEPT (Algorithm 26), PSPT-KTHL-KTHL (Algorithm 27), PSPT-KTLL-KTLL&KTLEPT (Algorithm 28), PSPT-KTLL&KTLEPT-KTHL (Algorithm 29), PSPT-KTLL&KTLEPT-KTHL&KTLEPT (Algorithm 30), PSPT-KTLL&KTLEPT-KTLL (Algorithm 31), PSPT-KTLL&KTLEPT-KTLL&KTLEPT (Algorithm 32).
[0156] like Figure 5As shown in the figure, S5: Real number encoding is performed on the machine number, the tool number of the initial tool assignment, and the tool number of tool change to form three gene chains; in this way, gene chain one, gene chain two, and gene chain three can be correspondingly formed. The length of gene chain one is the maximum number v of machines in the current production environment, the length of gene chain two is the number of workpieces in the current production environment *Number of processes for a single workpiece , and the length of gene chain three is the number of workpieces in the current production environment *Number of processes for a single workpiece *Number of auxiliary tools of a single type ; Each individual contains three-layer gene chains as shown in Figure 6 the figure. Each gene chain in each layer represents a solution in the solution space of that layer, and the search for the solution space is carried out through the selection, crossover, and mutation operations of the genetic algorithm;
[0157] S6: Use the machine priority heuristic rule, the heuristic rule of the tool number of the initial tool assignment, and the heuristic rule of the tool number of tool change to form an initial population; The initial population is the initial position where the intelligent algorithm starts to search in the solution space. It can be randomly generated. A randomly generated population usually increases the diversity of the population and increases the exploratory ability of the algorithm in the solution space; It can also be generated through some heuristic information, such as using the professional knowledge or guiding experience in the problem neighborhood to generate the initial population. These heuristic information are designed according to the specific optimization problem and algorithm characteristics to help the algorithm generate a population with better gene quality and accelerate the search process. However, if all individuals are generated using heuristic information, it may reduce the diversity of the population and easily cause the algorithm's solution result to fall into a local optimum; In practice, combining the strategy of heuristic information and randomly generating the initial population can improve the convergence speed and exploratory performance of the algorithm;
[0158] The step S6 includes the following sub-steps:
[0159] S61: Initialize the environment and information; When ep < r, jump to step S62; When ep ≥ r, jump to step S63; where ep is a random decimal between 0 and 1, representing the probability that an individual of a certain initial population is generated by the neighborhood knowledge rule or the random rule; r is a random decimal between 0 and 1;
[0160] S62: Obtain the heuristic rules for machine priority, the heuristic rules for the tool number of the initial tool set, and the heuristic rules for the tool number of the tool change, and generate a uniform probability distribution based on the number of the corresponding heuristic rules; for example, gene chain 2 belongs to the gene chain corresponding to the heuristic rule for the tool number of the initial tool set. This heuristic rule currently has four available scheduling rules to guide the generation of the gene chain, namely KTLL tool scheduling rule, KTHL tool scheduling rule, KTHL&KTLEPT tool scheduling rule, and KTLL&KTLEPT tool scheduling rule. At this time, the number of heuristic rules is 4, so the probability of each rule is 25%, and the sum is 1, thus forming a uniform probability distribution; similarly, the machine priority heuristic rules are PLPT rule and PSPT rule, at this time the number of heuristic rules is 2, and the heuristic rules for the tool number of the tool change are KTLL tool scheduling rule, KTHL tool scheduling rule, KTHL&KTLEPT tool scheduling rule, and KTLL&KTLEPT tool scheduling rule, at this time the number of heuristic rules is 4;
[0161] The population generation rule is selected by roulette wheel based on the probability distribution. For example, if the KTLL tool scheduling rule is selected, the KTLL tool scheduling rule is used as the population generation rule.
[0162] The real-number encoding of the gene chain is obtained according to the selected population generation rule;
[0163] S63: Gene chain codes are randomly generated within the solution space; a strategy of randomly generating individuals is introduced to increase population diversity and improve the exploratory nature of the algorithm;
[0164] S7: Evolve the initial population, where the evolution includes roulette wheel selection, crossover, and mutation operations, to obtain the optimal population individuals that minimize the maximum completion time and the number of tool changes.
[0165] The evolution of a population is inseparable from selection, crossover, and mutation.
[0166] Roulette wheel selection and tournament selection are two common selection methods in genetic algorithms. Roulette wheel selection is based on the fitness value of individuals, with higher-fit individuals having a higher probability of being selected. This effectively preserves superior individuals, but because the selection is based on random numbers, significant randomness may occur. Tournament selection involves randomly selecting a certain number of individuals (called the tournament size) to compete, and then choosing the individual with the best fitness from the winners as the parent. By adjusting the tournament size, it can control the level of competition among individuals, which is beneficial for maintaining population diversity. However, it can also lead to selection bias, with higher-fit individuals being more likely to be selected, potentially causing premature convergence. Considering all factors, this scheme uses roulette wheel selection, sacrificing some convergence speed for greater algorithmic exploration.
[0167] Crossover operations can be performed using three methods: multi-point crossover, sequential crossover, and uniform crossover. The basic idea of multi-point crossover is to randomly select multiple crossover points and exchange gene segments between two parent individuals at these points to generate two offspring individuals. The basic idea of sequential crossover is to select a continuous gene segment as the reserved region and then fill the offspring with it sequentially from another parent to generate two offspring individuals. The basic idea of uniform crossover is to randomly select each gene and exchange the corresponding gene at a certain probability to generate two offspring individuals.
[0168] Mutation operations are performed using multipoint mutation, uniform mutation, and displacement mutation. The basic idea of multipoint mutation is to randomly select multiple gene loci and change the values of these loci, introducing random mutations in multiple genes. The basic idea of uniform mutation is to mutate each gene locus with a certain probability, usually replacing it with a random new value. The basic idea of displacement mutation is to randomly select a gene segment, move it to another position, and then fill the vacancy.
[0169] This scheme utilizes heuristic rules for machine priority, initial tool numbering, and tool change to generate a three-layer real-number encoding. It then employs a combination of heuristic information and random strategies to generate the initial population for the genetic algorithm. Based on this, a heuristic-based genetic algorithm is constructed to solve the problem, comprehensively considering tool life and quantity, tool size, and machine tool magazine capacity, thereby improving scheduling optimization. By comparing the algorithm with PSO (Particle Swarm Optimization), VNS (Variable Neighborhood Search), and their hybrid algorithms (GA-PSO, GA-VNS, PSO-VNS, and GA-PSO-VNS hybrid algorithms), experiments are designed to compare their performance. Experimental results show that the heuristic-based genetic algorithm achieves slightly better results than the PSO algorithm and has a significantly faster solution time than the VNS algorithm. Furthermore, heuristic information greatly aids in optimizing the value; almost all individuals in the population with optimal values are generated from the initial population produced by heuristic information.
[0170] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.
Claims
1. A method for generating workshop tool scheduling rules based on genetic algorithms, characterized in that: Includes the following steps: S1: Utilizing the set of workpieces in the machine The process set of the workpiece set , workpiece process Processing time Number of processes Machine serial number Tool number The number of secondary tools (h) and tool life Construct a scheduling model that minimizes the maximum completion time and minimizes the number of tool changes; S2: Obtain the priority of each machine based on the heuristic rule of machine priority. ; S3: Assign tools to each machine according to the heuristic rules of the tool number of the initial tool set and the tool number of the tool change; S4: Output the tool allocation combination for each machine machining task set; S5: The machine number, the initial tool set number, and the tool change number are respectively encoded with real numbers to form three gene chains; S6: The initial population is formed using the machine priority heuristic rule, the initial tool set tool number heuristic rule, and the tool change tool number heuristic rule. Step S6 includes the following sub-steps: S61: Initialize environment and information; S62: Obtain the heuristic rules for machine priority, the heuristic rules for the tool number of the initial tool set, and the heuristic rules for the tool number of the tool change, and generate uniform distribution probabilities based on the number of the corresponding heuristic rules; perform roulette wheel selection based on the probability distribution to select the population generation rule; obtain the real number encoding of the gene chain based on the selected population generation rule; S7: Evolve the initial population, where the evolution includes roulette wheel selection, crossover, and mutation operations, to obtain the optimal population individuals that minimize the maximum completion time and the number of tool changes.
2. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 1, characterized in that, In step S2, the priority of each machine is obtained. Before the next step, the following steps will also be performed: initialize the time step on each machine. Obtain the set of workpieces on each machine. Process set Obtain the machine serial number The machine at the current time step workpiece process Processing time Set of secondary tool numbers and tool life .
3. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 2, characterized in that, Step S2 includes the following sub-steps: S21: Obtain the set of workpieces on each machine Process set and its processing time Initialize to set the machine number ; S22: Determine the machine serial number Is it equal to the maximum number of machines? If so, proceed to step S26; S23: Execution ; Total machine hours ;in For the workpiece number, For the last workpiece, This is the process number. This is the last process; S24: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S25; otherwise, update the process. Then proceed to step S23; S25: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S22; otherwise, update the workpiece. and update process Then proceed to step S23; S26: Utilize the total working hours of all machines The value is used to assign machine priorities based on a machine priority heuristic. The machine priority heuristic rules include the PLPT rule, which prioritizes machines with longer total working hours, and the PSPT rule, which prioritizes machines with shorter total working hours. S27: Output the machine priorities of each machine under different machine priority heuristic rules. value.
4. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 3, characterized in that, In step S3, assigning tools to each machine according to the heuristic rule of the tool number in the initial tool set includes the following sub-steps: S31: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S32. S32: Execution ,like Then update , , Then proceed to step S33; where For tool life, Number the machine The machine at the current time step workpiece process Processing time; S33: Obtain the current time step using a heuristic rule based on the tool number of the initial tool set. machine workpieces Process knives Allocation and combination; S34: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S35; otherwise, update the process. Then proceed to step S33; S35: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S36; otherwise, update the workpiece. and update process Then proceed to step S33; S36: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
5. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 4, characterized in that, In step S3, assigning tools to each machine according to the heuristic rule of the tool number during tool changing includes the following sub-steps: S37: Get the current priority machine workpiece set and process set Determine if the current machine is the lowest priority machine. If so, proceed to step S4; otherwise, proceed to step S38. S38: Execution ,like Then update , and Then proceed to step S39; where For tool life, Number the machine The machine at the current time step workpiece process Processing time, Number the machine The machine at the current time step workpiece process The remaining processing time; S39: Obtain the current time step using a heuristic rule based on the tool number of the tool changer. machine workpieces Process Remaining process time knife pairing Assign combinations and proceed to step S310; S310: Determine the current process Is this the current workpiece? The last process If yes, proceed to step S311; otherwise, update the process. Then proceed to step S39; S311: Determine the current workpiece Is this the last workpiece? If yes, proceed to step S312; otherwise, update the workpiece. and update process Then proceed to step S39; S312: Determine the current machine number Is the machine the lowest priority machine? If yes, proceed to step S4; otherwise, update. And then move on to the next priority machine.
6. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 5, characterized in that, Step S33 includes the following sub-steps: S331: Obtain the machine At the current time step workpiece process Processing time Set of secondary tool numbers and tool life ; S332: Combining the rules KTLL (lowest remaining tool life priority), KTHL (highest remaining tool life priority), and KTLEPT (tool life equal to operation time priority), we obtain the KTLL tool scheduling rule, KTHL tool scheduling rule, KTHL&KTLEPT tool scheduling rule, and KTLL&KTLEPT tool scheduling rule. Tools are then allocated according to these rules. Give the current time step machine workpieces Process It also outputs the initial tool allocation under different tool scheduling rules. Allocation and combination.
7. The method for generating workshop tool scheduling rules based on genetic algorithms according to claim 6, characterized in that, Step S39 includes the following sub-steps: S391: Obtain the machine At the current time step workpiece process Remaining processing time Set of secondary tool numbers and tool life ; S392: Machine workpieces process Divided into processed steps and unprocessed processes ; S393: Combining the minimum remaining tool life priority KTLL rule, the maximum remaining tool life priority KTHL rule, and the tool-equivalent operation time priority KTLEPT rule, we obtain the KTLL tool scheduling rule, the KTHL tool scheduling rule, the KTHL & KTLEPT tool scheduling rule, and the KTLL & KTLEPT tool scheduling rule. Tools are then allocated according to these rules. For unprocessed processes It also outputs the tool during tool change under different tool scheduling rules. Allocation and combination.
Citation Information
Patent Citations
Cutter joint dynamic scheduling method for complex profile intelligent production unit tasks
CN114442578A
Batch scheduling method and system of hybrid genetic algorithm and ant colony algorithm
CN116822894A