Distributed Cognitive Mobile Agent Framework for Social Cooperation: Application for Packet Moving Umar Manzoor and Samia Nefti Department of Computer Science, School of Computing, Science and Engineering, The University of Salford, Salford, Greater Manchester, United Kingdom
[email protected],
[email protected]
Abstract. In this paper we have proposed Distributed Cognitive Mobile Agent Framework for Social Cooperation to transfer packets from source to destination in randomly varying environment in the most efficient way with the help of mobile agents. We are considering Packet Moving problem in 2-D environment consisting of packets and destinations. The task of each mobile agent is to move the packet from the source to the destination. Simulated environment is dynamically generated with varying graph size (i.e. number of nodes in graph), package ratio and number of destinations. Packages and destinations are randomly placed in the graph and the graph is divided into societies to encourage an efficient and manageable environment for the Agents to work in parallel and share expertise within and outside the society. The proposed framework is based on layered agent architecture and uses decentralized approach and once initialized manages all the activities autonomously with the help of mobile agents. Keywords: Social Cooperation, Automated Packet Moving, Cognitive Mobile Agents, Collaborated Agent System, Multi-Agent System.
1 Introduction The unique characteristic of Agent paradigm makes it potential choice for implementing distributed systems. Agents are software programs which acts autonomous on the environment on the behalf of the user. Agents are assigned specific goals and before acting on the environment agent chooses the action which can maximize the chance to achieve their goal(s). Agents are of many types and in this paper we are interested in intelligent and mobile agents. Intelligent agents are software programs which have the capability of learning from the environment and respond to the dynamic events in timely and acceptable manner in order to achieve its objectives or goals [1, 6]. Mobile agents are software programs which have the capability of moving autonomously from one machine to another with its data and state intact [2, 8]. In Multi Agent System, two or more autonomous agents work together in order to achieve their common goal(s). These agents can collaborate and communicate together to solve complex problems which are outside single agent ability. In order to M.D. Lytras et al. (Eds.): WSKS 2009, LNAI 5736, pp. 584–593, 2009. © Springer-Verlag Berlin Heidelberg 2009
Distributed Cognitive Mobile Agent Framework for Social Cooperation
585
improve its and overall efficiency, these agent(s) can learn from the environment and use the knowledge learned in making decisions. The major characteristics of Multi Agent System are its flexibility and decentralized design which makes it ideal for implementing distributed application. Because of the decentralized design partial failures do not affect the overall performance of the system and these systems have the capability of recovery from partial failures automatically. Because of the tremendous capabilities of Multi Agent System, MAS have been used in the areas of organizational learning, network routing, network management, computersupported knowledge work, mine detection and file transfer [5, 13, 4, 3, and 14]. 1.1 Problem Definition We are considering Packet Moving problem in 2-D environment consisting of packets and destinations. The task of each Mobile Agent is to move the packet from the source to the destination and the problem has the following constraints.
Each Agent can carry one packet at a time. Each Agent can move in four (Left, Right, Top, and Bottom) directions. Agent can not pass through the packet or hurdle (obstacle) in the way. Agent can move the packet or hurdle in the way or can maneuver around it. Moving the hurdle or packet out of the way has two times the normal cost. Moving the packet from one state to another has some cost associated with it. Picking the packet or setting it down has no cost.
In [9] Guillaume et al proposed reinforcement learning algorithm (Q-Learning) for block pushing problem. In [10] Adam et al proposed STRIPS planning in multi robot to model block pushing problem. In this paper we have proposed Distributed Cognitive Mobile Agent Framework for Social Cooperation to transfer the packet from source to destination in randomly varying environment in the most efficient way with the help of mobile agents. The framework is based on layered agent architecture and uses decentralized approach. The framework once initialized with the domain knowledge manages all the system activities autonomously with the help of mobile agents. What makes proposed framework different from other approaches is its flexibility, decentralized design, and social cooperation. 1.2 Simulated System In our simulated environment Goal Graph is dynamically generated with varying graph size (i.e. number of nodes in graph), package ratio and number of destinations. Packages and destinations are randomly placed in the graph and graph is divided into societies. Each society will have some Worker Agents and one Area Manager Agent, the society area will be managed its Area Manager Agent. The purpose of creating societies is to encourage an efficient and manageable environment for the Agents to work in parallel and share expertise within and outside the society. We have generated graph of different sizes ranging from 10x10 to 100x100 with an increment of 10. For each size we have generated graphs with packet ratio ranging from 1 to 20 percent with an increment of 1 percent and destination ranging from 1 to 9 with an increment of 1. For each packet ratio, twenty different graphs were generated and for each run 10 trails are generated with varying range of destinations
586
U. Manzoor and S. Nefti
(i.e. from 1 to 9). For each twenty different mazes the number of agent’s engaged in the search are changed from 2 to 5. We have tested the framework on more than 4000 test runs with different graph sizes, packet ratios, number of destinations and number of agents. The real application of this multi-agent based software simulation would be for the Mobile Robots to drop the packets to the destination efficiently in an unknown and continuously varying environment.
3 System Architecture Distributed Cognitive Mobile Agent Framework for Social Cooperation is a multiagent based framework for moving the packets efficiently to destination with the help of mobile agents. Each Agent can move in four (Left, Right, Top, and Bottom) directions and each move has some cost. Moving the packet has cost associated with it but not with picking it or setting it down. Each agent can not pass through the packet or obstacle and have the capability of carrying only one packet at a time. While moving one packet to destination, if it encounters another package in the way, it can maneuver around it or move the package out of the way depending upon the situation. Moving the package out of the way might be beneficial but the cost of moving is high (two times the normal cost). The system consists of the following agents: • • •
Manager Agent (MA) Area Manager Agent (AMA) Worker Agent (WA)
3.1 Manager Agent (MA) Manager Agent (MA) is responsible for the initialization of the system and in initialization it performs a set of tasks. 1) 2) 3) 4)
MA creates and initialize the grid using the Goal Graph Module (GGM) and place the packages at random positions in the grid. MA divides the grid into n societies using Society Formulation Module (SFM) where n depends upon the resources. Each society will have some Worker Agents and will be managed by Area Manager Agent. MR is responsible for creation and initialization of Area Manager Agent (AMA). MA will create n AMA’s where n is the number of societies and each AMA will be assigned one society. In initialization MA passes society goal graph (partial goal graph of the grid), number of Worker Agents, number of packets, and the number of destinations as arguments to AMA. The AMA of each society can communicate with other AMA’s for information sharing, resource required, etc.
MA maintain the states of all the AMA’s in state table using State Module (SM) and keep checking the state table after periodic interval. If AMA state is set to “IDLE”, this means AMA has performed the task assigned and its resources are free.
Distributed Cognitive Mobile Agent Framework for Social Cooperation
587
Fig. 1. Distributed Cognitive Mobile Agent Framework for Social Cooperation: Application for Packet Moving
MA can assign AMA and its resources to the neighboring society where packet to destination ratio is high. If all the AMA’s are set to “IDLE”, this means that all the tasks in the goal graph have been performed. 3.2 Area Manager Agent (AMA) The role of Area Manager Agent (AMA) is to coordinate and manage a group of Worker Agent (WA) in a society. The coordination is done to ensure that there are no collisions and congestion among the WA. AMA also provides timely information to
588
U. Manzoor and S. Nefti
WA so that the actions of the WA’s are synchronized in order to avoid redundant problem solving. In order to manage its society each AMA set its commitments (i.e. handing over a specified task) and conventions (i.e. managing commitment in changing circumstances). The commitments are implemented in the form of state tables that are maintained by the AMA of each particular society for managerial purposes. The state table contains Agent number, state (Busy or Idle), task (Packet Number) and their respective capabilities (in terms of cost). The AMA can change its role dynamically, when there are enough agents in an area to perform the task, it acts as a manager and when there are not enough agents AMA can act as manager as well as Worker Agent. It is the responsibility of the AMA to assign a particular task of the goal graph to an appropriate WA. AMA multicast’s the information of different tasks to all the WA of the society. All the WA are required to calculate the optimal cost (shortest path to perform the task) keeping in view their previous estimation of cost and report it back to the AMA. The AMA decides on the bases of bidding which WA should be assigned the specific task. The lowest bidder is assigned the task and AMA updates its state table. When the task is successfully completed, every WA is supposed to report the AMA, the start and the end time for that particular task. All the AMA’s periodically submits the task table to the Data Base Module for insertion in database. When all the tasks on the AMA’s society are completed, it reports to the MA about his idle state. 3.3 Worker Agent (WA) The role of Worker Agent (WA) is to move the packet from the source to the destination. In response to AMA task multicast, WA estimates the cost and bid cost back to the AMA. WA calculates the cost for bidding purpose using the Euclidean distance from the source to the destination and ignores the obstacles in calculating the cost. WA uses LRTA* [12] Algorithm to move packet from source to destination and have a vision of one state ahead. If WA encounters obstacle in the way to destination, its first preference will be to move around the obstacle. If more then one obstacles are in its surrounding, it will move the obstacle out of the way. The framework is built in Java using Java Agent Development Framework (JADE) [11] and it has the following modules.
Goal Graph Module (GGM) Society Formulation Module (SFM) State Module (SM) Data Base Module (DBM)
3.4 Goal Graph Module (GGM) The GGM is responsible for creating the goal graph with N Nodes where N is passed as arguments. Goal graph consist of nodes and edges and GGM places Packets, Destinations and Agents randomly on the nodes of the graph and also adds random cost to the edges of the graph. The goal graph represents the dependencies between the packet and destination and goal graph is used to calculate the shortest path to the
Distributed Cognitive Mobile Agent Framework for Social Cooperation
589
packet or destination. Once the goal graph is divided by the RA, the particular part of the goal graph is passed to the AMA for task completion. 3.5 Society Formulation Module (SFM) This module takes total number of agents, graph as input and calculates the best society formation keeping in view total number of agents and area to packet ratio. The purpose of creating societies is to encourage an efficient and manageable environment for the Agents to work in parallel and share expertise within and outside the society. Grid area will be divided into societies and each society will manage its own area. The AMA of each society can communicate with other AMAs for information sharing or resource sharing.
Fig. 2. Grid Division
3.6 State Module (SM) The SM is responsible for maintaining two instances of hash table, one instance of Area Manager Agents (AMA) and other one for Worker Agents (WA). The AMA table is continuously monitored by the Manager Agent (MA) to get update on the status of tasks performed by AMAs. Similarly WA table is continuously monitored by AMA to get update on the state of tasks performed by WA. Agents state can be busy or idle and with each state extra information (i.e. task id, source, destination, cost, current position etc) is stored to help AMA or MA in planning.
590
U. Manzoor and S. Nefti
3.7 Data Base Module (DBM) Data Base Module contains all the necessary data base related functions. This module contains methods to Connect, Insert, Retrieve, Delete and Run Queries on the database. DBM will be used by different agents to insert experiment results in the database which is used to analyze the performance of the system.
4 Performance Analysis We have evaluated this framework on randomly generated graph of different sizes ranging from 10x10 to 100x100 with an increment of 10. For each size different graphs were generated graphs with varying
Packet ratio (ranging from 1 to 20 percent with an increment of 2 percent) Destinations (ranging from 1 to 9 with an increment of 2)
For each packet ratio, twenty different graphs were generated and for each run 10 trails are generated with varying range of destinations (i.e. from 1 to 9).
No of Agents Vs Time (80x80)
Packet Ratio
11% 9% 7% 5% 3% 0
200
400
600
800
1000
Time (Seconds) 1
2
3
4
5
Fig. 3. No. of Agents Vs Time
For each twenty different mazes the number of agent’s engaged in the search are changed from 2 to 5. Figure 3 shows the time taken by different number of agents per society with varying number of packet ratio in 80x80 graph size. As we increase the number of agents in the society, time to complete the task reduces. However, as we keep on increases the number of agent per society the improvement in task time reduces because of dependency between the societies. As we increase the number of agents per society to 3, the time taken to complete the task reduces considerably but if we keep on increasing the numbers of agents the improvement is marginal (Figure 3).
Distributed Cognitive Mobile Agent Framework for Social Cooperation
591
Grid Size Vs No of Agents
Time (Seconds)
4
800 600
3
400
2
200
No of Agents
5
1000
1
0 10x10
30x30
50x50
70x70
1 Grid 2 Size 3 4
5
Fig. 4. Graph Size Vs No. of Agents
Time (Seconds)
Packet Ratio Vs Time 400 350 300 250 200 150 100 50 0 10x10
30x30
50x50
70x70
Grid Size 3%
5%
7%
9%
11%
Fig. 5. Packet Ratio Vs Time
Figure 4 shows the comparison of Graph size with reference to number of agents with 11 percent packet ratio, increasing the number of agents in small graphs size does not improve the task completion time considerably however, as we increase the graph size number of agent plays important role in decreases the task time as shown in Figure 4. Figure 5 shows the time taken by five agents to complete the task with varying graph size and packet ratio. For small graph size the completion time difference with
592
U. Manzoor and S. Nefti
No of Socities Vs Time
Time (Seconds)
600 500 400 300 200 100 0 10x10
20x20
30x30
40x40
50x50
60x60
70x70
80x80
Grid Size 1
2
3
4
5
Fig. 6. No of Societies Vs Time
respect to varying packet ratio is insignificant however as we increase the graph size the completion time increase slightly. But if we consider the number of packets increased in the graph the difference between the times is ignorable and it demonstrates the efficiency of our system because of parallelism. Figure 6 shows the effect of increasing the number of societies on the task completion time with reference to five agents and 11 percent packet ratio on varying graph size. Increasing the number of societies decreases the task completion but up to a specific value. As shown in Figure 6, the completion time is decreasing until the number of societies is equal to 3 after that the increase in the number of societies does not affect the completion time.
5 Conclusion In this paper, we have proposed Distributed Cognitive Mobile Agent Framework for Social Cooperation for moving the packets efficiently to destination with the help of mobile agents. Mobile agents are software programs which have the capability of moving autonomously from one machine to another with its data and state intact. Packages and destinations are randomly placed in the graph and graph is divided into societies. Each Agent can move in four (Left, Right, Top, and Bottom) directions and can carry one packet at a time. While moving one packet to destination, if it encounters another package in the way, it can maneuver around it or move the package out of the way depending upon the situation. We have tested the framework on more than 4000 test runs with different graph sizes, packet ratios, number of destinations and number of agents. Results were promising and demonstrate the efficiency of the proposed framework. The real application of this multi-agent based software simulation would be for the Mobile Robots to drop the packets to the destination efficiently in an unknown and continuously varying environment.
Distributed Cognitive Mobile Agent Framework for Social Cooperation
593
References 1. Manzoor, U., Nefti, S.: An agent based system for activity monitoring on network – ABSAMN. Expert Systems with Applications 36(8), 10987–10994 (2009) 2. Ilarri, S., Mena, E., Illarramendi, A.: Using cooperative mobile agents to monitor distributed and dynamic environments. Information Sciences 178, 2105–2127 (2008) 3. Watanabe, T., Kato, K.: Computer-supported interaction for composing documents logically. Int. J. Knowledge and Learning 4(6), 509–526 (2008) 4. Gavalas, D., Greenwood, D., Ghanbari, M., O’Mahony, M.: Hierarchical network management: a scalable and dynamic mobile agent-based approach. Computer Networks 38(6), 693–711 (2002) 5. Martínez León, I.M., Ruiz Mercader, J., Martínez León, J.A.: The effect of organisational learning tools on business results. Int. J. Knowledge and Learning 4(6), 539–552 (2008) 6. Greaves, M., Stavridou-Colemen, V., Laddaga, R.: Dependable Agent Systems. IEEE Intelligent Systems 19(5) (September-October 2004) 7. Manzoor, U., Ijaz, K., Shahid, A.A.: Distributed Dependable Enterprise Business System – DDEBS. In: Proceeding of Springer Communications in Computer and Information Science, Athens, Greece, September 24-28, vol. 19, pp. 537–542 (2008), ISBN 978-3-54087782-0 8. Milojicic, D., Douglis, F., Wheeler, R.: Mobility: Processes, Computers, and Agents. ACM Press, New York (1999) 9. Laurent, G., Piat, E.: Parallel Q-Learning for a block-pushing problem. In: Proceeding of IEEE International Conference on Intelligent Robots and Systems, Hawaii, USA, October 29 – November 03 (2001) 10. Galuszka, A., Swierniak, A.: Translation STRIPS Planning in Multi-robot Environment to Linear Programming. In: Rutkowski, L., Siekmann, J.H., Tadeusiewicz, R., Zadeh, L.A. (eds.) ICAISC 2004. LNCS (LNAI), vol. 3070, pp. 768–773. Springer, Heidelberg (2004) 11. Java Agent Development Framework (JADE), http://jade.tilab.com/ 12. Niazi, M., Manzoor, U., Ijaz, K.: Applying Color Code Coordinated LRTA* (C3LRTA*) Algorithm on Multiple Targets. In: Proceeding of 9th IEEE International Multitopic Conference (INMIC), pp. 27–32 (2005) 13. Qu, W., Shen, H., Sum, J.: New analysis on mobile agents based network routing. Applied Soft Computing 6(1), 108–118 (2005) 14. Manzoor, U., Nefti, S., Hasan, H., Mehmood, M., Aslam, B., Shaukat, O.: A MultiAgent Model for Mine Detection – MAMMD. In: Lytras, M.D., Carroll, J.M., Damiani, E., Tennyson, R.D. (eds.) WSKS 2008. LNCS (LNAI), vol. 5288, pp. 139–148. Springer, Heidelberg (2008)