Matrix manufacturing workshop vehicle path planning method and device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2023-05-30
- Publication Date
- 2026-08-07
AI Technical Summary
在该调度方法下,控制系统根据生产设备呼叫时间规划AGV调度顺序,该方法容易导致绕路,使缓冲器的总等待时间大大延长
[0061]This invention provides a method, apparatus, electronic device, and storage medium for vehicle path planning in a multi-matrix manufacturing workshop. The matrix manufacturing workshop includes multiple AGVs and multiple tasks. Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using a nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as an initial population. An improved genetic algorithm is used to iteratively process the initial population until the iteration conditions are met, obtaining multiple AGV paths with the minimum total cost. The iterative processing of the initial population using the improved genetic algorithm includes: updating the initial population using crossover and mutation operations; based on constraints, converting the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; based on the retained n chromosome vectors, merging the path with the fewest tasks in the path solutions into other paths to obtain merged chromosome vectors; and using the merged chromosome vectors as the initial population for the next iteration. When initializing the population, travel distance and delivery time are used as evaluation indicators. By using the nearest neighbor algorithm and the random algorithm to obtain high-quality initial path solutions, the improved genetic algorithm can be effectively guided to perform efficient search, which is conducive to obtaining the optimal solution. By using the improved genetic algorithm to comprehensively schedule multiple AGVs, detours are avoided, and on-time delivery is ensured over shorter distances.
Smart Images

