3.1. Improving Traditional Algorithms
The performance of the traditional contract net algorithm is improved in this article by introducing a bidder’s initial selection and a credit mechanism. The initial selection of bidders reduces the communication frequency and enhances the task bidding efficiency by introducing a robot capability table [
36]. The capability table filters certain robots for communication, thereby avoiding the need to communicate with all robots for every task. Each robot maintains a capability table that includes capability values, and when new members are added, it broadcasts and updates the capability values, thereby helping the capability distribution of the robot group to be understood and achieving intelligent task allocation.
In the bidding process, the robot’s capability value is used for the first round of screening to assess the execution ability. Additionally, a credit score indicator is introduced, and the robot maintains a credit table that reflects its performance on different tasks. The initial credit score is relatively low, and the tenderer adjusts the credit score based on task execution feedback (CrV(i, j)). These improvements make the contract net protocol more systematic and reasonable. As a result, it is suitable for the entire process of task negotiation and allocation.
Step 1: Select the bidding target. First, the task parser of the tenderer analyzes the task. The task format is Job = {JobID, OrderID, Manager, JobDescription, JobRequirement}. JobID represents the task number and is used to uniquely identify the task. OrderID represents the order number, which the robot needs to read from the central control order pool. Manager represents the ID of the robot that parses the task, that is, the ID of the tenderer; JobDescription indicates the specific description of the task by the tenderer, including the task type information, the special description of the task, the composition of the task, and additional requirements, etc.; JobRequirement represents the competency requirements for that task, generated based on the type of task and additional requirements, for the initial screening of bidders.
Assuming there are k capability indicators for the task and the type of this task is j, the capability value
required for this type of task is obtained. Then, the robot capability table is queried to sequentially obtain the capability values
of all the robots. When the capability value of a certain robot meets the following criterion, that robot is included in the list of bidding robots:
where
represents the ability value of the z-th capability attribute of robot i, and
represents the required value of the z-th capability attribute of the robot by task type j.
Step 2: Issue the bid. The tenderer sends the bid document to the bidding robot. If the robot’s list is empty, the task is deleted and reported. If it is not empty, the bidder will receive the bid document when free; otherwise, it will be rejected. If all bidders are busy, the tenderer will wait and retry later. The proposed format for the bid document is Contract = {JobID, OrderID, Manager, JobDescription}. JobID refers to the task number, which is used to uniquely identify the task. OrderID refers to the order number, which the robot needs to read from the central control order pool. Manager refers to the bidder ID of the task; JobDescription refers to the specific description of the task, including the task type, the special description of the task, the composition of the task, and the additional requirements.
Step 3: Bidding. After the bidder receives the bid document, they confirm their capabilities and read the JobDescription (including the destination). The Manhattan distance [
37] is used to define the distance between two points. Let
be the position of the robot and
be the position of the task target point. The cost for the robot to move to the target point can be calculated using the following formula:
After obtaining the path consumption, the bidder will refer to the credit table based on the task type in the JobDescription to find the corresponding credit score. Then, by combining the path consumption and the credit score, the bidding value will be provided:
where
represents the creditworthiness of the current robot i corresponding to the task of type j after normalization. In the formula on the left side of Formula (6),
is the weight of the creditworthiness, less than 1 and greater than 0. Once the bidder calculates the bid value, it is fed back to the tenderer. In the formula to the right of Formula (6),
represents the upper limit of the credit value.
Step 4: Bid evaluation. The tenderer evaluates all bids and selects the one with the lowest bid value as the winner.
Step 5: Bid announcement. The tenderer notifies the winning bidder, and after receiving confirmation from the winner, a contract is established with the tenderer, making them the task executor.
Step 6: Task supervision and feedback. The tenderer supervises the winner’s task execution and updates their credit rating based on their performance. The following formula is used in the credit rating update process:
In Formula (7), represents the increased creditworthiness of the tenderer after completing the task. For bots that successfully complete tasks, their credit value increases; robots that fail to successfully complete the task will be severely punished, and their credit value will be significantly reduced. Through such a mechanism, the probability of suitable robots performing the same type of tasks can be improved, and the robots can also be avoided from bidding indiscriminately when their actual capabilities are not suitable for completing the task, resulting in a decrease in the efficiency of task allocation.
The core of the contract network algorithm is the tendering–bidding–winning mechanism, and the minimization of the total cost objective function (Equation (2)) is directly reflected in the bidding process through the design of the bidding value function (Equation (6)), and in the task allocation process of the contract network algorithm; the total cost target is embedded in the bidding value calculation, and the system indirectly realizes the minimization of the total cost by minimizing the bid value.
3.2. Combination with Genetic Algorithm
There are some limitations of traditional contract network protocols, such as the allocation of a single task, and the fact that global optimization cannot be achieved. The robot can only receive tasks when it is idle, and cannot consider multiple tasks and order its own multiple tasks, meaning that the task execution order cannot be optimized. In order to solve these problems, the algorithm needs to be improved.
Specifically, the following improvements can be made: in the link where the bidder sends the bid, the bidder will give a reasonable bid value to the new task, which not only takes into account factors such as its own power and distance to the task point, but also takes into account the type of task, its own pressure, and other factors. In addition, bidders will sort their task lists appropriately to ensure that the tasks are executed in the best order. In the process of selecting the winner, the tenderer not only considers the bid value of each bidder, but also considers the loss of each task strategy to the robot team to complete the assigned tasks.
In order to achieve the above improvement, a new mathematical model and algorithm are introduced here. Regarding loss, the loss caused by distance is mainly considered, so the algorithm needs to sort the task points so that the bidder can achieve the shortest task execution distance, and the bidder needs to constantly update their task list to achieve the shortest path. After adding a new task, it is necessary to consider how to avoid the task sequence falling into the local optimum. In the genetic algorithm, in order to avoid the phenomenon of precocious convergence, this can be achieved by increasing the diversity of the population, changing the selection operator or cross-operator, and modifying the evolving population through the Metropolis acceptance criterion to increase the randomness and diversity of the algorithm to make it more likely to obtain the global optimum, combined with the above characteristics. The genetic algorithm is used to optimize task allocation and update the task list. Combined with the market mechanism, it is possible to reasonably allocate a set of tasks to the robot group. Finally, the experimental results verify that the algorithm can effectively solve the problem of multi-task allocation in the real-time task allocation scenario.
3.2.1. Objective Optimization
In warehousing logistics, task scheduling faces challenges of real-time performance and task density. The real-time performance requires new tasks to not be delayed, while a high task density demands quick and efficient task allocation [
38]. Therefore, the improved contract net protocol introduces optimization algorithms aimed at optimizing task sequences. The order pool works in conjunction with the task generator to ensure the timely processing and assignment of tasks, thereby improving efficiency and customer satisfaction [
39].
To better evaluate the performance of the optimization algorithm, the optimization objective has been improved. Suppose there are n identical robots, and each robot can perform move-type tasks. Each robot
has a task list
, which contains multiple tasks
arranged in order. The task set of the robot team is
, and the cost for the robot to complete the task list is
. The cost for the robot to move from the current position to the first task point is
, and the cost to move from one task point a to another task point b is
. The cost of the tasks is represented by calculating the Manhattan distance between task points, and the cost of the task list is the total Manhattan distance between the coordinate points. The starting point of the robot
is denoted as
, and there are m tasks in the task list, sorted by index. The total cost for robot
to complete the task list
is
Therefore, the total consumption of tasks for all robots in the warehouse can be expressed as
. First, the total distance traveled by the robot team to complete all tasks is selected as the optimization objective. Therefore, the optimization objective is
Second, the optimization objective is the time required for the robot team to complete all tasks. Since all robots have the same transfer speed and the computation time is not considered during task allocation, the time required for the robot team to complete the tasks is equivalent to the time required by the robot that needs to move the longest distance. Therefore, the optimization objective is .
3.2.2. Task Order Optimization
The process of improving the genetic algorithm [
40] for task sequence optimization is as follows:
(1) Population initialization: The robot’s position is fixed at the starting point, and the task list is converted into coordinate points and arranged in order. The initial population combines a neighborhood search and a random generation to ensure diversity, improve the population quality, and reduce the risk of local optima.
(2) Fitness function design: In the genetic algorithm, the optimization goal is to minimize the distance required for new tasks. A higher fitness value indicates a shorter distance traveled by the robot, making the individual superior and more likely to enter the next generation.
This function represents the extra distance that the robot moves after task is assigned to the current robot , and takes the reciprocal of it as a fitness function, where is the total distance of the robot after adding the new task to its task set, is the total distance of the task set before the robot adds a new task , and represents the smaller number close to 0.
(3) Selection: To eliminate individuals with low fitness values and retain those with high fitness values, the “roulette wheel method” is used to ensure that superior solutions are prioritized for the next generation, enhancing the quality of the solutions.
where
represents the fitness of the i-th individual and n represents the total number of individuals.
(4) Adaptive crossover and mutation: Adaptive crossover and mutation probabilities are introduced that are automatically adjusted based on the current population’s fitness to avoid the loss of excellent individuals due to fixed probabilities. The crossover probability
and mutation probability
are defined as follows:
In Formula (12), is the one with the higher fitness in the first two parents of the crossover and mutation operation, are the maximum and minimum values of fitness in the population, and is a constant between 0~1. When becomes small, it means that the maximum value of the fitness value of the individuals in the population is close to the average value of the fitness of the individuals in the population, and the algorithm may be close to the global optimal solution, but it may also fall into the local optimal solution. In order to increase the diversity of the population, crossover probability and mutation probability should be increased. When becomes larger, the opposite is true. In a certain generation of population, different individuals should have different crossover probabilities and mutation probabilities to retain high-quality individuals and eliminate low-quality individuals as much as possible. To achieve this, their and are adjusted according to the fitness values of the individuals. When the fitness value of the individual is high, the corresponding and are reduced; when the fitness value of the individual is low, the corresponding and are increased. This nonlinear change is achieved by introducing trigonometric functions to adjust the crossover probability and mutation probability, which helps the algorithm jump out of the local optimal solution.
(5) Incorporating the Metropolis criterion: Solutions with low performances are accepted based on probability principles, helping the algorithm escape local optima and improve global optimization capabilities, preventing premature convergence. The standard is implemented by comparing the fitness of each individual in the new generation with the fitness of the corresponding individual in the previous generation after each new generation of population. If the new generation of individuals has a higher degree of adaptability than the previous generation, they are retained; otherwise, the instance still has a chance to be retained. The probability of the Metropolis criterion retention is:
In Formula (13), represents the difference between the fitness of an individual in a new population and the optimal fitness in an old population, and k is a parameter that assists in calculating the probability of retaining an individual if the current individual is below the optimal fitness of the old population.
(6) End process: If the evolution conditions are not met, for example, if the maximum number of evolution iterations is reached and the best individual does not change for 10 consecutive generations, the evolution ends, and the best path and corresponding distance are output.
3.2.3. Overall Process of Task Scheduling
Task assignment is a highly dynamic process, with customer orders constantly being generated as the system runs, and the types of tasks and requirements corresponding to these orders are constantly changing. Task buffers can effectively respond to this changing demand for tasks, not only by centralizing tasks, but also by providing an opportunity for tenderers to evaluate and bid on these tasks. Each bidder needs to provide a bid value for each task in the task pool, which represents the price or value they are willing to pay to perform the task. In order to effectively manage these bid values, a bid pool is introduced, which acts as a hub for storing the bid values for each task to ensure a transparent task assignment process. Through the introduction of task pools and bid pools, the challenges of dynamic task assignment can be better addressed, ensuring that tasks flow and are distributed efficiently throughout the system, while providing a fair competition opportunity for tenderers. This design helps maintain the timeliness, efficiency, and fairness of the system.
When assigning tasks, in order to ensure load balancing among the robot swarm and reduce the number of situations in which some robots become overloaded, a bidding evaluation method is designed:
In Formula (14), is the cost of the new scheme formed by the bidder after incorporating into its task list, is the cost of the task list when the tenderer does not add a new task, is the normalized trust degree corresponding to the related task, n is the number of tasks in the task list after the robot adds a new task, and , , and are, respectively, the robot’s own stress, the additional loss to the robot due to the new task, and the weights of the corresponding task trustworthiness.
The tenderer obtains the bid values corresponding to all tasks in the task pool through Formula (11) and stores them in its own bidding pool. The bidder takes the smallest bid value from the bidding pool to compete with the bid values selected by other robots. This bid value represents the bidder’s consideration of its own capabilities and the challenges of the new tasks. These two key factors are taken into account to determine the most suitable task for each individual bidder. The formula for bidder i to select the bid value is
In Formula (15), represents the value of the bid issued by Robot , and m represents the total number of tasks received by Robot . After the robot submits the bid, the tenderer compares the bid value of each robot, combines the global information mastered by the tenderer, and selects the most suitable bidder as the winner through the tenderer formula.
For the optimization goal of minimizing the completion time of all tasks in the task pool, the system increment after assigning new tasks t
k to robot R
i is
This increment represents the time taken by the system after is assigned to robot , where represents the longest time taken to complete its own task in the robot group that has not yet added a new task. is the time taken by a robot to complete all its tasks after assigning to .
The bidders’ assessments of the tasks and the tenderer’s objective of minimizing the total completion time of all tasks in the task pool are considered as a dual optimization objective. When using an auction method for task allocation, the robots
calculate the final score for the tasks
using a weighted approach, as follows:
In Equation (17), represents the value of the bid issued by robot , is the time increment of the system after is assigned to robot , and is the weight factor. The lower the value of , the better the strategy.
Subsequently, the tenderer removes the allocated orders from the order list and sends notifications to all bidders. After receiving the notification, the bidders update their bidding pools by clearing the bid values corresponding to the allocated orders. Furthermore, in subsequent order bidding, the already-allocated orders are no longer included in the bidding pool.
Figure 2 illustrates the overall process of the auction method for task scheduling combined with the genetic algorithm.
In order to address the limitations of the contract network algorithm, the genetic algorithm is used to optimize task allocation, update the task list, and combine the market mechanism to realize the reasonable allocation of a group of tasks to the robot group. The adaptive genetic algorithm is embedded in the decision-making process of the contract network and acts as a global optimizer. When a robot completes initial task bidding through the contract network, the system encodes all the current bidding schemes into a population of “chromosomes” of the genetic algorithm, where each chromosome represents a potential task assignment scheme. The objective function (i.e., the total cost Formula (2)) is directly used as the fitness function (Formula (10)) of the genetic algorithm to evaluate the advantages and disadvantages of each allocation scheme. Through selection, crossover, and mutation operations, the algorithm evolves a better allocation strategy in parallel in the robot population. At the same time, the adaptive characteristics of the algorithm avoid the defect that traditional genetic algorithms fall easily into local optimum. The objective function of minimizing the total cost (Formula (2)) drives the deep integration of the adaptive genetic algorithm and the distributed contract network algorithm. The objective function provides a clear optimization direction for the algorithm, the contract network realizes flexible negotiation under the distributed framework, and the genetic algorithm continuously approaches the lower limit of cost through global search.
The process steps are described in detail as follows:
- (1)
The tenderer receives the order, generates tasks, and updates the task pool.
- (2)
Task allocation for the new task pool is performed using an auction method:
Bidders extract tasks from the task pool and use a genetic algorithm for each task to obtain the execution order, distance, and bid value after integrating the new tasks. These tasks are then saved in their own bidding pool. When calculating the execution order, the tasks currently being executed by the bidder are not considered.
Each bidder selects the minimum bid value from their bidding pool to place a bid.
After receiving all bid values, the tenderer combines them with the bidding algorithm to score each bid value and designates the robot with the lowest score as the winner. The corresponding task is assigned to the winner.
The tenderer removes the task from the task pool and notifies all bidders.
The winner updates their task list based on the optimization results.
This process is repeated until all tasks in the task pool are removed.
- (3)
The robots execute all tasks in their task list sequentially based on the optimal task order.
- (4)
The process then waits for new tasks to arrive.