New planning Model of mobile robot based on multi- agent theory in a complex environment

Benmachiche Abdelmadjid, Bouhadada Tahar, Laskri Mohamed tayeb, Zendi Asma LRI (Research Laboratory Computer) / GRIA (Research Group in Artificial Intelligence) / GReLearn (Research Group in E- learning) – Department of Computer Science – University Badji Mokhtar Annaba, Algeria, BP.23000. b enmac hiche@ho tmail.fr , bo uhad ada. tahar @univ-annab a.org, laskr [email protected] g, zendi.asma@ yahoo .fr

Abstract— The robot applications can be found in many of Li and Hu [5], [6]. In the last years, collective navigation activities. It is a field of research that exists for a long time, interests the researchers more and more comparing to the however, many research work deal with several problems, the co- one robot navigation because of its effectiveness, its speed, operation in robotics remain always a current problem because of its complexity in term of time, calculation, the mechanism of its robustness and its capacity to achieve complex tasks. synchronization and the distribution of the roles between the II. ARCHITECTURE OF THE SYSTEM actors of the system. In our simulation, we choose a complex environment with obstacles; it requires a co-operation between the robots or the worker agents in a synchronized way Our work is on two main axes: focusing on a type of specific system and application: construction site; it is about creating an environment of robotics Control of the Robots: this axis gathers the sets of themes specific to a construction site where autonomous mobile robots related to the planning of the way, the generation of must cooperate to deal with the functions related to this trajectories, and robots command in a general way. In this part construction site. we tried to propose a new model of planning for the autonomous navigation of the mobile robots, in other words, to Index Terms— Mobile Robots, Genetic algorithm, multi-agents system. manage several robots in a dynamic environment in an optimal way where they choose the shortest ways by using 2 types of I. INTRODUCTION algorithms, the first type is A* algorithm which gives very Evolutionary Robotics is a very active field of research, a good results in a limited environment for determined missions. rather complete vision of works in this field is presented in But if the 2 starting and arrival points are distanced, the the articles of Floreano and Boots [1], [2]. Co-operation in complexity of the algorithm increases, and for this reason we robotics is a very important problem of optimization in tried to use the power of the biological inspiration, to be very autonomous robotics, it is a topic widely investigated in precise, the genetic algorithms can solve the problems of the high level laboratories. Based on decomposing robot path with a random generator of trajectories. The randomly mission into many tasks then decomposing these tasks into generated obstacles are located in unknown places; the robots secondary ones until we get the elementary task (directly must avoid them by using the 2 algorithms mentioned above. achievable by a robot) according to a mechanism of The robots must avoid the collisions whether with the repartition of the functions so that the multi-robot system obstacles or between themselves. is more efficient according to the following characteristics: Execution time, complexity of the algorithm, the The Inter-robots Communication: one can find here all the robustness and the tolerance of the failures. Finding the works related to the cooperation between robots and the robots shortest path in the multi-robot environment is a complex flotillas control. In this part we did an in-depth study about the and important task, which is described as an optimization types of cooperation and the techniques of communication problem. The aim is to find the shortest way by avoiding between the intelligent autonomous entities (agents or robots) the obstacles for a robot from the starting point up to the distributed, and here is the general Architecture of the system: arrival point. There are several methods which deal with this problem such as the potential field in Zhu [3], the neural networks s in the article of Yang [4], the genetic algorithms presented in the articles Agent C DBND Msg#1 A Update Collection of new data and modeling

Agent E Msg#2 B

Sampling and classification DB totaL

DB builder DB working Msg#8 Agent S E Msg#3 Msg#4 Chef site 'supervisor'

C Agent M Agent M Agent O Agent O ROBOT ROBOT ROBOT ROBOT Msg#7

Results 2 Results 1

Msg#6 Msg#5

D Agent DM Agent DO

Deliberated on Deliberated on the final result the final result

The best solutions possible The shortest way

(---) Message call, (…..) message of completion, (-) Access

Fig. 1. The General architecture of the system

TABLE I. THE RESULT OF COLLECTION OF THE NEW DATA A. Step of Collection of the New Data Num Action Actor This part shows the interaction between two agents in the 1 Take a brick. Builder collection step; it is a communication scenario between the 2 Break a brick. Builder supervisor agent and collector agent. This step starts by the 3 Put a brick. Builder detection of the new data by agent S, which sends a message 4 Find a tool. Worker #1 to wake up agent C. This later gets access to the DB (data 1. Num: represents the order of execution of the action. base) in order to do an aggregation and adaptation (coding) of 2. Action: the requested task. the new data, then to make an external juncture between the 3. Actor: it was he who does the action. new DBND and the DB global. It inserts the new data and updates the evolved existing data and finally, sends a completion B. Step of sampling and classification message to Agent S and sleeps. Each encode new information in a table contains: This step starts when Agent S detects the new updates in the global DB, it sends a message#2 to wake up Agent E who labels the data according to their types of activity, classifies 3) Finds a way which connects the starting point with the and divides the global DB into 2 sub databases (worker robot arrival one. DB and builder robots DB), and finally sends a completion 4) Restarts this operation several times to build the initial message to Agent S and sleeps. population. 5) Minimizes the ways found. Give a sample that corresponds exactly to its own actor in 6) Finds the shortest way. order to separate the activities and to divide the work 7) Waits the end of calculation for the other robots. between the 2 categories of the employing robots. Then, 8) Parallel execution for the robots. create 2 databases DB builder and working DB, finally, to 9) Treatment of the special cases (deadlock). insert in each database the suitable sample (check table 10) Takes the tool and puts the tool. II). ii. The Genetic Module of Reasoning TABLE II. THE RESULT OF CLASSIFYING STEP The genetic module of reasoning is the principal module; it Num Action Actor sample Class defines the physical movements of the robot in its environment

