MULTI-MACHINE AND MULTI-TASK EMERGENCY ALLOCATION ALGORITHM BASED ON PRECEDENCE RULES

. Aiming at the problems of asymmetric information and unrea-sonable emergency allocation schemes in the current cross-regional emergency operation, the emergency deployment process of multi-machine and multi-task is analyzed, and the emergency allocation model with the goal of minimizing the allocation cost and loss is established in the paper. Emergency allocation algorithm based on rule of nearest-distance-ﬁrst, which allocate machinery for the nearest farmland ﬁrstly, and emergency allocation algorithm based on rule of max-ability-ﬁrst, by which machinery with maximum ability to farmland is allocated ﬁrstly, are proposed. The operational data of farmland and agricultural machinery generated randomly are calculated and analyzed. The results show that when the amount of agricultural machinery is suﬃcient, the algorithm based on the maximum contribution capacity priority is better. When the agricultural machinery is insuﬃcient, the calculation results of the emergency allocation algorithm based on the nearest distance priority are better. When the number of farmland is not more than 30, the average operation time of the two algorithms in this paper is not more than 3.8 seconds, and both two algorithm have good performance.


1.
Introduction. China is a large agricultural country. Agricultural machinery is the material basis and technology carrier for the development of modern agriculture. It is also a key link in promoting the readjustment of economic structure. How to improve the organization degree and information level of agricultural machinery operation and to ensure grain granting is the primary task of China's agriculture.
How to improve the earnings of the machine hand and the farmers is an important issue in front of us [19,22].
In the harvest season, a large number of agricultural machinery is busy for harvesting. when the bad weather or emergency operation needs is coming it is an urgent need for an emergency operations plan to guide the harvest to plant crops. Local agricultural management generally called all the available agricultural machinery to participate in the task of emergency harvest by the form of telephone, SMS, posting notice under tighter time restraints, agricultural management department is unable to obtain the real-time information about GPS position, operation ability of available agricultural machinery and position of farmland. The available machinery is allocated by artificially assigned or experience and it is unable to obtain reasonable allocation schemes. Some farmland tasks are completed with redundant agricultural machinery, other farmland tasks are uncompleted in time and suffer more loss because of lack of agricultural machinery. Therefore, the reasonable emergency allocation scheme of agricultural machinery plays a very important role for completion of farmland. In order to minimize the loss, the information of agricultural machinery and farmland should be integrated, and a scientific and rational allocation scheme should be put forward.
Most European countries, the United States, Canada, Australia and other countries have a large scale of land management and good economic conditions, so that they can be equipped with large agricultural machinery to ensure the demand for agricultural production. Because the utilization rates of their machinery is relatively high and large-scale agricultural cross-cutting operations are rarely organized in these countries, few people researched the cross-farm operation of agricultural machines in foreign countries. Farms and agricultural machines are generally owned by farmers in foreign countries, which is different from China. Their agricultural machinery dispatching focuses on the coordination between harvested machinery and transportation vehicles [1,2,5,[10][11][12]. In domestic studies, agricultural machinery allocation scheme based on machine owners' selection is proposed, the optimization model with high income and low cost is established and agricultural machinery allocation algorithm based on heuristic priority rules is designed in the literature [20,21]. In order to meet the scheduling demand, the spatial-temporal scheduling model of agricultural machinery resources based on time window is constructed and the optimal solution of each decision are calculated by the idea of dynamic programming in the literature [16]. The emergency vehicle scheduling model based on the objective function of minimizing the weighted response time cost and minimizing the emergency materials is established through improving the general emergency vehicle scheduling model, and a solving method based on genetic algorithm is proposed in the literature [3]. A two stage stochastic programming model is established based on complex disaster scenarios, the first stage of the location inventory model is transformed into an unconstrained nonlinear optimization model, the solution is solved by the adaptive immune clonal selection algorithm potential offset algorithm is provided in the second stage, and finally the feasibility and validity of the model and algorithm are verified in the literature [17]. According to the distribution of disaster caused by extreme weather, the best response function of agricultural machinery allocation is proposed, the emergency game compensation is calculated and the best response function of delay tolerance is obtained in the literature [8]. And then the discrete population mapping of agricultural machinery scheduling in extreme weather is obtained, and the particle swarm optimization is realized and the optimal scheduling is calculated by the particle swarm optimization theory. Aiming at the problems of information lagging and poor timeliness in agricultural machinery operation, the emergency allocation model is built in some of the literature [4]. Agricultural machinery operation data is collected through GIS, GPRS and GPS technologies, and the management information system or decision making system of agricultural machinery operation is established in other literature [6, 7, 9, 13-15, 18, 25]. Many factors affect the cross-regional emergency allocation of agricultural machinery including time, location, road condition, distance, type and quantity, operation capacity, operation price, weather, etc. When the emergency tasks are coming, it is an urgent need for an emergency operations plan to guide the harvest to plant crops. However, scientific and effective intelligent decision service cannot be provided by the existing system. Based on this, multimachine and multi-task emergency allocation problem is studied in this paper.
2. Problem statement and preliminaries.
2.1. Description of emergency allocation problem. Emergency allocation should make scientific and rational decision within the time limit, and many agricultural machineries need to be allocated among many farmlands Therefore, it is necessary to integrate the information of farmlands and agricultural machinery. With the help of intelligent terminals installed on agricultural machinery, intelligent agricultural machinery can realize automatic acquisition, transmission and storage of the whole mechanization data, provide intelligent decision and information services for farmers, machine hand, cooperatives, government departments by information technologies of mobile Internet, IoT and Beidou positioning. When there is an urgent task, farmland information will be reported from various regions to agricultural machinery management department, including latitude and longitude, areas of farmland. The intelligent terminal, which is installed on the agricultural machinery, can be uploaded to the intelligent agricultural machinery platform by the information of longitude and latitude, operation ability, oil consumption, driving speed and so on. It is necessary to establish a mapping relationship between agricultural machineries and farmlands in the problem of emergency allocation. According to longitude and latitude of farmland, the nearby available agricultural machinery information can be intelligently searched, the allocation schemes, which the goal is to minimize allocation cost and loss can be calculated through multi-machinery and multi-tasks emergency allocation algorithm. And then the government, agricultural machinery management department and other departments or cooperatives can obtain scientific and reasonable allocation suggestion. The process of emergency allocation of agricultural machinery based on intelligent platform is as shown in the figure 1.
If the areas of the affected farmland are large but the agricultural machinery is not sufficient, the goal of emergency allocation is to reduce the loss as much as possible. If the available agricultural machinery is adequate, the goal of emergency deployment is to complete the emergency task within the prescribed time limit and to obtain the minimum cost. The multiobjective and multitask agricultural machinery emergency allocation problem will be studied in this paper.

2.2.
Establishment of emergency allocation algorithm model. When the bad weather is coming or urgent operation needs, the first consideration is how to quickly organize the agricultural machinery to finish the task in the nearest time and ensure the lowest loss of farmland and the second consideration is the lowest Figure 1. Schematic diagram of emergency allocation of agricultural machinery allocation cost. The scientific and rational decision within the limited time should be made quickly, which involves many agricultural machineries need to be allocated between the multiple farmland sites. Therefore, it is necessary to integrate the information of the farmland sites and the agricultural machinery to cope with emergency allocation. According to the analysis of the problem of emergency allocation, the issue of emergency allocation will be formally described in this section.
1 A = {a 1 , a 2 , . . . , a m }, set A represents m of farmland, any of farmland, a i can be expressed in the following form. b j = {ability j , velocity j , cost j , locM j } ability j represents thee working ability of agricultural machinery b j , velocity j represents driving speed of agricultural machinery b j .costt j = {costI j , costS j } represents the total cost from agricultural machinery b j to farmland a i , costI j represents oil cost per kilometer costS j represents operational cost per day.
locM j = {lngM j , latM j } represents the location of agricultural machinery b j , lngM j , latM j respectively represent the latitude and longitude information of agricultural machinery b j .
represents path planning scheme sets from n of agricultural machinery to m of farmland. any scheme s ji represents path planning scheme from agricultural machinery b j to farmland a i .
Decision variable z ji can be expressed in the following form.
z ji = 1, represents agricultural machinery j provide service for farmland i 0, represents agricultural machinery j notprovide service for farmland i t ji = {td ji , ta ji , ts ji , te ji } represents time sets from agricultural machinery b j to farmland a i . td ji represents departure time from agricultural machinery b j to farmland a i . ta ji represents arrival time from agricultural machinery b j to farmland a i . ts ji represents starting work time represents departure time from agricultural machinery b j to farmland a i . te ji represents ending time represents departure time from agricultural machinery b j to farmland a i . sc ji represents operating areas that agricultural machinery b j working for farmland a i . d ji represents the actual distances from agricultural machinery b j to farmland a i , T deadline represents the deadline time of the emergency tasks.
From the above analysis it can be known that the goals are lowest allocating cost and minimum losses. The total cost consists of two parts. One is the driving cost, the other one is the operating cost in the constraint formula (1) The ending time from agricultural machinery b j to farmland a i is equal to the arrival time from b j to a i and the working time of agricultural machinery b j serving for farmland a i in the constraint formula (2). The total operating areas of farmland a i are no more than the areas of farmland a i in the constraint formula (3). The completion time that agricultural machinery b j working for farmland a i should be no later than T deadline .

3.
Multi-machine and multi-task emergency allocation algorithm based on precedence rules. The multi-machine and multi-task emergency allocation algorithm is a kind of multi-stage decision optimization problem. Multi-farmland emergency tasks are completed by numbers of agricultural machinery in multiple stages. When the agricultural machinery is sufficient to complete all farmland assignments, the allocation goal is to minimize the cost. When the available farm machinery is not sufficient to complete all farmland tasks, the goal of allocation is to minimize the loss. Multi-machine and multi-task emergency allocation algorithm based on precedence rules is proposed in this paper. The two precedence rules, which one is nearest distance first and the other one is maximum ability priority, are described in details.
3.1. Emergency allocation algorithm based on rule of nearest distance first. Main idea of emergency allocation algorithm based on rule of nearest distance first is as follows. Calculate the distance from all agricultural machinery Figure 2. Flow Chart of Emergency Allocation Algorithm with Rules of Short-Distance First to all farmland according to the latitude and longitude of agricultural machinery and farmland. Find out the nearest distance between agricultural machinery and farmland, and assign the farm machinery to the farmland first. If this agricultural machinery has completed the task of farmland, judge whether the agricultural machinery can continue to work. If yes, this agricultural machinery will be allocated to the nearest farmland. If the farmland is not completed, the nearest farm machinery is searched for its service. The algorithm will stop until all farmland is served, or all agricultural machinery is allocated.

3.2.
Emergency deployment algorithm based on the max-ability-first strategy. Operational ability refers to the area that an agricultural machinery can serve a farmland within a time limit. M A ji represents the operational ability between agricultural machinery b j and farmland a i and the calculation formula is as follows.
M A ji = ability j * (te ji − ts ji ) (5) Main idea of emergency allocation algorithm based on rule of max-ability-first is as follows. Calculate the operational ability from all agricultural machinery to all farmland according to the latitude and longitude of agricultural machinery and farmland. Find out the maximum operational ability between agricultural machinery and farmland, and assign the farm machinery to the farmland first. If this agricultural machinery has completed the task of farmland, judge whether the agricultural machinery can continue to work. If yes, calculate the operational ability of this agricultural machinery to all other farmland, find out the maximum one and the next farmland and assign the agricultural machinery for the next farmland. If the farmland is not completed, calculate the operational ability of all other machinery to this farmland, find out the maximum one and the next agricultural machinery and assign it for this farmland The algorithm will stop until all farmland is served, or all agricultural machinery is allocated.

4.1.
Experiments preparation and calculation. The emergent scheduling and allocating schemes are calculated and analyzed in the paper. These following information, which including farmland area, working ability of agricultural machinery and the latitude and longitude of available agricultural machinery and farmland, can be generated randomly within a certain range. The latitude range of farmland is from 36.30000 to 36.600000 and the longitude range of farmland is from 114.50000 to 115.100000 Area range of farmland is from 0.15hm 2 to 0.5 hm 2 . The latitude range of agricultural machinery is from 36.200000 to 36.800000 and the longitude range of agricultural machinery is from 114.3000 to 115.40000. And the distances between each agricultural machinery and each farmland and the distances among different farmland are calculated by the latitude and longitude of available agricultural machinery and farmland through map interface of Baidu. The information of emergent farmland and available agricultural machinery generated randomly are respectively shown in Table 1 and Table 2. It is assumed that agricultural machinery has the same driving fuel consumption when they have the same he driving speed in the paper. Driving speed of agricultural machinery is 30 Km/h, and the driving fuel consumption is 0.1L/h agricultural machinery with different working ability has different operating fuel consumption Detailed information is shown in Table 3.
In order to describe clearly in the experimental parts, emergency scheduling and allocating algorithm based on nearest-distance-first strategy is denoted as NDF and emergency scheduling and allocating algorithm based on the max-ability-first strategy is denoted as MAF According to the above information of farmland and agricultural machinery, the two algorithms are made a comparison at aspects of total losses, cost, distances and completion ratio. The comparison results of two algorithms are shown in Table 4.
The results from Table 6 are shown that the total distances and costs of NDF is more than those of MAF and the losses of two algorithms are 0 and the completion ratio of both two are 100% with adequate agricultural machinery. The allocation results of NDF are better than that of MAF.

Comparison and analysis.
To verify the feasibility and applicability of the two emergent scheduling and allocating algorithms deeply, the information of farmland and agricultural machinery are generated randomly in the paper. The number of farmland is six in each groups and the amount of group is eight. The amount of emergent agricultural machinery is twelve. The scheduling and allocating schemes obtained by the two algorithms proposed in this paper are analyzed in-depth, according to whether the amounts of agricultural machinery adequate or not. The calculation results of the two algorithm are shown in Table 5 and Table 6. The results from Table 5 are shown that the losses ratio of both NDF and MAF are 0 when the available agricultural machinery is adequate. While the total cost and distances of MAF are less than those of NDF The results from Table 6 are shown that the total cost and distances of NDF are less than those of MAF when the available agricultural machinery is insufficient.
To further verify the performance of the algorithms, the two algorithms proposed in the paper and the algorithm which proposed in the literature [20] and denoted as NCG are compared at the aspect of the average operation time when the number of agricultural machinery is 12 and the number of farmland is 6, 10, 15 and 30 The comparison results of the average operation time are lists in Table 6. Average operation time of NCG is denoted as AOT N CG , average operation time of SDF is denoted as AOT SDF , average operation time of MAF is denoted as AOT M AF . IR 1 and IR 2 , which represents the increasing ratio, are defined as follows. Table 7 the average operation time of NCG is 3.185s and those of SDF and MAFA is no more than 2.4s, and the increasing ratio is more than 26% when the number of farmland is 6. The increasing ratios are respectively more than 37% and 40% when the number of farmland is 10 and 15. The average operation time of NCG is 6.463 and those of SDF and MAF is no more than 3.7s, and the increasing ratio is more than 42% when the number of farmland is 30. In conclusion, with the increase of the number of farmland, the average operation time of the two algorithms is obviously lower than the running time of the algorithm in the literature [20]. The average operation time of the two algorithms in this paper have good performance.

5.
Conclusions. According to the characteristics of emergency deployment analyzed in the above, agricultural machinery emergency deployment with multimachinery and multi-task is an NP problem. Emergency allocating algorithm based on nearest-distance-first strategy and emergency allocating algorithm based on the max-ability-first strategy are proposed in this paper. The two algorithms are both allocation algorithm based on priority The main differences are that the former one is to give priority to assign the agricultural machinery to the nearest farmland and the latter one is to give priority to assign the agricultural machinery to the farmland.
Emergency scheduling and allocating algorithm based on short-distance-first strategy is more applicable to the situation with insufficient farm machinery and emergency scheduling and allocating algorithm based on the max-ability-first strategy is more applicable to the situation with adequate farm machinery. The problem of multi-machine and multi-task emergency allocation is a complex system engineering. the complex factors will be analyzed in depth, and the dynamic deployment model and algorithm based on multiple factors will be analyzed in the follow-up study. 4093),and Science and technology research project of Hebei higher education institutions(Grant No.BJ2018012)