Multi-Agent Communication in JAFMAS - CiteSeerX

20 downloads 0 Views 31KB Size Report
Alan K. Galan and Albert D. Baker. Department of Electrical and Computer Engineering and Computer Science. University of Cincinnati. Cincinnati, Ohio 45221- ...
Multi-Agent Communication in JAFMAS Alan K. Galan and Albert D. Baker Department of Electrical and Computer Engineering and Computer Science University of Cincinnati Cincinnati, Ohio 45221-0030

This paper shows the approach used in JAFMAS for specifying and analyzing the conversations in a multi-agent system. Conversations are specified using an automata model and converted into a Petri net representation. Using a Petri net analyzer, the conversations are checked for consistency and coherency. We show the conversion of the conversation model to a Petri net and outline the properties that need to be verified.

Introduction The conversations of a multi-agent system dictate the behavior of the system. In order to ensure that the multiagent system will exhibit the desired system level behavior, one must ensure that the interactions between agents is consistent with the goals of the system. This means that the conversations that an agent can engage in must be logically consistent and coherent. Therefore, it is necessary to specify the conversations in such a way that the coherency

of the entire system can be proven. The Java-based Agent Framework for Multi-Agent Systems (JAFMAS) uses an approach as part of it’s multi-agent system design methodology, that allows one to show that a given set of conversations in the system are consistent and coherent. The JAFMAS (Chauhan 1997) methodology uses automata models to specify conversations, which can then be converted into a Petri net representation to analyze for system consistency and coherency. In current work at the University of Cincinnati, the JAFMAS Development Environment (JAFMAS/DE) (Galan) automates the JAFMAS methodology using a graphical interface and an external Petri net analyzer. (Brink 1996) This paper provides an overview of conversation analysis in JAFMAS/DE.

Specifying Conversations

Received: Reject from Q2 Transmit: Propose to Q2

CR2

Transmit: Propose to Q2

S1

S2

CR1

S3

CR3

Received: Accept from Q2

Received: Reject from Q2

Received: Propose from Q2 Transmit: Reject to Q2

CR4

Queen 1

CR10

S4 S8

CR11

S9

Received: Propose from Q2 Transmit: Accept to Q2 Received: Propose from Q1 Transmit: Reject to Q1

Received: Reject from Q3 Transmit: Propose to Q3

CR5 S5

CR6 Recv’d: Propose from Q1 Trans: Propose to Q3 Received: Reject from Q3 Transmit: Reject to Q1

CR9

Queen 3

CR7 S6

CR8

S7

Received: Accept from Q3 Transmit: Accept to Q1

Queen 2

Figure 1 - 3-queens conversations

Galan, Baker: Multi-Agent Communication in JAFMAS The conversations in JAFMAS are specified using a finite state machine representation. The states of the finite state machine represent a state that a given conversation can be in for a particular agent. The transitions represent a change in the conversation’s state based on some communication to and/or from the agent. The transition or conversation rule, as they are called in JAFMAS, are specified by indicating the utterance that an agent can send and/or receive, as well as an action that the conversation rule can trigger on the part of the agent. With each agent having one or more conversations that in turn contain multiple states and conversation rules, the conversation of the entire multiagent system can be completely characterized, with a set of concurrent finite state machines. The automata model for the n-queens problem (in this case with 3 queens) is shown in Figure 1. With a complete specification of the interactions in the system it is important to verify the correctness of the design. To make this determination the conversation

models are converted to a Petri net and analyzed for specific properties.

Using Petri nets to analyze conversations Petri nets have a number of advantages when used to analyze conversations in multi-agent systems. First there are many tools available that will analyze a Petri net for various properties. Additionally, work on Petri nets has been ongoing for many years and the theory and mathematical models behind them are well defined and mature. The conversion of the concurrent finite state machines into a Petri net representation is straight forward and proceeds as follows, refer to Figure 2 for the conversion of the 3queens problem: •First, each state in the automata is represented by a place in the Petri net. This is a one to one mapping of states to places.

To CR5 & CR6

CR2 CR1 S1

S2

S3 CR3

CR4 To CR2

S4

CR5 CR9 S5

S6

CR6

S7 To all Initial States

CR8 To CR10 & CR11

CR7

S8 CR10

S9 CR11

Figure 2 - Petri net conversion for 3-queens problem