1 Take a brick. Builder B BDD Builder (check fig.4). 2 Break a brick. Builder B BDD Builder 3 put a brick. Builder B BDD Builder 4 Find a tool. Worker O BDD Working

C. Step of Calculation Fig. 4. The General Architecture of the Proposed Genetic Algorithm This step starts when Agent S detects the new updates in the DB working, before sending a message#3 to wake up Agents 1. Coding O. Each Agent O calculates the shortest way and defines the strategy of navigation, it gathers then the calculation results of A way is modeled in the following form: way = {Xi1, Xi2, X ...... , X } or: I: is the number of the robot, index 1. .n, the Agents O in table `Results 1'. When the agent S detects the i3 in where (N) is the length of the way and X is an integer є {0, 1, new updates of the DB builder, it sends a message#4 calling 2, 3}. Agent M. Each Agent M proposes a construction strategy Example: Way= {00001333332222211} Where n is the according to the predefined rules of construction; it gathers the length of the way n=15. results of the Agents M in table `Results 2'. Then, Agent O sends a message of completion to Agent S and sleeps. 2. Initial Population Finally, Agent M Sends a completion message to Agent S and sleeps. It is generated randomly and corresponds to the possible i. Architecture of the worker robot ways to reach the point arrival. Having an acceptable solution (see table1) evokes to plan 100 possible ways in order to lead The interactions between the robot workers are showed in the to the destination, to solve the premature problem of following figure (fig. 2). convergence (local minimum) the algorithm generates a set of solutions (ways), the initial population is presented by a list of lists to give more usability because the length of the found way is not always constant.

Way [1][1], way[1][2],... way[1][n]

Fig. 2. General architecture of the worker robot

. . . randomly. [ ] 1) The robot moves from starting point in the 4 directions Pop-in= way way ... way [2][1], [2][2], [2][n] . . . . . 2) The robot detects the obstacles and records the details of Way [x][1], way [x][2],... way[x][n] the environment. Where N is the number of the ways of each generation and X is a variable which indicates the length of the way.

3. Fitness

It is the sum of the distances between 2 consecutive points belonging to the way, Such as: Fig. 3. Functions of the worker robot F =∑dis (pos (Xi, Yi), pos (Xi’, Yi’)). (1) iv. Results and Discussions

Where pos (Xi, Yi) is the current position of the robot and To test the performance of our solution, we tried to compare it pos (Xi', Yi') is the following position. The result of this with other algorithms with the same conditions: matrix 15 * function is the number of displacements to join the starting 15, and the arrival points, i.e. the length of the way. 40 obstacles, start = {Xd, Yd = 0} and arrival = {Xa, Ya = 14}.The following table presents a comparative study of 4. Selection algorithms for calculating the shortest path, and the manner with which we calculate values. The life cycle of the individuals appears with each generation, on a population of N individuals, 80% will be We have developed a software tool with the C# language, this preserved there, they can be reproduced (the ideal percentage software allows to take the results of the algorithm calculating of selection is between70-95). To keep the best individuals of the shortest path, after it calculates the theoretical distance, and each generation, our algorithm uses a phase of elitism: pulling make a small operation of division in the end it multiple the of the ways according to their length in an ascending order result to one hundred (check table III). then we keep 10% of the current population not reproduced (not crossed and not mutated) to copy them in the new TABLE III. COMPARING THE RESULTS OF THE PROPOSED generation. GENETIC ALGORITHM (GA), NEURAL NETWORK (RN), ANT COLONY (CF) AND ALGORITHM (A *). 5. Crossing (Cross-over) Path length Time(ms) Convergence rate The purpose of the crossing is to enrich the diversity of the AG 28 141,02 100% population by handling the structure of the chromosomes. First RN 31 298,41 91% of all, the meeting points of the two ways are determined, if A* 28 102,12 100% the two ways do not meet, the generated son will be identical CF 29 250,88 96% to the father; if not, we seek the point of meeting which optimizes the way: identical way to that of the father until the The presented histogram (fig. 5.) shows the variation of the meeting point, then identical way to that of the mother from fitness in function of the generations' evolution; we notice the the point of meeting to the end of the maternal way. descending path which represents the minimization of the Moreover, we define the reproduction of an individual by function of fitness. himself, the son being then identical to the father. This makes it possible to preserve certainly the best parents in the following generation.

6. Mutation