Figure CN116736847B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent manufacturing technology and intelligent computing technology, specifically to a method, apparatus, electronic device, and computer-readable storage medium for vehicle path planning in a matrix manufacturing workshop. Background Technology
[0002] With the rapid development of social productivity and technology, intelligent manufacturing workshops have become an inevitable trend in the development of future industrial production lines. In the intelligent manufacturing industry, vehicle routing is one of the core problems in logistics transportation and transportation organization optimization, attracting significant attention from researchers and manufacturing enterprises. For vehicle routing planning, most enterprises adopt a first-come, first-served principle and the shortest path method for workshop planning. Under this scheduling method, the control system plans the AGV scheduling order based on the production equipment's call time. This method easily leads to detours, significantly extending the total waiting time of the buffers. Considering that this problem is an NP-hard combinatorial optimization problem, heuristic and metaheuristic methods are more suitable than exact algorithms.
[0003] For combinatorial optimization problems, combining multiple intelligent optimization algorithms is one of the important means to improve the performance of algorithm solutions. Therefore, how to effectively combine the mechanisms of multiple algorithms and extract the local search methods of various algorithms for effective combination has become one of the key issues in current research on vehicle routing problems. Summary of the Invention
[0004] To address at least one of the aforementioned technical problems, the present invention provides a method, apparatus, electronic device, and computer-readable storage medium for vehicle path planning in a matrix manufacturing workshop.
[0005] The first objective of this invention is to provide a vehicle path planning method for a matrix manufacturing workshop.
[0006] The second objective of this invention is to provide a vehicle path planning device for a matrix manufacturing workshop.
[0007] A third objective of this invention is to improve an electronic device.
[0008] A fourth objective of this invention is to provide a computer-readable storage medium.
[0009] The first objective of this invention can be achieved by adopting the following technical solution:
[0010] A vehicle path planning method for a matrix manufacturing workshop, the matrix manufacturing workshop including multiple AGVs and multiple tasks, the method comprising:
[0011] Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using the nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as the initial population.
[0012] An improved genetic algorithm is used to iteratively process the initial population until the iteration condition is met, thereby obtaining multiple AGV paths with the minimum total cost.
[0013] The iterative processing of the initialized population using an improved genetic algorithm includes:
[0014] The initial population is updated using crossover and mutation operations;
[0015] Based on the constraints, the chromosome vectors in the updated population are transformed into path solutions for AGVs. The total cost of the path solutions is calculated, and the n chromosome vectors with the minimum total cost are retained as offspring.
[0016] Based on the retained n chromosome vectors, the path with the fewest tasks in the path solution is merged into the other paths to obtain the merged chromosome vector; the merged chromosome vector is used as the initial population for the next iteration.
[0017] Furthermore, the step of generating n chromosome vectors based on the AGV's travel distance and the task's delivery time using a nearest neighbor algorithm and a random algorithm includes:
[0018] Based on the AGV's travel distance and the task's delivery time, n1 chromosome vectors are generated using the nearest neighbor algorithm; if n is even, then n1 = n / 2, otherwise n1 = int(n / 2) + 1;
[0019] Generate an integer (n / 2) chromosome vector using a random algorithm;
[0020] The chromosome vectors generated by the nearest neighbor algorithm and the chromosome vectors generated by the random algorithm are merged into a complete set of n chromosome vectors, which are used as the initial population.
[0021] Furthermore, the step of generating n1 chromosome vectors using a nearest neighbor algorithm based on the AGV's travel distance and the task's delivery time includes:
[0022] Based on the AGV's travel distance, the task's delivery time, and Value, calculate fitness value; where, A weighted parameter representing the balance between travel distance and delivery time;
[0023] Find the task with the lowest fitness value as the next service target;
[0024] If all tasks are assigned, then all tasks form a chromosome vector in service order; otherwise, the location of the service object is taken as the current position of the AGV, and the result is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations;
[0025] If n1 chromosome vectors have been generated, end the operation; otherwise, update. The value is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations.
[0026] Furthermore, the updating of the initialized population using crossover and mutation operations includes:
[0027] Two chromosome vectors are randomly selected from the population as parents, and a crossover operation is used to generate offspring from the two chromosome vectors.
[0028] The two chromosome vectors generated by the crossover operation are mutated to generate new chromosome vectors.
[0029] If crossover and mutation operations have been performed n times, then all 2n newly generated chromosome vectors are used as the updated population; otherwise, two chromosome vectors are randomly selected from the population as parents, and subsequent operations are performed.
[0030] Furthermore, the mutation operation specifically includes:
[0031] Select two connected sets of l tasks from the chromosome vector and swap these two tasks to obtain a new chromosome vector, where l takes any value from {1,2,3}.
[0032] Further, the step of randomly selecting two chromosome vectors from the population as parents and generating offspring from the two chromosome vectors using a crossover operation includes:
[0033] One of the two chromosome vectors is taken as the first chromosome vector, and the first task of the first chromosome vector is taken as the reference task; the other chromosome vector is moved from left to right until the first task is consistent with the reference task.
[0034] For the first chromosome vector and the moved chromosome vector, in When setting values, the distance traveled for the first two tasks, the delivery time of the tasks, and the values are based on the chromosome vector. The fitness values of the first two tasks for each of the two chromosome vectors are calculated. The second task of the chromosome vector with the smaller fitness value is selected as the reference task. The other chromosome vector is moved from left to right while keeping the first task unchanged until the second task matches the reference task. At this point, the first two tasks of the two chromosome vectors are identical. The two chromosome vectors with identical first two tasks are considered the descendants of the two chromosome vectors. This represents the weighting parameter that balances travel distance and delivery time.
[0035] Furthermore, the constraints include time window constraints and loading constraints. The time window constraint requires the AGV to reach the specified task within the time window of the task's material request time and delivery time. The loading constraints mean that the total weight of materials required for all tasks served by each AGV must not exceed the total loading capacity of each AGV.
[0036] The updated population includes 2n chromosome vectors;
[0037] Based on the constraints, a chromosome vector in the updated population is transformed into a path solution for AGVs, including:
[0038] Sequentially determine whether multiple tasks in the chromosome vector satisfy the aforementioned constraints;
[0039] If the conditions are met, the current task is added to the current AGV path; otherwise, a new path is generated and the current task is added to the new path.
[0040] If all tasks have been traversed, the AGV path solution corresponding to the chromosome vector is obtained.
[0041] Furthermore, the step of merging the path with the fewest tasks in the path solution into other paths based on the retained n chromosome vectors includes:
[0042] Find the optimal number of AGVs to use from n chromosome vectors. and the current number of AGVs in use. ;
[0043] like < If the condition is met, the operation ends; otherwise, continue with the subsequent operations.
[0044] Based on the number of customers on each route The routes are sorted from largest to smallest;
[0045] Minimize the number of customers Insert route into other Among the routes;
[0046] If the constraints are not met, then: If return > If the AGV fails to complete the task, it will continue with subsequent operations; otherwise, the operation will end. The constraints include time window constraints and loading constraints. The time window constraint requires the AGV to complete the specified task within the time window of the task's material call time and delivery time. The loading constraint means that the total weight of materials required for all tasks served by the AGV must not exceed the total loading capacity.
[0047] Furthermore, the total cost of the path solution includes the AGV's operating cost. Usage cost and the time cost of punishment The formulas for calculating each cost are as follows:
[0048]
[0049]
[0050]
[0051] Where m represents the number of tasks, and K represents the total number of AGVs; Indicates task and tasks The driving distance between them; Used to represent the relationship between the k-th AGV and tasks i and j, when This indicates that the path of the k-th AGV is from task i to task j; otherwise, it means that the k-th AGV has not passed through task i and task j. This represents the unit cost of AGV operation; This indicates the cost of calling a single AGV; This indicates the unit cost of the early arrival penalty for the AGV; Indicates the delivery time of task i; This represents the time when the k-th AGV arrives at task i.
[0052] The second objective of this invention can be achieved by adopting the following technical solution:
[0053] A vehicle path planning device for a matrix manufacturing workshop, the matrix manufacturing workshop including multiple AGVs and multiple tasks, the device comprising:
[0054] The population initialization module is used to generate n chromosome vectors based on the AGV's travel distance and the task's delivery time using the nearest neighbor algorithm and a random algorithm, and to use the n chromosome vectors as the initial population.
[0055] The optimal path target generation module is used to iteratively process the initial population using an improved genetic algorithm until the iteration conditions are met, obtaining multiple AGV paths with the minimum total cost. The iterative processing of the initial population using the improved genetic algorithm includes: updating the initial population using crossover and mutation operations; based on constraints, transforming the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; merging the path with the fewest tasks among the path solutions into other paths based on the retained n chromosome vectors, obtaining merged chromosome vectors; and using the merged chromosome vectors as the initial population for the next iteration.
[0056] The third objective of this invention can be achieved by adopting the following technical solution:
[0057] An electronic device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the above-described matrix manufacturing workshop vehicle path planning method.
[0058] The fourth objective of this invention can be achieved by adopting the following technical solution:
[0059] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described matrix manufacturing workshop vehicle path planning method.
[0060] The present invention has the following advantages over the prior art:
[0061] This invention provides a method, apparatus, electronic device, and storage medium for vehicle path planning in a multi-matrix manufacturing workshop. The matrix manufacturing workshop includes multiple AGVs and multiple tasks. Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using a nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as an initial population. An improved genetic algorithm is used to iteratively process the initial population until the iteration conditions are met, obtaining multiple AGV paths with the minimum total cost. The iterative processing of the initial population using the improved genetic algorithm includes: updating the initial population using crossover and mutation operations; based on constraints, converting the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; based on the retained n chromosome vectors, merging the path with the fewest tasks in the path solutions into other paths to obtain merged chromosome vectors; and using the merged chromosome vectors as the initial population for the next iteration. When initializing the population, travel distance and delivery time are used as evaluation indicators. By using the nearest neighbor algorithm and the random algorithm to obtain high-quality initial path solutions, the improved genetic algorithm can be effectively guided to perform efficient search, which is conducive to obtaining the optimal solution. By using the improved genetic algorithm to comprehensively schedule multiple AGVs, detours are avoided, and on-time delivery is ensured over shorter distances. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0063] Figure 1 This is a flowchart of the vehicle path planning method in the matrix manufacturing workshop according to Embodiment 1 of the present invention;
[0064] Figure 2 This is a structural diagram of the matrix manufacturing workshop according to Embodiment 1 of the present invention;
[0065] Figure 3 The flowcharts for the nearest neighbor algorithm and the random algorithm in Embodiment 1 of the present invention are shown below;
[0066] Figure 4 This is a flowchart of the crossover mutation method in Embodiment 1 of the present invention;
[0067] Figure 5 This is a schematic diagram illustrating the principle of the cross operation in Embodiment 1 of the present invention;
[0068] Figure 6This is a schematic diagram illustrating the mutation operation in Embodiment 1 of the present invention;
[0069] Figure 7 This is a flowchart of the merging operation in Embodiment 1 of the present invention;
[0070] Figure 8 and Figure 9 This is the vehicle route planning result of Embodiment 1 of the present invention;
[0071] Figure 10 This is a structural block diagram of the vehicle path planning device for a matrix manufacturing workshop according to Embodiment 2 of the present invention;
[0072] Figure 11 This is a structural block diagram of the electronic device according to Embodiment 3 of the present invention. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be understood that the specific embodiments described are merely used to explain this application and are not intended to limit this application.
[0074] Example 1:
[0075] To solve the path planning problem of multiple AGVs in a matrix manufacturing workshop with time windows and loading constraints, such as Figure 1 As shown, this embodiment provides a multi-AGV path planning method for a matrix workshop, including the following steps:
[0076] S1. Population initialization based on nearest neighbor algorithm and random algorithm.
[0077] The initial population consists of n chromosome vectors.
[0078] Before performing step S1, determine the type of matrix manufacturing workshop, refer to... Figure 2 The matrix manufacturing workshop used in this embodiment consists of K AGVs and m tasks. Each task, or workstation, sends a request to the control center during production based on the remaining material in its task buffer. Each workstation comprises multiple CNC machine tools and a buffer zone. The request information includes material call time, delivery time, and buffer inventory. The total cost includes the AGV's operating cost. Usage cost and the time cost of punishment The formulas for calculating each cost are as follows:
[0079]
[0080]
[0081]
[0082] in, Indicates task and tasks The driving distance between them; Used to represent the relationship between AGVk and tasks i and j, when This means that the path of AGVk is from task i to task j; otherwise, it means that AGVk does not pass through task i and task j. This represents the unit cost of AGV operation; This indicates the cost of calling a single AGV; This indicates the unit cost of the early arrival penalty for the AGV; Indicates the delivery time of task i; This indicates the time when AGVk arrives at task i; AGVk represents the k-th AGV.
[0083] In this embodiment, the basic parameters of the matrix workshop are set as follows: the number of AGVs K is 10, the number of tasks m is 10 and 20 respectively, the total inventory of the AGV buffer is 50, and the total load capacity of the AGVs is 250. =1, It is 200. It is 0.1.
[0084] Before executing step S1, the genetic algorithm parameters are initialized. In this embodiment, the basic parameters of the algorithm are set as follows: the number of chromosomes n is 150, and the algorithm termination condition is a maximum running time of 5 seconds.
[0085] Furthermore, such as Figure 3 As shown, step S1 obtains n chromosome vectors using the nearest neighbor algorithm and a random algorithm, specifically including:
[0086] S101. Based on the nearest neighbor algorithm, calculate the travel distance between the AGV and the unassigned task according to the AGV's position in the manufacturing workshop (initial position is the warehouse).
[0087] S102. Calculate the fitness value of the AGV and the unassigned tasks using the following formula:
[0088]
[0089] in, Indicates the current position of the AGV With the task The driving distance between them Where 0 represents a warehouse; Indicates the balance between driving distance and delivery time The weight parameters.
[0090] S103. Find the task with the lowest fitness value as the next service object, and take the location of the service object as the current position of the AGV. Continue to execute steps S101~S102 until all tasks are assigned. At this time, the service order of all tasks forms a chromosome vector.
[0091] Performing steps S101-S103 once generates one chromosome vector; repeating this process... The next steps are S101~S103, and during the execution process, the values in step S102 are updated. Values can then be generated Chromosome vector. Updated Generate chromosome vectors with diversity.
[0092] In one embodiment, The value to be selected is Between equal parts, i.e. Each value corresponds to a chromosome vector.
[0093] S104, Generated by a random algorithm Chromosome vectors.
[0094] The calculation formula is as follows:
[0095]
[0096] in, Indicates generation indivual Random numbers between The random numbers are returned in ascending order, and the sorting numbers can be used as a chromosome vector. For example, if a set of random numbers is generated: 0.2 0.4 0.1 0.5 0.3, the corresponding sorting numbers are 2 4 1 5 3 (0.1 is the smallest, so the sorting is 1), that is, the generated chromosome vector is [2,4,1,5,3].
[0097] The above formula can be used to generate Chromosome vectors.
[0098] The nearest neighbor algorithm generated Chromosome vectors and random algorithms The chromosome vectors are merged into a complete set of n chromosome vectors, which are used as the initial population.
[0099] If n in step S1 is even, then it is generated using both the nearest neighbor algorithm and the random algorithm. A chromosome vector; if n is odd, an int(n) is generated using the nearest neighbor algorithm. ) + 1 chromosome vector, generated by a random algorithm as an int( ) chromosome vectors.
[0100] This embodiment sorts the tasks based on the nearest neighbor algorithm and the random algorithm to obtain an initial population. During the initialization of the population, the travel distance and delivery time are used as evaluation indicators to obtain high-quality initial path solutions, effectively guiding the algorithm to perform efficient search and facilitating the acquisition of the optimal solution.
[0101] S2. The initial population is updated using the crossover and mutation method.
[0102] Furthermore, such as Figure 4 As shown, step S2 specifically includes:
[0103] S201. Randomly select two chromosome vectors from the n chromosome vectors of the population as parents, and use crossover operation to generate offspring from the two chromosome vectors.
[0104] A new generation is generated by crossing over two chromosome vectors to inherit the basic characteristics of the parent generation, specifically including:
[0105] (1) Take the first task of the first chromosome vector as the reference task, and move the other chromosome vector from left to right according to the reference task until the first task of the other chromosome vector is consistent with the reference task; take the first chromosome vector and the moved chromosome vector as the operation objects of the next step;
[0106] (2) Calculate the vectors of the two chromosomes in The fitness values of the first two tasks are used to select the second task of the group with the smaller fitness value as the reference task. The chromosome vectors of the other group are moved from left to right according to the reference task (keeping the first task unchanged) until the first two tasks of the other group of chromosome vectors are consistent with the chromosome vector with the smaller fitness value. At this time, the first two tasks of the two chromosome vectors are consistent. The two chromosome vectors with consistent first two tasks are taken as the offspring of the two chromosome vectors.
[0107] The process of generating two new chromosome vectors using crossover is described in [link to documentation]. Figure 5 .
[0108] S202. Perform mutation operations on the two chromosome vectors generated by the crossover operation to generate new chromosome vectors.
[0109] The mutation operation is as follows:
[0110] Randomly select one from {1,2,3} and assign it to l. Select two consecutive sets of l tasks from the chromosome vector and swap these two sets of tasks to obtain a new chromosome vector.
[0111] The process of generating a new chromosome through mutation is described in [reference needed]. Figure 6 .
[0112] Determine whether steps S201 to S202 have been executed n times. If so, proceed to step S203; otherwise, return to step S201 and continue with the subsequent operations.
[0113] S203. By performing the crossover mutation method in steps S201 to S202, 2n chromosome vectors are obtained.
[0114] S204. Based on the constraints, transform the chromosome vector into a path solution for the AGV, calculate the total cost of the path solution, and retain the better chromosome vector as the offspring.
[0115] The constraints include time window constraints and loading constraints. The time window constraint requires the AGV to complete the specified task within the time window of the task's material request and delivery time. The loading constraint refers to the total loading capacity of each AGV. The total weight of materials required for all tasks served by an AGV must not exceed the total loading capacity.
[0116] Furthermore, step S204 specifically includes:
[0117] (1) For the chromosome vector after crossover mutation, determine in turn whether the tasks in the chromosome vector satisfy the constraints;
[0118] (2) If the selected task meets the constraints, then add it to the current AGV path; otherwise: regenerate a path and add the task to the new path;
[0119] (3) Through the above process, the 2n chromosome vectors are transformed into the path schemes of 2n AGVs.
[0120] S205. Calculate the total cost of the path solution and select the one with the minimum total cost. Each chromosome vector represents a chromosome descendant.
[0121] The formula for calculating total cost is as follows:
[0122]
[0123] This embodiment fully explores and utilizes the high-quality information in the parent chromosomes through the crossover mutation method.
[0124] S3. Further optimize the path solution of the AGV through merging operations.
[0125] The merging operation involves combining the path with the fewest tasks from the path solutions into the other paths. Tasks from the path with the fewest tasks are sequentially added to the other paths, and if the constraints are met, the corresponding chromosome vector is updated.
[0126] Furthermore, such as Figure 7 As shown, step S3 specifically includes:
[0127] S301. Obtain the optimal number of AGVs used in the population. and the current number of AGVs in use. ;
[0128] like > If the condition is met, then step S302 is executed; otherwise, the operation ends.
[0129] S302, Based on the number of customers on each route The routes are sorted from largest to smallest;
[0130] S303, Try to minimize the number of customers Insert route into other In this route; if the constraints are not met, then update. , return, if > And continue with step S302;
[0131] If the constraints are met, the operation ends.
[0132] The chromosome vector after the merging operation is used as the initial population for the next iteration.
[0133] This embodiment minimizes the number of AGVs used in the solution by merging operations, thereby obtaining multiple AGV paths with the lowest total cost in the matrix manufacturing workshop.
[0134] S4. Output the global optimal solution based on the iteration termination condition.
[0135] In this embodiment, after executing steps S1 to S3, it is determined whether the iteration termination condition is met. If the iteration termination condition is met, the global optimal solution is output, which is the optimal value of the target path to be determined. If the iteration termination condition is not met, the process proceeds to the next iteration, that is, steps S2 to S3 are executed again.
[0136] The iteration termination condition can be set to reach the preset maximum number of iterations or the maximum running time.
[0137] Figure 8 and Figure 9 This is the path planning result for multiple AGVs in the matrix manufacturing workshop. In the diagram, circles represent the location of tasks, △ represents the warehouse location (default is (0,0), and numbers represent the service order of the AGVs. Figure 8 The task information for the matrix manufacturing workshop is shown in Table 1.
[0138] Table 1. Matrix Manufacturing Workshop Task Information Table
[0139]
[0140] In this embodiment, the obtained vehicle routing plan can be applied to the logistics transportation of a matrix manufacturing workshop. This means setting the material transportation route of the matrix manufacturing workshop to the optimal solution determined by executing the above steps. With the matrix manufacturing workshop type remaining unchanged, effectively planning the AGV's travel path and the number of AGVs used can reduce labor costs and improve workshop production efficiency.
[0141] In this embodiment, firstly, the tasks are sorted using the nearest neighbor algorithm and a random algorithm to obtain an initial population. During the initialization process, the travel distance and delivery time are used as evaluation indicators to obtain high-quality initial path solutions, which can effectively guide the improved genetic algorithm to perform efficient searches and facilitate the acquisition of the optimal solution. Secondly, the improved genetic algorithm fully mines and utilizes the high-quality information in the parent chromosomes through crossover and mutation operations. Finally, the improved genetic algorithm minimizes the number of AGVs used in the solution through a merging operation.
[0142] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.
[0143] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of execution of the described steps may be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0144] Example 2:
[0145] like Figure 10As shown, this embodiment provides a vehicle path planning device for a matrix manufacturing workshop. The matrix manufacturing workshop includes multiple AGVs and multiple tasks. The device includes a population initialization module 1001 and a path target optimal generation module 1002, wherein:
[0146] The population initialization module 1001 is used to generate n chromosome vectors based on the AGV's travel distance and the task's delivery time using the nearest neighbor algorithm and a random algorithm, and to use the n chromosome vectors as the initial population.
[0147] The optimal path target generation module 1002 is used to iteratively process the initialized population using an improved genetic algorithm until the iteration conditions are met, obtaining multiple AGV paths with the minimum total cost. The iterative processing of the initialized population using the improved genetic algorithm includes: updating the initialized population using crossover and mutation operations; based on the constraints, converting the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; merging the path with the fewest tasks in the path solutions into other paths according to the retained n chromosome vectors, obtaining merged chromosome vectors; and using the merged chromosome vectors as the initialized population for the next iteration.
[0148] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the device provided in this embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0149] Example 3:
[0150] This embodiment provides an electronic device, which can be a computer, such as... Figure 11 As shown, the system includes a processor 1102, a memory, an input device 1103, a display 1104, and a network interface 1105 connected via a system bus 1101. The processor provides computing and control capabilities. The memory includes a non-volatile computer-readable storage medium 1106 and internal memory 1107. The non-volatile computer-readable storage medium 1106 stores an operating system, computer programs, and a database. The internal memory 1107 provides an environment for the operation of the operating system and computer programs in the non-volatile computer-readable storage medium. When the processor 1102 executes the computer programs stored in the memory, it implements the vehicle path planning method for the matrix manufacturing workshop described in Embodiment 1, as follows:
[0151] Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using the nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as the initial population.
[0152] An improved genetic algorithm is used to iteratively process the initial population until the iteration condition is met, thereby obtaining multiple AGV paths with the minimum total cost.
[0153] The iterative processing of the initialized population using an improved genetic algorithm includes:
[0154] The initial population is updated using crossover and mutation operations;
[0155] Based on the constraints, the chromosome vectors in the updated population are transformed into path solutions for AGVs. The total cost of the path solutions is calculated, and the n chromosome vectors with the minimum total cost are retained as offspring.
[0156] Based on the retained n chromosome vectors, the path with the fewest tasks in the path solution is merged into the other paths to obtain the merged chromosome vector; the merged chromosome vector is used as the initial population for the next iteration.
[0157] Example 4:
[0158] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the vehicle path planning method for the matrix manufacturing workshop described in Embodiment 1 above, as follows:
[0159] Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using the nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as the initial population.
[0160] An improved genetic algorithm is used to iteratively process the initial population until the iteration condition is met, thereby obtaining multiple AGV paths with the minimum total cost.
[0161] The iterative processing of the initialized population using an improved genetic algorithm includes:
[0162] The initial population is updated using crossover and mutation operations;
[0163] Based on the constraints, the chromosome vectors in the updated population are transformed into path solutions for AGVs. The total cost of the path solutions is calculated, and the n chromosome vectors with the minimum total cost are retained as offspring.
[0164] Based on the retained n chromosome vectors, the path with the fewest tasks in the path solution is merged into the other paths to obtain the merged chromosome vector; the merged chromosome vector is used as the initial population for the next iteration.
[0165] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0166] In summary, this invention provides a method, apparatus, electronic device, and storage medium for vehicle path planning in a multi-matrix manufacturing workshop. The matrix manufacturing workshop includes multiple AGVs and multiple tasks. The method includes: generating n chromosome vectors based on the AGV's travel distance and the task's delivery time using a nearest neighbor algorithm and a random algorithm, and using these n chromosome vectors as an initial population; iteratively processing the initial population using an improved genetic algorithm until the iteration conditions are met to obtain multiple AGV paths with the minimum total cost; the iterative processing of the initial population using the improved genetic algorithm includes: updating the initial population using crossover and mutation operations; based on constraints, converting the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; merging the path with the fewest tasks in the path solutions into other paths based on the retained n chromosome vectors to obtain merged chromosome vectors; and using the merged chromosome vectors as the initial population for the next iteration. First, the population is initialized using the nearest neighbor and random methods, with travel distance and delivery time used as evaluation metrics during initialization to obtain high-quality initial path solutions. This effectively guides the algorithm for efficient search and facilitates the acquisition of the optimal solution. Second, crossover and mutation operations are used to fully mine and utilize the valuable information in the parent chromosomes. Finally, a merging operation minimizes the number of AGVs used in the path solution. The method provided by this invention enables comprehensive scheduling of multiple AGVs in a short time, avoiding detours and ensuring on-time delivery over shorter distances, thus achieving higher efficiency in workshop automation.
[0167] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A vehicle path planning method for a matrix manufacturing workshop, wherein the matrix manufacturing workshop includes multiple AGVs and multiple tasks, characterized in that, The method includes: Based on the AGV's travel distance and the task's delivery time, n chromosome vectors are generated using the nearest neighbor algorithm and a random algorithm, and these n chromosome vectors are used as the initial population. An improved genetic algorithm is used to iteratively process the initial population until the iteration condition is met, thereby obtaining multiple AGV paths with the minimum total cost. The step of generating n chromosome vectors based on the AGV's travel distance and the task's delivery time using a nearest neighbor algorithm and a random algorithm includes: Based on the AGV's travel distance and the task's delivery time, n1 chromosome vectors are generated using the nearest neighbor algorithm; if n is even, then n1 = n / 2, otherwise n1 = int(n / 2) + 1; Generate an integer (n / 2) chromosome vector using a random algorithm; The chromosome vectors generated by the nearest neighbor algorithm and the chromosome vectors generated by the random algorithm are merged into a complete set of n chromosome vectors, which are used as the initial population. The step of generating n1 chromosome vectors using a nearest neighbor algorithm based on the AGV's travel distance and the task's delivery time includes: Based on the AGV's travel distance, the task's delivery time, and Value, calculate fitness value; where, A weighted parameter representing the balance between travel distance and delivery time; Find the task with the lowest fitness value as the next service target; If all tasks are assigned, then all tasks form a chromosome vector in service order; otherwise, the location of the service object is taken as the current position of the AGV, and the result is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations; If n1 chromosome vectors have been generated, end the operation; otherwise, update. The value is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations; The step of iteratively processing the initialized population using an improved genetic algorithm includes: The initial population is updated using crossover and mutation operations; Based on the constraints, the chromosome vectors in the updated population are transformed into path solutions for AGVs. The total cost of the path solutions is calculated, and the n chromosome vectors with the minimum total cost are retained as offspring. Based on the retained n chromosome vectors, the path with the fewest tasks in the path solution is merged into the other paths to obtain the merged chromosome vector; the merged chromosome vector is used as the initial population for the next iteration.
2. The vehicle path planning method for a matrix manufacturing workshop according to claim 1, characterized in that, The population initialized using crossover and mutation operations includes: Two chromosome vectors are randomly selected from the population as parents, and a crossover operation is used to generate offspring from the two chromosome vectors. The two chromosome vectors generated by the crossover operation are mutated to generate new chromosome vectors. If crossover and mutation operations have been performed n times, then all 2n newly generated chromosome vectors are used as the updated population; otherwise, two chromosome vectors are randomly selected from the population as parents, and subsequent operations are performed.
3. The vehicle path planning method for a matrix manufacturing workshop according to claim 2, characterized in that, The mutation operation is specifically as follows: Select two connected sets of l tasks from the chromosome vector and swap these two tasks to obtain a new chromosome vector, where l takes any value from {1,2,3}.
4. The vehicle path planning method for a matrix manufacturing workshop according to claim 2, characterized in that, The step of randomly selecting two chromosome vectors from the population as parents and generating offspring from the two chromosome vectors using a crossover operation includes: One of the two chromosome vectors is taken as the first chromosome vector, and the first task of the first chromosome vector is taken as the reference task; the other chromosome vector is moved from left to right until the first task is consistent with the reference task. For the first chromosome vector and the moved chromosome vector, in When setting values, the distance traveled for the first two tasks, the delivery time of the tasks, and the values are based on the chromosome vector. The fitness values of the first two tasks of the two chromosome vectors are calculated respectively. The second task of the chromosome vector with the smaller fitness value is selected as the reference task. The other chromosome vector is moved from left to right while keeping the first task unchanged until the second task is consistent with the reference task. At this time, the first two tasks of the two chromosome vectors are consistent. The two chromosome vectors with consistent first two tasks are taken as the offspring of the two chromosome vectors.
5. The vehicle path planning method for a matrix manufacturing workshop according to claim 1, characterized in that, The constraints include time window constraints and loading constraints. The time window constraint requires the AGV to reach the specified task within the time window of the task's material request time and delivery time. The loading constraints mean that the total weight of materials required for all tasks served by each AGV must not exceed the total loading capacity of each AGV. The updated population includes 2n chromosome vectors; Based on the constraints, a chromosome vector in the updated population is transformed into a path solution for AGVs, including: Sequentially determine whether multiple tasks in the chromosome vector satisfy the aforementioned constraints; If the conditions are met, the current task is added to the current AGV path; otherwise, a new path is generated and the current task is added to the new path. If all tasks have been traversed, the AGV path solution corresponding to the chromosome vector is obtained.
6. The vehicle path planning method for a matrix manufacturing workshop according to claim 1, characterized in that, The step of merging the path with the fewest tasks in the path solution into other paths based on the retained n chromosome vectors includes: Find the optimal number of AGVs to use from n chromosome vectors. and the current number of AGVs in use. ; like < If the condition is met, the operation ends; otherwise, continue with the subsequent operations. Based on the number of customers on each route The routes are sorted from largest to smallest; Minimize the number of customers Insert route into other Among the routes; If the constraints are not met, then: If return > If the AGV fails to complete the task, it will continue with subsequent operations; otherwise, the operation will end. The constraints include time window constraints and loading constraints. The time window constraint requires the AGV to complete the specified task within the time window of the task's material call time and delivery time. The loading constraint means that the total weight of materials required for all tasks served by the AGV must not exceed the total loading capacity.
7. The vehicle path planning method for a matrix manufacturing workshop according to any one of claims 1 to 6, characterized in that, The total cost of the path solution includes the AGV's operating cost. Usage cost and the time cost of punishment The formulas for calculating each cost are as follows: ; ; ; Where m represents the number of tasks, and K represents the total number of AGVs; Indicates task and tasks The driving distance between them; Used to represent the relationship between the k-th AGV and tasks i and j, when This indicates that the path of the k-th AGV is from task i to task j; otherwise, it means that the k-th AGV has not passed through task i and task j. This represents the unit cost of AGV operation; This indicates the cost of calling a single AGV; This indicates the unit cost of the early arrival penalty for the AGV; Indicates the delivery time of task i; This represents the time when the k-th AGV arrives at task i.
8. A vehicle path planning device for a matrix manufacturing workshop, wherein the matrix manufacturing workshop includes multiple AGVs and multiple tasks, characterized in that, The device includes: The population initialization module is used to generate n chromosome vectors based on the AGV's travel distance and the task's delivery time using the nearest neighbor algorithm and a random algorithm, and to use the n chromosome vectors as the initial population. The optimal path target generation module is used to iteratively process the initial population using an improved genetic algorithm until the iteration conditions are met, obtaining multiple AGV paths with the minimum total cost. The iterative processing of the initial population using the improved genetic algorithm includes: updating the initial population using crossover and mutation operations; based on constraints, transforming the chromosome vectors in the updated population into AGV path solutions, calculating the total cost of the path solutions, and retaining the n chromosome vectors with the minimum total cost as offspring; merging the path with the fewest tasks among the path solutions into other paths based on the retained n chromosome vectors, obtaining merged chromosome vectors; and using the merged chromosome vectors as the initial population for the next iteration. The step of generating n chromosome vectors based on the AGV's travel distance and the task's delivery time using a nearest neighbor algorithm and a random algorithm includes: Based on the AGV's travel distance and the task's delivery time, n1 chromosome vectors are generated using the nearest neighbor algorithm; if n is even, then n1 = n / 2, otherwise n1 = int(n / 2) + 1; Generate an integer (n / 2) chromosome vector using a random algorithm; The chromosome vectors generated by the nearest neighbor algorithm and the chromosome vectors generated by the random algorithm are merged into a complete set of n chromosome vectors, which are used as the initial population. The step of generating n1 chromosome vectors using a nearest neighbor algorithm based on the AGV's travel distance and the task's delivery time includes: Based on the AGV's travel distance, the task's delivery time, and Value, calculate fitness value; where, A weighted parameter representing the balance between travel distance and delivery time; Find the task with the lowest fitness value as the next service target; If all tasks are assigned, then all tasks form a chromosome vector in service order; otherwise, the location of the service object is taken as the current position of the AGV, and the result is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations; If n1 chromosome vectors have been generated, end the operation; otherwise, update. The value is returned based on the AGV's travel distance, the task's delivery time, and... Continue with the subsequent operations.
Citation Information
Patent Citations
Improved genetic algorithm for path optimization
CN112001541A
AGV scheduling method based on iteration greedy evolution
CN113050644A