Galan, Baker: Multi-Agent Communication in JAFMAS •For each conversation rule present in the state machine, a transition is added to the Petri net. Again this is a one to one mapping of conversation rules to transitions. •For each conversation rule add an arc from the place corresponding to the beginning of the conversation rule to the transition. •Then add another arc from that transition to the place corresponding to the end of the conversation rule. •The transition must now be enabled by any and all utterances which trigger that conversation rule. (i.e., the transition firing corresponds to the conversation rule receiving it’s required utterance and executing.) For each conversation rule do the following, refer to connections between CR8 and CR3 in Figure2 as an example: •Add a place for each utterance that will enable that conversation rule. •Add an arc from the transition, corresponding to each utterance that will enable it to the place(s) in the previous step. •If there are multiple utterances that will enable a conversation rule, then the arc, transition and arc corresponding to that conversation rule will need to be duplicated. For example, CR4 in Figure 2. •Add an arc from the place(s) in the previous step to this conversation rules transition (or duplicated transitions). •For each final state in each conversation a transition is added. For each final state, an arc is added to it’s transition. For example, see connections made from S3, S4 and S7 in Figure 2. •For each conversation one place is added, and arcs are constructed from each of the transitions in the previous step to the place added in this step. This represents the corresponding conversation reaching a final state. When the place added in this step contains a token, that conversation has reached a final state. •One more transition is added for the entire conversation set which corresponds to all of the conversations reaching a final state and then resetting each conversation to their initial states. An arc is added from each place added in the previous step to the transition added in this step. One arc is added from the transition in this step to each place which is marked as an initial state, thus resetting the Petri net. •Finally one token is added to each place that corresponds to an initial state, as in states S1, S5 and S8. Having built the Petri net, from the original conversation model, we can analyze the multi-agent system for coherency. There are several properties of a Petri net that are required in order for that conversation model to be considered coherent. The Petri net must be safe: A place is considered safe if, for all possible markings, the number of tokens in that place never exceeds one. Furthermore, the Petri net is considered safe if all of the places in it are safe. The Petri net must also be live: A transition tj of as marked Petri net is said to be live under a marking M0 if, for all

markings M ∈ R[M0], there exists a sequence of transition firings which results in a marking that enables tj. A Petri net is said to be live if all its transitions are live. This implies that the Petri net does not contain any deadlocked states (i.e., a reachable marking in which none of the transitions are enabled). (Peterson 1981)

JAFMAS/DE An application which extends the utilization of the JAFMAS methodology of specifying and analyzing conversations for a multi-agent system is in development. JAFMAS/DE, the JAFMAS Development Environment, is a graphical development environment that will allow a designer to fully specify the set of agents and their conversations. Furthermore, JAFMAS/DE will automatically convert the conversation models (which are represented as concurrent finite-state machines) into a single Petri net for the multi-agent system, using the method outlined above. This Petri net is then analyzed using an external Petri net verification tool. (Brink 1996) The Petri net is analyzed for the following properties: safeness, liveness and no deadlock conditions. If the Petri net has all of these properties the conversations for that system are considered to be coherent and logically consistent. If the Petri net does not have one or more of the properties, JAFMAS/DE will assist the designer in tracking down the problems in the conversations. When the designer has completed the multi-agent system design and the conversation model is found to be coherent JAFMAS/DE will generate source code in the JAFMAS format, wherein the designer can fill in the low-level agent behavior.

Conclusions We have described conversation models for a multi agent system represented as a set of concurrent finite state machines. The method of conversion from the concurrent finite state machines to a Petri net was shown. The conversion of these models into a single Petri net allows for the use of existing Petri net analysis methods to check the consistency and coherency of the conversations, an important part of the multi-agent system design process. Continuing to use the JAFMAS Methodology as a guide, JAFMAS/DE will attempt to automate this specification and verification process.

References R. S. Brink, A Petri Net Design, Simulation, and Verification Tool, MS Thesis, Department of Computer Engineering, Rochester Institute of Technology, September, 1996. http://www.csh.rit.edu/~rick/thesis/thesis.html D. Chauhan, JAFMAS: A Java-based Agent Framework for Multi-Agent Systems Development and Implementation, ECECS Department Thesis, University of Cincinnati, July 16, 1997. http://www.ececs.uc.edu/~abaker/JAFMAS/index.html

Galan, Baker: Multi-Agent Communication in JAFMAS A. Galan, JAFMAS/DE: JAFMAS Development Environment, ECECS Department Thesis, University of Cincinnati, forthcoming. J. L. Peterson, Petri Net Theory and the Modeling of Systems, Prentice Hall, Englewood Cliffs, New Jersey, 1981.