To simulate the presence of mutations, just after the reproduction, the generated individual undergoes changes randomly. The probability of change is of 1% (this low rate is justified by the high probability to fall on false ways or obstacles by transferring the boxes i.e. the probability of having a broken way is of 75%, and 25% for a complete way), each change modifies the way concerned by adding a random number to it, then by taking the result of the congruence Fig. 5. Histogram shows the variation of the fitness modulo 4 which represents the 4 directions. Solution advantages are in two orders: we can create an iii. Synchronization Module unlimited number of robots which makes this architecture dynamic and extensible and the multithreading which reduces The synchronization module plays the role of an access the execution time and increases the performances of our manager to the boxes, he uses the semaphores of the mutex system type [7] (only one robot at the same time in a box). In the case of deadlock, where robot 1 requires the box of D. Step of Decision robot 2 and vice versa, we have chosen a robot randomly of and we considered the other as an obstacle then the selected This step starts by the detection of the new updates in table robot calls upon the genetic algorithm and recalculates the way `Results 1' by Agent S that sends a message#5 and wakes up by taking in consideration the changes of the environment, Agent DO that gets access to table `Results 1', and deliberates then the second robot (regarded as obstacle) takes again its the best proposal starting from the results saved in `Results 1' way. according to its knowledge and saves the best proposal of the ‘shortest path’. If agent S detects the new updates in table the distance `d1' between its current location and the ‘Results 2’, he sends a message #6 to call Agent DM. This one position of the required tool, Each working robot calculates gets access to `Results 2' and deliberates the best proposal the distance `d2' between the position of the tool and the starting from the results saved in `Results 2' according to its position of the builder robot, the robot “Agent DO” selects knowledge. Agent DM saves the best solution in `the best the results `d1' obtained by the working robots according to possible solution'. Agent S receives a completion message an ascending order and stores the ID of the robot which from Agents (Agent DO/Agent DM) before they both sleep. calculates the shortest way, the robot “Agent DO” selects the results `d2' obtained by the working robots according in 1. Deliberation’s Mechanism of the Builder an ascending order and stores the shortest way, le robot Robots “Agent DO” calculates the total "dt" distance by a simple operation of addition `dt =d1+d2' (in our simulation the The construction of wall for the cell: to build one wall way is a list of (X, Y). So, concatenating the 2 lists d1 and without breaking bricks (except in special cases), In order d2), the robot “Agent C” updates the table “the shortest to make this operation successful: calculate the length of way” and insert the "dt" list. wall, Calculate the length of the bricks, Length of the wall /length of bricks, the robot “Agent DM” traverses the walls 3. Step of Construction brick after brick, and each mal-positioned one. The counter of the builder robot responsible for this construction If Agent S detects the new updates in `the shortest path ', he increments it to 1, the robot “Agent DM” counts the broken sends a message#7 to wake up Agent O that carries out the bricks and store the ID of the builder robot which proposes the best strategy, the robot “Agent DM” store the best solution sequentially, before sending back a completion strategies in “the best possible solutions” and finally Agent message to Agent S and sleeps (check fig.6). DM sleeps. If Agent S detects the new updates in `the best possible solutions '; it sends a message #8 to wake up Agent M and gets 2. Deliberation’s Mechanism of the Working associated with the best solution, then, the Agent M carries out Robots the solution sequentially. Finally, Agent M sends a completion message to Agent S and sleeps (check fig.6). The working robots start the genetic mechanism to calculate the shortest way. Every working robot calculates

Fig. 6. Scenario of our simulation

REFERENCES CONCLUSION [1] D. Floreano, T. Kato, D. Marocco and E. Sauser, In this study we exposed our approach of co-operative and “Coevolution of Active Vision and Feature Selection. autonomous navigation of the mobile robots in a building site, Biological Cybernetics,” vol. 90, no. 3, pages 218–228, in order to build the plan of navigation in an environment with 2004. obstacles. This example proposes the dialog between the [2] B. Boots, S. Nundy and D. Purves, “Evolution of Visually Guided Behavior in Artificial Agents," Network : robots with the aim of co-operation and responding to the Computation in Neural Systems, vol. 18, no. 1, pages 11– initial objective. 34, 2007. [3] Q. Zhu, Y. Yan, and Xing Z, “Robot Path Planning Based on Artificial Potential Field Approach with Simulated Annealing,” Sixth International Conference on [6] Y. Hu and S. Yang, “A Knowledge Based Genetic Intelligent Systems Design and Applications, Jinan, China, A1gorithm for Path Planning of a Mobile Robot,” 2, 2006, pp.622-627. Proceedings of the IEEE International Conference on [4] S.Yang and M. Meng, “An efficient neural Robotics & Automation, pp.4350-4355, 2004. network approach to dynamic robot motion planning,” [7] Michel Raynal, “ Algorithms for Mutual Exclusion,” MIT Neural Networks, 13(2), 2000, pp.143-150. Press, ISBN 0-262-181193, 1986. [5] Q. Li, W. Zhang, Y. Yin and Z. Wang, “An Improved Genetic Algorithm of Optimum Path Planning for Mobile Robots,” Proceedings of the Sixth International Conference on Intelligent Systems Design and Applications, 2, pp. 637 – 642, 2006.