AGV task allocation method based on particle swarm genetic algorithm and related equipment
By using a particle swarm genetic algorithm based on real-number encoding, the problems of high computational complexity and difficulty in finding the global optimum in AGV task allocation are solved, achieving efficient task allocation and the ability to search for the global optimum.
Patent Information
- Application Number
- CN202512032380.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-01-27
AI Technical Summary
Existing technologies for AGV task allocation suffer from high computational complexity, long iteration time, and difficulty in finding the global optimal solution, especially in large-scale task scheduling scenarios where they cannot meet real-time requirements.
A particle swarm genetic algorithm based on real number encoding is adopted. By initializing the position and velocity vectors of the particle swarm and combining the particle swarm update rules with the genetic algorithm operations, the computational complexity is reduced and the search capability for the global optimum is improved.
It effectively reduces computational complexity, improves task allocation efficiency, avoids local optima, and achieves high computational efficiency and the ability to search for global optima.
Smart Images

Figure CN121414092A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of task scheduling technology, and more specifically, to an AGV task allocation method and related equipment based on particle swarm genetic algorithm. Background Technology
[0002] In modern intelligent manufacturing and logistics warehousing, task allocation optimization of Automated Guided Vehicle (AGV) systems is a key aspect of improving overall operational efficiency. In practical applications, multiple transportation tasks typically need to be assigned to multiple AGVs, each with different starting and destination positions, creating a complex multi-objective optimization problem. Traditional task allocation methods primarily employ intelligent optimization algorithms such as genetic algorithms or particle swarm optimization, but these still face significant technical bottlenecks in practical applications.
[0003] Existing encoding schemes often employ integer encoding, combining task numbers and AGV allocation identifiers into a large chromosome structure. While this encoding method can fully express the task allocation scheme, as the number of tasks and AGVs increases, the number of chromosome genes expands dramatically, significantly increasing the computational complexity of the algorithm and severely impacting operational efficiency. Particularly in large-scale task scheduling scenarios, this encoding method causes iterative computation time to increase exponentially, making it difficult to meet the requirements of real-time scheduling.
[0004] In terms of algorithmic characteristics, while traditional genetic algorithms are suitable for finding solutions in discrete space and are highly operable, their slow convergence speed is due to the lack of memory among individuals and the strong randomness of crossover and mutation operations. Particle swarm optimization (PSO), on the other hand, while offering advantages in fast convergence and high stability, suffers from insufficient randomness, making it prone to getting trapped in local optima and hindering the attainment of a globally optimal task allocation scheme.
[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention
[0006] The purpose of this application is to provide an AGV task allocation method and related equipment based on particle swarm genetic algorithm, which has high computational efficiency and the ability to search for the global optimal solution.
[0007] In a first aspect, this application provides an AGV task allocation method based on particle swarm genetic algorithm, used to assign multiple handling tasks to multiple AGVs. The method includes the following steps: A1. Based on the real number encoding modeling method, initialize the position vector and velocity vector of the particle swarm; the position vector and velocity vector of each particle in the particle swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be assigned; the position vector of each particle represents a task assignment scheme, and each element in the position vector is a real number with an integer part and a fractional part and corresponds to a task to be assigned. The integer part of the position vector element represents the AGV number to which the corresponding task to be assigned is assigned, and the fractional part represents the execution order of the corresponding task to be assigned in the assigned AGV; A2. Calculate the fitness value of each particle in the particle swarm according to the preset fitness function; A3. Based on the fitness value, determine the individual optimal position vector of each particle, as well as the global optimal position vector and the worst position vector of the particle swarm in this round; A4. Based on the preset particle swarm update rules, update the velocity vector of each particle according to the individual optimal position vector and the global optimal position vector, and update the position vector of each particle according to the updated velocity vector; A5. Using the global optimal position vector, perform a genetic algorithm operation on the updated position vector of the worst particle in this round to improve the position vector; the worst particle in this round is the particle corresponding to the worst position vector in this round. A6. Based on the satisfaction of the preset termination conditions, output the task allocation scheme corresponding to the globally optimal position vector, or return to step A2 for the next iteration.
[0008] Secondly, this application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in the AGV task allocation method based on particle swarm genetic algorithm as described above.
[0009] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the AGV task allocation method based on particle swarm genetic algorithm as described above.
[0010] Beneficial effects: The AGV task allocation method and related equipment based on particle swarm genetic algorithm provided in this application, by using real number encoding modeling to initialize the position vector and velocity vector of the particle swarm, and combining particle swarm update rules with genetic algorithm operations, effectively reduces computational complexity, improves task allocation efficiency, and avoids local optima, and has high computational efficiency and global optimal solution search capability. Attached Figure Description
[0011] Figure 1A flowchart of an AGV task allocation method based on particle swarm genetic algorithm provided in this application.
[0012] Figure 2 A schematic diagram of the structure of the electronic device provided in this application.
[0013] Figure 3 This is an example of the correspondence between particle position vectors and task allocation schemes.
[0014] Figure 4 This is an example diagram showing the correspondence between the fitness values of particles and task assignment schemes.
[0015] Figure 5 This is an example of a distribution diagram of loading and unloading points and AGVs for tasks to be assigned.
[0016] Figure 6 The image shows an example of task assignment.
[0017] Figure 7 This is an example of how particle swarm fitness changes with the number of iterations.
[0018] Labeling explanations: 301, processor; 302, memory; 303, communication bus. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0020] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0021] Please refer to Figure 1 This application discloses an AGV task allocation method based on particle swarm optimization (PSO) genetic algorithm in some embodiments, which is used to allocate multiple handling tasks to multiple AGVs. The method includes the following steps: A1. Based on the real number encoding modeling method, initialize the position vector and velocity vector of the particle swarm; the position vector and velocity vector of each particle in the particle swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be assigned; the position vector of each particle represents a task assignment scheme, and each element in the position vector is a real number with an integer part and a fractional part and corresponds to a task to be assigned. The integer part of the position vector element represents the AGV number to which the corresponding task to be assigned is assigned, and the fractional part represents the execution order of the corresponding task to be assigned in the assigned AGV; A2. Calculate the fitness value of each particle in the particle swarm according to the preset fitness function; A3. Based on the fitness value, determine the individual optimal position vector of each particle, as well as the global optimal position vector and the worst position vector of the particle swarm in this round; A4. Based on the preset particle swarm update rules, update the velocity vector of each particle according to the individual optimal position vector and the global optimal position vector, and update the position vector of each particle according to the updated velocity vector; A5. Using the globally optimal position vector, perform a genetic algorithm operation on the updated position vector of the worst particle in this round to improve the position vector; the worst particle in this round is the particle corresponding to the worst position vector in this round. A6. Based on the satisfaction of the preset termination conditions, output the task allocation scheme corresponding to the globally optimal position vector, or return to step A2 for the next iteration.
[0022] In particle swarm optimization, a swarm of particles refers to a group of particles. Each particle represents a potential solution and moves through the search space to find the optimal solution.
[0023] In the particle swarm optimization algorithm, the position vector refers to the fact that each particle has a position vector that represents its current position in the search space, i.e., a specific task allocation scheme.
[0024] In the particle swarm optimization algorithm, the velocity vector refers to the velocity vector that each particle has, which determines the direction and distance the particle moves in the next iteration.
[0025] The fitness function is used to evaluate the quality of the task assignment scheme represented by each particle in the particle swarm. For example, a smaller fitness value indicates a better task assignment scheme.
[0026] Among them, the individual optimal position vector is the best position vector that each particle has experienced in the iteration process so far.
[0027] The global optimal position vector is the best position vector that the entire particle swarm has experienced in the iterations so far.
[0028] The worst position vector in this round is the position vector corresponding to the particle with the worst fitness value (e.g., the largest fitness value) in the particle swarm in the current iteration.
[0029] Genetic algorithms typically involve crossover and mutation operations, which are used to improve the position vectors of particles, thereby enhancing the algorithm's global search capability and preventing it from getting trapped in local optima.
[0030] This application proposes an AGV task allocation method based on particle swarm optimization (PSO) genetic algorithm. The task allocation problem is mathematically modeled using real-number encoding, where the integer part of the real number represents the AGV assigned to each task, and the decimal part represents the order in which the AGVs execute the task. In this modeling method, the number of "genes" (i.e., the number of elements in the position vector) is consistent with the number of tasks to be assigned. Compared to integer encoding (where the number of genes equals the sum of the number of tasks to be assigned and the number of AGVs minus 1), this method effectively reduces the number of "genes," thus improving computational efficiency. Based on this real-number encoding model, a particle swarm optimization algorithm is used to solve the problem. This effectively utilizes the particle memory characteristics, fast convergence speed, and stable optimization process of the PSO algorithm. Simultaneously, crossover and mutation operations of a genetic algorithm are used to improve the "genes" of the particles, enhancing the algorithm's global search capability.
[0031] Specifically: First, in step A1, based on the real-number encoding modeling method, the position and velocity vectors of the particle swarm are initialized. The position and velocity vectors of each particle in the swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be assigned. Each particle's position vector represents a task allocation scheme. Each element in the position vector is a real number with an integer and a fractional part, corresponding to a task to be assigned. The integer part of the position vector element represents the AGV number to which the corresponding task is assigned, and the fractional part represents the execution order of the corresponding task within the assigned AGV. For example, the smaller the fractional part, the earlier the execution order. In one implementation, a fixed particle swarm size can be preset, and the initial position and velocity vectors of each particle can be randomly generated. For example, they can be randomly generated... Each task allocation scheme has a corresponding task allocation scheme, and corresponding task allocation schemes are generated accordingly. A 3D real vector, serving as the position vector for each particle, where The number of tasks to be assigned. The elements of the velocity vector can be randomly initialized within a preset range. In another implementation, the particle swarm size can be dynamically adjusted based on the number of tasks to be assigned and the number of AGVs, and an initial position vector can be generated using a heuristic method. For example, tasks can be initially assigned based on task priority or the initial position of the AGVs to generate a relatively optimal initial particle swarm.
[0032] Secondly, in step A2, the fitness value of each particle in the particle swarm is calculated according to a preset fitness function. The fitness function is used to evaluate the merits of each task allocation scheme. For example, the fitness function can be defined as the total task time of the AGV with the longest total task time required to complete the task among all AGVs, or the total task path length of the AGV with the longest total task path length required to complete the task among all AGVs. In one implementation, a simple linear function can be used as the fitness function; for example, the sum of the total task time or total task path length of all AGVs can be directly used as the fitness value. In another implementation, a non-linear function can be used as the fitness function; for example, the total task time or total task path length can be weighted to highlight the importance of certain key tasks or AGVs.
[0033] Next, in step A3, based on the fitness value, the individual optimal position vector for each particle, as well as the global optimal position vector and the worst position vector for the current round, are determined. The individual optimal position vector records the best position found by each particle itself, the global optimal position vector records the best position found by the entire particle swarm, and the worst position vector for the current round is used for subsequent genetic algorithm operations. In one implementation, the current fitness value can be simply compared with the historical best fitness value, and the individual optimal position vector and the global optimal position vector can be updated. In another implementation, a fault-tolerance mechanism can be introduced; for example, if the fitness value does not change significantly, the optimal position vector is not updated immediately to avoid the algorithm being overly sensitive to noise.
[0034] Then, in step A4, based on the preset particle swarm update rule, the velocity vector of each particle is updated according to the individual optimal position vector and the global optimal position vector, and the position vector of each particle is updated according to the updated velocity vector. The particle swarm update rule guides the movement of particles in the search space. For example, the update of the velocity vector can take into account the particle's own inertia, the attraction to the individual optimal position vector, and the attraction to the global optimal position vector. The update of the position vector is based on the current position vector and the updated velocity vector. In one implementation, a fixed inertia weight factor and acceleration constant can be used. In another implementation, an adaptive inertia weight factor and acceleration constant can be used, for example, dynamically adjusting these parameters according to changes in the number of iterations or fitness value to balance global search and local search capabilities.
[0035] Subsequently, in step A5, a genetic algorithm is performed on the updated position vector of the worst-performing particle in this round, using the globally optimal position vector, to improve the position vector. The worst-performing particle in this round is the particle corresponding to the worst position vector in this round. The genetic algorithm operation can include crossover and mutation operations. The improved position vector is used to replace the updated position vector of the particle and participates in the next iteration. In one implementation, single-point or multi-point crossover operations can be used, with mutation performed at a fixed probability. In another implementation, a more complex crossover and mutation strategy can be used, for example, dynamically adjusting the crossover point and mutation probability based on the particle's fitness value or its distance from other particles, to improve the algorithm's search efficiency and diversity.
[0036] Finally, in step A6, based on the satisfaction of the preset termination conditions, the task allocation scheme corresponding to the globally optimal position vector is output, or the algorithm returns to step A2 for the next iteration. Termination conditions may include reaching the maximum number of iterations, or the fitness value converging to a certain degree. In one implementation, a fixed maximum number of iterations can be set. In another implementation, multiple termination conditions can be set; for example, the algorithm terminates when the deviation between the fitness value of all particles in the current iteration and the fitness value in the previous iteration is less than a preset deviation threshold, or when the current iteration count reaches the preset maximum number of iterations.
[0037] This application presents an AGV task allocation method based on particle swarm optimization (PSO) and genetic algorithm. By using real-number encoding, it effectively reduces the encoding dimensionality of the task allocation problem and lowers computational complexity. For example, in a scenario with 5 tasks and 3 AGVs, traditional integer encoding might require 7 genes, while this application only requires 5, significantly reducing the number of genes. Simultaneously, this method combines the fast convergence and memory characteristics of PSO with the global search and local optima avoidance capabilities of genetic algorithms. By performing genetic algorithm operations on the worst-performing particle in each iteration, randomness and diversity are introduced, effectively avoiding the problem of PSO easily getting trapped in local optima. This combination allows the algorithm to improve the accuracy and stability of optimization while maintaining convergence speed, thereby efficiently solving the multi-AGV task allocation problem and optimizing AGV operating efficiency and task completion time.
[0038] In some implementations, step A1 includes: A101. Initialize the size of the particle swarm. ; A102. In 3D real space, randomly initialized The position vectors of each particle are such that each element of the position vector is a real number with an integer part and a fractional part, and corresponds to a task to be assigned; the value range of each element in the position vector is... Wherein, the integer part represents the AGV number to which the corresponding task is assigned, and the decimal part represents the execution order of the corresponding task within the assigned AGV; The number of tasks to be assigned. The number of AGVs; A103. In In a 3D real space, generate the velocity vector for each particle, and in Randomly initialize each element of the velocity vector within the range so that each element of the velocity vector is a real number.
[0039] In step A101, the size of the particle swarm... In particle swarm optimization (PSO) algorithms, this refers to the number of particles (i.e., potential task allocation schemes) participating in the search for the optimal solution. The size of this number directly affects the algorithm's search capability and computational efficiency. This number can be pre-set to a fixed value based on the complexity of the problem and computational resource constraints, for example... It can be set to 100. Alternatively, a dynamic adjustment strategy can be adopted, adjusting it within a certain range based on the stage of algorithm execution or convergence status. The value is used to balance global search and fine-grained local search.
[0040] In step A102, the position vector is the solution represented by each particle in the particle swarm optimization algorithm, and its dimension is... This equals the number of tasks to be assigned. Each element is a real number, where the integer part encodes which AGV the task is assigned to, and the fractional part encodes the execution order of the task on the corresponding AGV. Random initialization ensures the diversity of initial solutions and avoids the algorithm getting trapped in local optima. For each element of the position vector of each particle, an AGV number (integer part) can be randomly generated first, for example, an integer randomly selected between [1, N], and then a fractional part can be randomly generated, for example, a floating-point number randomly selected between [0, 1) (the execution order of tasks in the AGV is determined by the size of the fractional floating-point value, with the smaller value executed first). The two are then combined to form a real number. Alternatively, random initialization can be used first... Each task allocation scheme specifies which AGV each task is assigned to and the execution order within the AGV. These schemes are then converted into... A 3D real vector, as The initial position vector of each particle.
[0041] For example Figure 3 middle, Let i represent the position vectors of the i particles, and let tasks1-task6 represent the first to sixth tasks to be assigned (i.e., the number of tasks to be assigned is 6). Let AGV1-AGV3 represent the first to third AGVs (i.e., the number of AGVs is 3). The first element 3.2 indicates that the task to be assigned, task1, is assigned to AGV3, and the execution order of the task in AGV3 is 2; similarly, the second element 1.2 indicates that the task to be assigned, task2, is assigned to AGV1, and the execution order of the task in AGV1 is 2. The meanings of other elements in the same way can be deduced. Therefore, the final task allocation result can be referenced. Figure 4 The task sequence for AGV1 is task5, task2; the task sequence for AGV2 is task3, task6; and the task sequence for AGV3 is task4, task1.
[0042] In step A103, the velocity vector determines the particle's direction of movement and step size in the search space. Its dimension... Similar to the position vector, each element is also a real number. It is randomly initialized within the range [-N, N], providing the particles with suitable initial exploration capabilities. For each element of the velocity vector of each particle, a floating-point number can be randomly generated within the real number range [-N, N].
[0043] Through the above technical solution, this method can provide a structured and reasonable initial state for AGV task allocation methods based on particle swarm genetic algorithms. Specifically, it initializes the size of the particle swarm. This approach effectively balances the computational efficiency and search range of the algorithm, avoiding resource waste or insufficient search coverage caused by an inappropriate number of particles. In a 3D real space, random initialization The system generates position vectors for each particle and ensures that each element has a uniform integer and fractional part encoding structure, directly mapping the task allocation scheme to real-number encoding. This not only avoids the genetic redundancy problem that may exist in traditional integer encoding, but also guarantees the diversity and feasibility of the initial solution through randomness. Simultaneously, a velocity vector is generated and initialized within the range [-N, N]. These measures work together to significantly improve the rationality of the initial particle swarm and the algorithm's startup efficiency, laying a solid foundation for the subsequent global optimization process, thereby improving the overall performance and reliability of AGV task allocation.
[0044] In some implementations, step A2 includes steps performed for each particle: A201. Determine the task sequence assigned to each AGV based on the elements in the particle; A202. Based on the task sequence, combined with the loading and unloading points of each task to be assigned and the position of each AGV, obtain the total task time or total task path length required for each AGV to complete all assigned tasks. A203. Calculate the fitness value of this particle using the following fitness function: ; or, ; in, Let be the fitness value of the i-th particle. For the first to the second Total task duration for each AGV For the first to the second The total task path length of each AGV.
[0045] Specifically, in step A201, when determining the task sequence assigned to each AGV based on the elements in the particle, this step aims to transform the abstract particle position vector (whose elements contain AGV numbers and task execution order information) into a concrete task sequence that the AGV can directly execute. This serves as a bridge between the mathematical representation of the algorithm and actual physical operations, providing fundamental data for subsequent calculations of the total task duration or path length of the AGV. For example, by traversing each element of the particle position vector, identifying the AGV to which the task belongs based on the integer part of the element, and sorting the tasks of the same AGV based on the fractional part of the element, a task sequence for each AGV can be constructed. In practical applications, elements in the particle position vector with the same integer part (i.e., elements corresponding to the same AGV) may not have their fractional parts arranged in a continuous order. In this case, these tasks are arranged from smallest to largest based on the size of the fractional part to form a task sequence; for example, for Tasks 1, 2, and 5 are all assigned to AGV 2. However, the execution order of task 1 is 1, the execution order of task 2 is 4, and the execution order of task 5 is 3. Based on their execution order, they are sorted from smallest to largest, resulting in the task sequence of AGV 2 as: task 1, task 5, task 2.
[0046] In step A202, when calculating the total task time or total task path length required for each AGV to complete all assigned tasks based on the task sequence, the loading and unloading points of each task to be assigned, and the positions of each AGV, this step is the core of fitness calculation. It links the abstract representation of the task allocation scheme with the concepts of time and distance in the real physical world. By considering the actual geographical location of the task and the current position of the AGV, the workload of each AGV can be accurately assessed, thus providing a quantitative basis for the quality of the overall task allocation scheme. For example, if the total task time is calculated, for each AGV, its starting position is first determined (which could be the current position of the AGV or the unloading point of the previous task, for example...). Figure 5 In this diagram, the starting position is the current position of the AGV (i.e., the position of each block in the diagram). Then, according to the task sequence, the time required for the AGV to travel from its current position to the loading point of the next task, and from the loading point to the unloading point (e.g., ...) is calculated sequentially. Figure 5 In the diagram, 1A-6A represent six loading points for unloading tasks, and 1B-6B represent six unloading points for unloading tasks, and these times are accumulated. This requires presetting parameters such as the AGV's travel speed and loading / unloading time. If the total task path length is calculated, similarly, the path length from the current position to the loading point of the next task and from the loading point to the unloading point is calculated sequentially according to the task sequence, and these lengths are accumulated. The path length can be calculated using Manhattan distance, Euclidean distance, or the actual distance based on map path planning. The path from the current position to the loading point of the next task and from the loading point to the unloading point can be a straight path (e.g., a straight path). Figure 6 The three dashed lines in the diagram represent the total path for the three AGVs to execute their task sequences, with each node in the path connected by a straight line or using a path planning algorithm (such as A...). * The path to algorithm optimization.
[0047] In step A203, when calculating the fitness value of the particle based on the fitness function, this fitness function aims to evaluate the overall performance of the task allocation scheme, particularly focusing on load balancing among AGVs. By selecting the maximum value of the total task duration or total task path length among all AGVs as the fitness value, the algorithm will tend to optimize schemes that minimize the workload of the busiest AGVs, thereby avoiding situations where some AGVs are overloaded while others are idle, and improving overall efficiency. For example, after obtaining the total task duration of all AGVs... Then, by comparing these durations, the maximum value is directly selected as the particle's fitness value. Alternatively, after obtaining the total task path length of all AGVs... Then, by comparing these lengths, the maximum value is directly selected as the particle's fitness value. .For example Figure 4 In the process, the maximum total task duration is: ,thereby equal .
[0048] Through the synergistic effect of the above steps, this scheme effectively combines the optimization capabilities of the particle swarm optimization algorithm with the actual needs of AGV task allocation. Based on the integer and fractional parts of each element in the particle position vector, the abstract task allocation scheme is resolved into a specific task sequence for each AGV. This resolution process forms the basis for subsequent physical quantity calculations, tightly integrating the algorithm's mathematical model with the actual AGV scheduling logic. Subsequently, using these task sequences, combined with the loading and unloading points of each task to be assigned and the positions of each AGV, the total task time or total task path length required for each AGV to complete all its assigned tasks is accurately calculated. This step introduces actual physical space information, ensuring that the evaluation of the task allocation scheme is no longer based on a simple number or order of tasks, but on the actual cost (time or distance) of AGVs performing tasks in the real environment. Finally, the maximum value of the total task time or total task path length among all AGVs is selected as the fitness value of the particle. This definition of the fitness function aims to optimize the overall performance of the AGV swarm, particularly by minimizing the workload of the busiest AGV to promote load balancing, thereby avoiding local optima and resource waste. This fitness calculation method based on actual physical parameters enables the algorithm to more accurately evaluate the merits of task allocation schemes, thereby finding the global optimal solution more effectively during the iteration process, significantly improving the efficiency and rationality of AGV task allocation.
[0049] In some implementations, step A3 includes: A301. If this iteration is the first iteration, then the current position vector of each particle is taken as its own individual optimal position vector, and the current position vector of the particle with the smallest fitness value in this iteration is taken as the global optimal position vector. A302. If this iteration is not the first iteration, then execute: For each particle, if the fitness value of the particle in the current iteration is less than the fitness value corresponding to the individual optimal position vector determined in the previous iteration, then the individual optimal position vector of the particle is updated to the current position vector of the particle; otherwise, the individual optimal position vector of the particle remains unchanged. If the minimum fitness value of the particle swarm in this iteration is less than the fitness value corresponding to the global optimal position vector determined in the previous iteration, then the global optimal position vector is updated to the current position vector of the particle corresponding to the minimum fitness value; otherwise, the global optimal position vector remains unchanged. A303. Take the current position vector of the particle with the highest fitness value in this iteration as the worst position vector in this round.
[0050] Specifically, in the first iteration, since the particle swarm has not yet performed any optimization search, each particle has not accumulated its own historical optimal information, nor has a global optimal consensus been formed. Therefore, setting each particle's current position vector directly as its own individual optimal position vector can quickly establish an initial reference point for each particle. Simultaneously, by comparing the fitness values of all particles in the first iteration, the position vector corresponding to the particle with the smallest fitness value is selected as the global optimal position vector. This ensures that the algorithm starts its search from a relatively optimal starting point, avoiding the inefficiency that might result from completely random initialization. For example, a Boolean flag can be set to determine whether it is the first iteration, or the determination can be made by checking if the iteration counter is zero.
[0051] In subsequent iterations, the update strategy for the individual optimal position vector and the global optimal position vector aims to ensure that the algorithm continuously evolves towards a better solution and effectively utilizes the particle's memory capacity. For the i-th particle, if the position vector in this iteration... The corresponding fitness value is compared to the individual's optimal position vector saved in the previous iteration. If the corresponding fitness value is small, then the particle's individual optimal position vector is updated to the particle's current position vector, that is, let... If the current performance is poor, the historical best is retained. The update of the global optimal position vector is based on a comparison between the best performance of the entire particle swarm in the current iteration and the global historical best performance. For the entire particle swarm, the minimum fitness value of this iteration is taken. , For the first to the second The fitness value of each particle, if The fitness value is less than the fitness value corresponding to the global optimal position vector saved in the previous iteration (i.e., the value corresponding to the global optimal position vector when it was initially determined). If the global optimal position vector is updated to the value of the current iteration, then the global optimal position vector is updated accordingly. The corresponding particle's current position vector. This ensures that the global optimal solution is always the best solution found by the particle swarm so far. For example, this can be achieved by storing the historical best fitness value and the global best fitness value for each particle, and comparing and updating them after each iteration.
[0052] Furthermore, this scheme clarifies how to identify the worst solution in the current iteration, providing a precise target for subsequent improvements using genetic algorithms. The maximum fitness value in this iteration is... The current position vector of the corresponding particle is used as the global worst-case position vector for this iteration. In particle swarm optimization, identifying the worst-performing particle and improving its position vector is a key strategy for escaping local optima and enhancing global search capabilities. By selecting the current position vector of the particle with the highest fitness value (i.e., the worst-performing particle, since a lower fitness value is better) as the worst-performing position vector for this round, it can be ensured that subsequent genetic algorithm operations can be targeted at solutions that need improvement, thereby improving the overall optimization efficiency and robustness of the algorithm. For example, the maximum fitness value and its corresponding particle position vector can be found by traversing all particle fitness values.
[0053] The proposed solution, through the aforementioned steps, establishes a rapid initial optimization foundation for the AGV task allocation method. Firstly, in the initial iteration, it uses the current position vector of each particle as its individual optimal position vector and the current position vector of the particle with the lowest fitness value as the global optimal position vector, thus avoiding inefficiencies in the startup phase. In subsequent iterations, it dynamically updates the individual optimal position vector and the global optimal position vector by precisely comparing the current fitness value of each particle with its historical individual optimal fitness value, as well as the current minimum fitness value of the particle swarm with its historical global optimal fitness value. This update mechanism ensures that the algorithm consistently evolves towards a better solution, effectively utilizing the particle's memory capacity and improving convergence speed. Simultaneously, by explicitly identifying the current position vector of the particle with the highest fitness value in this iteration as the worst position vector for this round, it provides a precise improvement target for subsequent genetic algorithm operations, thereby enhancing the algorithm's ability to escape local optima and improving global search efficiency. This solution, combined with the aforementioned particle swarm genetic algorithm based on real-number encoding, can more effectively optimize within a continuous search space, thereby obtaining a high-quality task allocation scheme.
[0054] Preferably, the particle swarm update rule includes a velocity vector update rule and a position vector update rule; Step A4 includes: A401. Update the velocity vector of each particle based on the following velocity vector update rule: , , ; in, This represents the current iteration number. For the scale of the particle swarm, The number of tasks to be assigned. Let j be the j-th element of the velocity vector of the i-th particle in the t-th iteration. Let j be the j-th element of the velocity vector of the i-th particle in the (t+1)-th iteration. As the inertia weighting factor, , The preset acceleration constant, , A uniformly distributed random number in the range [0,1]. Let j be the j-th element of the optimal position vector of the i-th particle in the t-th iteration. Let j be the j-th element of the position vector of the i-th particle in the t-th iteration. Let j be the j-th element of the globally optimal position vector determined in the t-th iteration; A402. Update the position vector of each particle according to the following position vector update rules: ; in, It is the j-th element of the position vector of the i-th particle in the (t+1)-th iteration.
[0055] The particle swarm optimization rule proposed in this application provides a precise and efficient iterative optimization mechanism for AGV task allocation methods. Specifically, in step A401, the velocity vector of each particle is updated based on the aforementioned velocity vector update rule. This rule cleverly integrates three key factors: particle inertia (… ), cognitive learning of particles toward their historical best position ( ) and social learning of particles toward the global optimal position of the population ( Inertia weighting factor The degree to which particles maintain their current velocity balances global exploration and local exploitation. Acceleration constant. , The intensity of the influence of individual experience and group experience on particles is adjusted separately, while random numbers... , This introduces random perturbations to prevent the algorithm from getting trapped in local optima. In this way, the movement of each particle in the search space considers not only its own historical experience but also the best findings of the entire swarm, making the search process both memory-based and random, effectively improving optimization efficiency and accuracy. Subsequently, in step A402, the position vector of each particle is updated according to the aforementioned position vector update rule. This rule directly superimposes the updated velocity vector onto the current position vector, achieving smooth movement of the particle in the search space. This direct and efficient update mechanism ensures that the particle can accurately adjust its position based on its new velocity direction and magnitude. The particle swarm optimization (PSO) update rule is used to gradually approximate the optimal task allocation scheme by determining the position of the task allocation scheme in a real-valued space. Combining this PSO rule with the AGV task allocation method based on real-valued encoding significantly improves the optimization effect of the task allocation scheme. The real-valued encoding method maps the task allocation scheme into a continuous... The 3D real-valued vector provides a suitable continuous search space for the particle swarm optimization (PSO) algorithm. Based on this, the precise velocity and position update rules defined in this application enable particles to efficiently search within this continuous space, avoiding the computational surge that can occur with traditional integer encoding, and fully leveraging the fast convergence and stable optimization process of the PSO algorithm. By iteratively executing these update steps, the particle swarm can continuously optimize its position vector, i.e., continuously improve the task allocation scheme until it converges to the globally optimal or near-optimal AGV task allocation scheme, thus effectively solving the efficiency and optimization accuracy challenges in the multi-AGV task allocation problem.
[0056] In some preferred embodiments, in step A401, the inertia weighting factor is determined according to the following formula: ; in, The preset maximum inertia weight factor, The preset minimum inertia weight factor, This is the preset maximum number of iterations. This formula causes the inertia weight factor to take a larger value in the early stages of iteration and a smaller value in the later stages, so that the algorithm focuses more on global exploration in the early stages of iteration and mainly performs local search in the later stages.
[0057] Among them, inertia weighting factor The inertia weight factor is a key parameter in particle swarm optimization (PSO) algorithms, balancing the global exploration and local search capabilities of particles. This factor determines the degree to which a particle maintains its previous velocity direction when updating its velocity. While the inertia weight factor can be a fixed value, it is typically dynamically adjusted to optimize algorithm performance, such as based on the number of iterations, changes in fitness values, or particle distribution, to adapt to the needs of different search stages. The formula above defines a linearly decreasing inertia weight adjustment strategy. This formula aims to adjust the inertia weight factor... As the number of iterations t increases, it decreases from the preset maximum value. Linearly decrease to the preset minimum value . The preset maximum inertia weight factor is the inertia weight factor. The upper limit of the value can give particles greater inertia in the early stages of the algorithm, enhancing their global exploration capabilities. The value can be set based on empirical values, such as 0.9 or 1.0, or the optimal value can be determined through experiments or cross-validation. The preset minimum inertia weight factor is the inertia weight factor. The lower bound can reduce the inertia of particles in the later stages of the algorithm, making them more inclined to local search and convergence. The value can be set based on empirical values, such as 0.4 or 0.2, or the optimal value can be determined through experiments or cross-validation. The preset maximum number of iterations is the upper limit of the particle swarm optimization algorithm, used to control the termination condition of the algorithm and provide a time reference for the dynamic adjustment of inertia weights. The convergence accuracy can be set according to the complexity of the problem and the desired convergence accuracy, such as 100 times, 500 times, or 1000 times.
[0058] The solution in this application dynamically adjusts the inertia weight factor. This allows the particle swarm optimization algorithm to effectively balance global exploration and local search during the AGV task allocation optimization process. In the early iteration stages of the algorithm, the number of iterations t is relatively small, and the inertia weight factor... The value is close to At this point, the particle has a strong tendency to maintain its original velocity, which helps it to conduct extensive global exploration throughout the search space, thus preventing the algorithm from getting trapped in a local optimum too early. As the number of iterations t increases, the inertia weight factor... The value decreases linearly, approaching... At this point, the particle is more influenced by its own optimal position and the global optimal position, while the influence of its original velocity decreases. This makes the particle more inclined to perform a fine local search near the current optimal solution, thereby improving the convergence accuracy and efficiency of the algorithm. This dynamic adjustment mechanism, combined with the velocity update rule mentioned earlier, allows the particle to exhibit different search behaviors at different iteration stages. As a result, in the complex multidimensional real-number encoding space of AGV task allocation, it can more effectively find the globally optimal or near-optimal task allocation scheme.
[0059] In some implementations, step A5 includes: A501. Using the updated position vector of the particle corresponding to the worst position vector in this round as the target position vector, and using the global best position vector, perform a cross operation on the target position vector; A502. If there are multiple identical elements in the target position vector after the crossover operation, randomly select one of these identical elements and keep it unchanged, and randomly adjust the other identical elements so that there are no identical elements in the target position vector after the crossover operation. A503. According to the preset mutation probability, select elements in the target position vector after the crossover operation that are in the real number range. Perform random mutations. The number of AGVs; A504. If the target position vector after random mutation contains multiple identical elements, then randomly select one of these identical elements to remain unchanged, and keep it within the real number interval. Randomly adjust other identical elements so that there are no identical elements in the target position vector after random mutation.
[0060] Step A501 aims to introduce the global optimal information of the particle swarm into the currently worst-performing particle through crossover operations in a genetic algorithm, thereby improving its "genes" and increasing its fitness. The target position vector is the position vector of the worst-fit particle in the current iteration after being updated by the particle swarm update rules; it represents a relatively poor task allocation scheme. The global optimal position vector represents the best task allocation scheme found so far in the current iteration. The purpose of the crossover operation is to combine the advantages of these two vectors. Specifically, the crossover operation can be performed using single-point crossover, where a crossover point is randomly selected, and the gene segments of the two parents (the global optimal position vector and the target position vector) are exchanged before or after that crossover point to generate new offspring; or using multi-point crossover, where multiple crossover points are randomly selected, and the gene segments of the parents are alternately exchanged between these crossover points to generate new offspring; or using uniform crossover, where each gene position is selected with a certain probability, determining whether the gene position comes from parent 1 or parent 2.
[0061] Taking a single-point intersection as an example, assume the globally optimal position vector is... The target position vector is The third gene (i.e., the third element) is randomly selected as the intersection point. The gene following the third gene in the target position vector (3.6, 1.3, 3.4) is replaced with the gene following the third gene in the globally optimal position vector (3.1, 1.1, 2.2), thus changing the target position vector to... .
[0062] Step A502 is used to correct the invalidity that may be caused by the crossover operation. Since each element of the position vector is a real number with an integer part and a fractional part, and corresponds to a task to be assigned, where the integer part represents the AGV number to which the corresponding task is assigned, and the fractional part represents the execution order of the corresponding task within the assigned AGV, if multiple identical elements appear after the crossover operation, it means that the same AGV has been assigned multiple tasks with the same execution order, which is invalid in actual task allocation. This step ensures the validity of each task allocation scheme by randomly selecting and adjusting duplicate elements. For example, for duplicate elements, one can be retained, and for the other duplicate elements, new values can be randomly generated within the real number interval [1, N+1) until all elements are unique; or, one can be retained, and for the other duplicate elements, only their fractional parts (execution order) can be adjusted to ensure that the task execution order of the corresponding AGV does not conflict.
[0063] Step A503 aims to introduce diversity through mutation operations, helping to escape local optima and explore a wider solution space. After the crossover operation, the improved position vector is mutated to further increase its randomness and exploration capability. A preset mutation probability controls the frequency of mutation, usually a small value, such as 0.1, to avoid destroying existing superior genes. The real number interval [1, N+1) ensures the validity of the mutated AGV number and task order. For example, each element of the position vector can be traversed, and a decision can be made whether to mutate that element based on the preset mutation probability. If mutation is decided, a new real value is randomly generated within the real number interval [1, N+1) of that element to replace the original element; alternatively, only the integer part of the element (AGV number), or only the fractional part of the element (execution order), or both can be mutated, but the mutated value must still be within the valid range.
[0064] Step A504 performs a second check and correction after the mutation operation to ensure that the final task allocation scheme is valid. Similar to the crossover operation, the mutation operation may also result in duplicate elements in the position vector, leading to invalid task allocation schemes. This step performs a second check and correction after mutation to ensure that the final task allocation scheme is valid. This further enhances the robustness of the algorithm, ensuring that the scheme generated in each iteration is practically meaningful. The specific operation can be found in step A502.
[0065] This application's solution combines particle swarm optimization (PSO) with genetic algorithms, and introduces a deduplication mechanism in the crossover and mutation operations of the genetic algorithm to ensure the effectiveness of the task allocation scheme. Specifically, during the iterative process based on PSO, when the worst-performing particle is identified, the method uses the globally optimal position vector to perform genetic algorithm operations on it for improvement. First, the "genes" of the globally optimal solution are introduced into the worst-performing particle through a crossover operation to improve its performance. Given that crossover may lead to duplicate elements in the position vector, this method immediately performs a deduplication step after crossover, randomly adjusting duplicate elements to ensure conflict-free task allocation results. Subsequently, to further enhance the algorithm's global search capability and avoid getting trapped in local optima, a mutation operation is performed on the position vector after crossover and deduplication. Considering that mutation may also introduce duplicate elements, this method performs a deduplication step again to ensure that the mutated position vector is still a valid task allocation scheme. In this way, this method ensures that the generated task allocation scheme is always feasible and practically meaningful during the genetic algorithm improvement process, thereby improving the convergence and effectiveness of the algorithm.
[0066] In some implementations, the preset termination condition is: the number of times that the deviation between the fitness values of all particles in two adjacent iterations is less than a preset deviation threshold is reached, or the current iteration number reaches a preset maximum iteration number. In step A6, if the preset termination condition is met, the task allocation scheme corresponding to the globally optimal position vector is output; otherwise, the process returns to step A2 for the next iteration.
[0067] This preset termination condition aims to control when the iterative optimization process stops, ensuring that the algorithm stops when it reaches the expected optimization level or within preset computational resource constraints, thereby avoiding unnecessary computational overhead or infinite loops. Specifically, the condition is defined as the number of times the deviation between the fitness values of all particles in two consecutive iterations is less than a preset deviation threshold. This condition is used to determine whether the algorithm has converged. When the number of times the deviation between the fitness values of all particles in two consecutive iterations is less than the preset deviation threshold reaches the preset threshold, it indicates that the algorithm's search process has entered a stable state, and further iterations may not significantly improve the quality of the solution. This deviation can be specifically achieved by calculating the absolute or relative difference in the fitness values of each particle and determining whether all these differences are below a preset minimum value. The preset deviation threshold is a pre-set numerical value used to measure the degree of change in fitness values; its magnitude directly affects the convergence speed of the algorithm and the accuracy of the final solution. For example, this threshold can be set to a small positive real number, such as 0.001 or 0.0001, or set to a certain percentage of the current fitness value to accommodate optimization problems of different scales and characteristics. The preset iteration threshold can be set according to actual needs. The current iteration count reaches the preset maximum iteration count. This condition serves as a forced termination mechanism to prevent the algorithm from getting stuck in an infinite loop when it fails to converge, or to provide an exit point if a satisfactory solution is not found within a given time. By setting a maximum iteration count, the algorithm can be ensured to complete the computation within a finite time, thereby controlling the use of computing resources.
[0068] In step A6, if the preset termination condition is met, the task allocation scheme corresponding to the globally optimal position vector is output; otherwise, the process returns to step A2 for the next iteration. This step describes the action taken based on the termination condition judgment. When any preset termination condition is met, it indicates that the algorithm has reached the stopping requirement. At this time, the task allocation scheme represented by the currently found globally optimal position vector is output as the final result. For example, a list can be output, recording the task sequence assigned to each AGV. The tasks in this task sequence are sorted in ascending order according to the fractional part of the corresponding element in the globally optimal position vector. Conversely, if the termination condition is not met, the algorithm will continue to execute the next iteration, recalculating the fitness value and updating the particle state from step A2 until the termination condition is met.
[0069] This method dynamically evaluates the algorithm's running status after each iteration. Specifically, it checks two key conditions: first, the number of times the deviation between the fitness values of all particles in two consecutive iterations is less than a preset deviation threshold reaches a preset threshold; second, whether the current iteration count has reached the preset maximum number of iterations. When the change in the fitness values of all particles is less than the preset deviation threshold and this state lasts long enough, it indicates that the particle swarm search has stabilized and the algorithm has essentially converged. At this point, continuing iterations has little effect on improving the solution. Through this condition, the algorithm can intelligently determine when to stop, avoiding unnecessary calculations when the solution is already optimized, thus saving computational resources. Meanwhile, the preset maximum number of iterations provides a mandatory termination guarantee. Even if the algorithm fails to reach convergence, such as in complex problems or under specific parameter settings, this condition ensures that the algorithm stops within a preset time or computational limit, preventing infinite loops and guaranteeing the algorithm's robustness and practicality. In step A6, the system dynamically decides, based on the judgment results of these preset termination conditions, whether to output the task allocation scheme corresponding to the currently obtained globally optimal position vector, or to return to step A2 to continue the next round of iteration. This mechanism enables the algorithm to output the optimal task allocation scheme in a timely manner when the fitness value is stable or reaches the safety upper limit, thereby improving the overall computational efficiency and the timeliness of task allocation.
[0070] In practice, the preset termination condition can also be set as follows: the number of times the deviation between the particle swarm fitness values in two adjacent iterations is less than a preset deviation threshold reaches a preset threshold, or the current iteration number reaches a preset maximum iteration number. Here, the particle swarm fitness is the fitness value corresponding to the global optimal solution.
[0071] The requirement that only the fitness of the particle swarm converges is a lower stopping condition than the requirement that the fitness values of all particles converge. This saves computational resources and ensures that the global optimum can be reliably obtained.
[0072] For example, targeting Figure 5 In the task allocation problem, the above method is used for iterative calculation. The change of particle swarm fitness with the number of iterations is as follows: Figure 7 As shown (the particle swarm fitness in the figure is based on path length), the algorithm found a relatively optimal solution to the task allocation problem after about 30 iterations. Since the algorithm uses the crossover and mutation operations of the genetic algorithm to enhance its global search capability, the algorithm did not get stuck in a local optimum, but found the optimal solution to the task allocation problem in about 180 iterations.
[0073] Please refer to Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other via a communication bus 303 and / or other connection mechanisms (not shown). The memory 302 stores a computer program executable by the processor 301. When the electronic device is running, the processor 301 executes the computer program to perform the AGV task allocation method based on particle swarm genetic algorithm in any optional implementation of the above embodiments, to achieve the following functions: A1. Based on real number encoding modeling, initialize the position vector and velocity vector of the particle swarm; the position vector and velocity vector of each particle in the particle swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be allocated; the position vector of each particle represents a task allocation scheme, and each element in the position vector is a real number with an integer part and a fractional part, corresponding to a task to be allocated. The integer part of the element represents the AGV number to which the corresponding task is assigned, and the decimal part represents the execution order of the corresponding task in the assigned AGV; A2. Calculate the fitness value of each particle in the particle swarm according to the preset fitness function; A3. Determine the individual optimal position vector of each particle, as well as the global optimal position vector and the worst position vector of the particle swarm in this round according to the fitness value; A4. Based on the preset particle swarm update rule, update the velocity vector of each particle according to the individual optimal position vector and the global optimal position vector, and update the position vector of each particle according to the updated velocity vector; A5. Using the global optimal position vector, perform a genetic algorithm operation on the updated position vector of the worst particle in this round to improve the position vector; the worst particle in this round is the particle corresponding to the worst position vector in this round; A6. Based on the satisfaction of the preset termination condition, output the task allocation scheme corresponding to the global optimal position vector, or return to step A2 for the next iteration.
[0074] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it executes the AGV task allocation method based on particle swarm genetic algorithm in any optional implementation of the above embodiments to achieve the following functions: A1. Initialize the position vector and velocity vector of the particle swarm based on real number encoding modeling; the position vector and velocity vector of each particle in the particle swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be allocated; the position vector of each particle represents a task allocation scheme, and each element in the position vector is a real number with an integer part and a fractional part and corresponds to a task to be allocated. The integer part of the position vector element represents the AGV number to which the corresponding task to be allocated is assigned, and the fractional part represents the execution of the corresponding task to be allocated in the assigned AGV. The sequence is as follows: A2. Calculate the fitness value of each particle in the particle swarm according to the preset fitness function; A3. Determine the individual optimal position vector of each particle, as well as the global optimal position vector and the worst position vector of the current round, based on the fitness value; A4. Update the velocity vector of each particle according to the individual optimal position vector and the global optimal position vector based on the preset particle swarm update rules, and update the position vector of each particle according to the updated velocity vector; A5. Use the global optimal position vector to perform a genetic algorithm operation on the updated position vector of the worst particle in the current round to improve the position vector; the worst particle in the current round is the particle corresponding to the worst position vector in the current round; A6. Based on the satisfaction of the preset termination condition, output the task allocation scheme corresponding to the global optimal position vector, or return to step A2 for the next iteration. The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0075] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. An AGV task allocation method based on particle swarm optimization (PSO) genetic algorithm, used to assign multiple handling tasks to multiple AGVs, characterized in that, The method includes the following steps: A1. Based on the real number encoding modeling method, initialize the position vector and velocity vector of the particle swarm; the position vector and velocity vector of each particle in the particle swarm are multi-dimensional vectors with a dimension equal to the number of tasks to be assigned; the position vector of each particle represents a task assignment scheme, and each element in the position vector is a real number with an integer part and a fractional part and corresponds to a task to be assigned. The integer part of the position vector element represents the AGV number to which the corresponding task to be assigned is assigned, and the fractional part represents the execution order of the corresponding task to be assigned in the assigned AGV; A2. Calculate the fitness value of each particle in the particle swarm according to the preset fitness function; A3. Based on the fitness value, determine the individual optimal position vector of each particle, as well as the global optimal position vector and the worst position vector of the particle swarm in this round; A4. Based on the preset particle swarm update rules, update the velocity vector of each particle according to the individual optimal position vector and the global optimal position vector, and update the position vector of each particle according to the updated velocity vector; A5. Using the global optimal position vector, perform a genetic algorithm operation on the updated position vector of the worst particle in this round to improve the position vector; the worst particle in this round is the particle corresponding to the worst position vector in this round. A6. Based on the satisfaction of the preset termination conditions, output the task allocation scheme corresponding to the globally optimal position vector, or return to step A2 for the next iteration.
2. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, Step A1 includes: A101. Initialize the size of the particle swarm. ; A102. In 3D real space, randomly initialized The position vectors of each particle are such that each element of the position vector is a real number with an integer part and a fractional part, and corresponds to a task to be assigned; the value range of each element in the position vector is... Wherein, the integer part represents the AGV number to which the corresponding task is assigned, and the decimal part represents the execution order of the corresponding task within the assigned AGV; The number of tasks to be assigned. The number of AGVs; A103. In In a 3D real space, generate the velocity vector for each particle, and in Randomly initialize each element of the velocity vector within the range so that each element of the velocity vector is a real number.
3. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, Step A2 includes the steps performed for each particle: A201. Determine the task sequence assigned to each AGV based on the elements in the particle; A202. Based on the task sequence, combined with the loading and unloading points of each task to be assigned and the position of each AGV, obtain the total task time or total task path length required for each AGV to complete all assigned tasks. A203. Calculate the fitness value of this particle using the following fitness function: ; or, ; in, Let be the fitness value of the i-th particle. For the number of AGVs, For the first to the second The total task duration of each AGV. For the first to the second The total task path length of each AGV.
4. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, Step A3 includes: A301. If this iteration is the first iteration, then the current position vector of each particle is taken as its own individual optimal position vector, and the current position vector of the particle with the smallest fitness value in this iteration is taken as the global optimal position vector. A302. If this iteration is not the first iteration, then execute: For each particle, if the fitness value of the particle in the current iteration is less than the fitness value corresponding to the individual optimal position vector determined in the previous iteration, then the individual optimal position vector of the particle is updated to the current position vector of the particle; otherwise, the individual optimal position vector of the particle remains unchanged. If the minimum fitness value of the particle swarm in this iteration is less than the fitness value corresponding to the global optimal position vector determined in the previous iteration, then the global optimal position vector is updated to the current position vector of the particle corresponding to the minimum fitness value; otherwise, the global optimal position vector remains unchanged. A303. Take the current position vector of the particle with the highest fitness value in this iteration as the worst position vector in this round.
5. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, The particle swarm update rules include velocity vector update rules and position vector update rules; Step A4 includes: A401. Update the velocity vector of each particle based on the following velocity vector update rule: , , ; in, This represents the current iteration number. For the scale of the particle swarm, The number of tasks to be assigned. Let j be the j-th element of the velocity vector of the i-th particle in the t-th iteration. Let j be the j-th element of the velocity vector of the i-th particle in the (t+1)-th iteration. As the inertia weighting factor, , The preset acceleration constant, , A uniformly distributed random number in the range [0,1]. Let j be the j-th element of the optimal position vector of the i-th particle in the t-th iteration. Let j be the j-th element of the position vector of the i-th particle in the t-th iteration. Let j be the j-th element of the globally optimal position vector determined in the t-th iteration; A402. Update the position vector of each particle according to the following position vector update rules: ; in, It is the j-th element of the position vector of the i-th particle in the (t+1)-th iteration.
6. The AGV task allocation method based on particle swarm genetic algorithm according to claim 5, characterized in that, In step A401, the inertia weighting factor is determined according to the following formula: ; in, The preset maximum inertia weight factor, The preset minimum inertia weight factor, This is the preset maximum number of iterations.
7. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, Step A5 includes: A501. Using the updated position vector of the particle corresponding to the worst position vector in this round as the target position vector, and using the global best position vector, perform a cross operation on the target position vector; A502. If there are multiple identical elements in the target position vector after the crossover operation, randomly select one of these identical elements and keep it unchanged, and randomly adjust the other identical elements so that there are no identical elements in the target position vector after the crossover operation. A503. According to the preset mutation probability, select elements in the target position vector after the crossover operation that are in the real number range. Perform random mutations. The number of AGVs; A504. If the target position vector after random mutation contains multiple identical elements, then randomly select one of these identical elements to remain unchanged, and keep it within the real number interval. Randomly adjust other identical elements so that there are no identical elements in the target position vector after random mutation.
8. The AGV task allocation method based on particle swarm genetic algorithm according to claim 1, characterized in that, The preset termination condition is: the number of times that the deviation between the fitness values of all particles in two adjacent iterations is less than a preset deviation threshold is reached, or the current iteration number reaches the preset maximum iteration number. In step A6, if the preset termination condition is met, the task allocation scheme corresponding to the globally optimal position vector is output; otherwise, the process returns to step A2 for the next iteration.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program executable by the processor, and when the processor executes the computer program, it performs the steps in the AGV task allocation method based on particle swarm genetic algorithm as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it performs the steps of the AGV task allocation method based on the particle swarm genetic algorithm as described in any one of claims 1-8.
Citation Information
Patent Citations
Hybrid particle swarm optimization algorithm in combination with genetic algorithm
CN108399451A
Customer classification method and device based on improved particle swarm optimization algorithm
CN110930182A
Robot transportation task transfer optimization management method and system
CN118195471A
