1. Interaction Protocols
  2. Ongoing conversations between agents often fall into typical patterns. In such cases, certain message sequences are expected, and, at any point in the conversation, other messages are expected to follow. These typical patterns of message exchange are called protocols. A designer of agent systems has the choice to make the agents sufficiently aware of the meanings of the messages, and the goals, beliefs and other mental attitudes the agent possesses, that the agent’s planning process causes such protocols to arise spontaneously from the agents’ choices. This, however, places a heavy burden of capability and complexity on the agent implementation, though it is not an uncommon choice in the agent community at large. An alternative, and very pragmatic, view is to pre-specify the protocols, so that a simpler agent implementation can nevertheless engage in meaningful conversation with other agents, simply by carefully following the known protocol.

    This section of the specification details a number of such protocols, in order to facilitate the effective inter-operation of simple and complex agents. No claim is made that this is an exhaustive list of useful protocols, nor that they are necessary for any given application. The protocols are given pre-defined names: the requirement for adhering to the specification is:

    Requirement 8:
    An ACL compliant agent need not implement any of the standard protocols, nor is it restricted from using other protocol names. However, if one of the standard protocol names is used, the agent must behave consistently with the protocol specification given here.

    Note that, by their nature, agents can engage in multiple dialogues, perhaps with different agents, simultaneously. The term conversation is used to denote any particular instance of such a dialogue. Thus, the agent may be concurrently engaged in multiple conversations, with different agents, within different protocols. The remarks in this section which refer to the receipt of messages under the control of a given protocol refer only to a particular conversation.

    1. Specifying when a protocol is in operation

    Notionally, two agents intending to use a protocol should first negotiate whether to use a protocol, and, if so, which one. However, providing the mechanism to do this would negate a key purpose of protocols, which is to simplify the agent implementation. The following convention is therefore adopted: placing the name of the protocol that is being used in the :protocol parameter of a message is equivalent to (and slightly more efficient than) prepending with an inform that i intends that the protocol will be done (i.e., formally, Ii Done( protocol-name )). Once the protocol is finished, which may occur when one of the final states of the protocol is reached, or when the name of the protocol is dropped from the :protocol parameter of the message, this implicit intention has been satisfied.

    If the agent receiving a message in the context of a protocol which it cannot, or does not wish to, support, it should send back a refuse message explaining this.

    Example:

    (request :sender i
    :receiver j
    :content some-act
    :protocol fipa-request
    )

  3. Extending UML for the Specification of Interaction Protocols
    1. Introduction

During the seventies, structured programming was the dominating paradigm. Along with it, software engineering technologies were developed in order to ease and formalize the entire development process from first ideas in the beginning to product maintenance at the end. The eighties were the decade of object orientation (OO) with data encapsulation and inheritance of behavior. OO programming is just a part of the development process which includes techniques and tools for OO analysis and OO design. Nowadays the unified modeling language (UML, see [UML]) is the standard of today for the specification of object oriented projects. At the end of the eighties and the beginning of the nineties a lot of object oriented design and modeling techniques came up. The unified modeling language (UML) [Fowler, Scott 97; UML] unifies the methods of Booch, Rumbaugh (OMT)[XXX] and Jacobson [XXX] and is now submitted to the Object Management Group (OMG) for standardization.

UML supports

Compared to objects, agents are active by executing their actions for reasons that emerge from themselves. The activity of agents is based on their internal states which include goals and conditions implying the execution of defined tasks. While objects need control from outside to execute their methods, agents know the conditions and intended effects of their actions by themselves and hence take responsibility of their needs. Furthermore, agents do not only act solely but together with other agents. One reason is the need of more resources than owned by one agent or the availability of unused resources for other agents. Furthermore, agents may not have all capabilities needed to perform a certain complex task. Therefore, other agents providing these capabilities can be engaged in order to support each other. Multi agent systems are a kind of social community of which the members depend on each other though acting individually on behalf of their users.

For the modeling of agent oriented software no sufficient specification formalism exist. In order to apply agent oriented programming in projects resulting in products, a specification technique is necessary supporting the whole software engineering process, starting with use cases describing the requirements of the system, design specifications describing the conceptual and design view to the system and at the end implementational specifications resulting in the implementation of the software product.

Therefore, we suggest an extension of the standard UML [UML] for the specification of interactions protocols.

As next step within FIPA 2000 a specification technique should be derived supporting the whole agent-oriented software engineering process being an informative part of the FIPA specification.

Before defining interaction protocols and develop a specification technique for that purpose a common understanding on interaction protocols has to be established.

Definition (agent interaction protocol):

The definition of an agent interaction protocol (for short: AIP) describes

It has to be distinguished between

In the FIPA specifications generic AIPs are defined, which can be applied in different application contexts, i.e. FIPA supports a library of generic AIPs which can be instantiated in concrete multi-agent projects.

For the specification of IPs a technique is necessary satisfying the requirement of any other specification technique:

    1. Requirements

Having a look at the specification and development of multi agent systems some requirements for the specification of interaction protocols can be derived:

These specifications of interaction protocols can be used for different purposes, namely

Within this document we focus on the first two items, namely a modeling language for developers and verification.

Within the development process different views on the static and dynamic model are needed. The views supported by UML are namely concept, specification and implementation view. Within the FIPA specification we will take the specification view.

We will use UML as the specification technique of our choice and will

Remark: The semantics definition submitted to the OMG is a precise semantics of UML, but it is not a formal semantics. But a lot of work has been done [XXX] to give UML a formal, logic-oriented semantics in the sense of logic. This definitions can be applied for e.g. verification of properties over the specification.

For the definition of constraints we use at the moment pure Object Constraint Language (OCL) defined within UML, depending on the requirements also OCL will be extended. OCL has some pre-defined type, namely Boolean, Integer, Real, String, Set, Bag and Sequence and operations on them.

    1. Elements for the Specification of IPs
    2. In the following section we present as well the elements supported by UML as well as the new elements which are added to UML to define interaction protocols. such that the presentation is self-contained. We avoided a distinction between existing notations and the extensions to obtain a unified description of the specification formalism.

      For the description of interaction protocols we extend the existing diagram type of sequence diagrams and use notations from other diagrams as much as possible. The new notation is presented in the following way. Mostly some motivation for the introduction of the constructs is given. Second we show the notation and define afterwards the semantics of it. We give an informal, formal and meta-model oriented semantics of the constructs.

      1. Object-Constraint Language

IBM developed an object constraint language (OCL) which is used in UML specifications for the definition of constraints in various UML diagrams.

OCL is characterized by (- to be described in detail -):

anInstance.property

anOp ( p : ParType ) : RetType;
anOp ( p ) = … function of p ...

In our framework we extend OCL by the following constraints

      1. Roles

Agents can perform special roles within an interaction protocol. Using a contract-net protocol, e.g. between a buyer and the seller of a product, the initiator of the protocol has the role of a buyer and the participant has the role of seller.

A role can be seen as a set of agents satisfying a distinguished interface. Therefor the implementation of an agent can satisfy different roles. E.g. the agent management specification of FIPA defines the functionality for the directory facilitator (DF), the agent management system (AMS) and the agent communication channel (ACC). These functionalities can be implemented by different agents, but for example the DF, AMS and ACC functionality can also be integrated in one agent. In our buyer / seller example, the seller can be a retailer agent, which acts as a seller in one case and as a buyer in another case.

UML distinguished between

Therefore a role in agent oriented programming is analogous to an abstract class (without implementation). As in object oriented programming languages we have to distinguish between an agent role and an agent instance, supporting eventually different roles.

(- to be done-)

(- end to be done -)

We use the notations for a role Role for an agent instance Instance and for an agent instance Instance of distinguished roles Role-1, Role-2,... .

(- to be done: formal semantics, meta-model semantics -)

      1. Threads of Interaction
      2. In interaction protocol defines the steps in which the communicative acts are send between different agents. The sending can be done either in parallel or as a choice between different communicative acts. Receiving different messages can result in different answers to a special communicative act, i.e. the behavior of an agent depends often on the incoming messages. Therefor the thread of interaction, i.e. of processing incoming messages has to be split up into different threats of interaction. A lifeline (denoted as a doted vertical line) is associated with either a role or an agent instance with or without a distinguished role.

        It shows the duration of the conversation between two or more agents.

        Example

        for role Seller for agent instance Retailer-1

        for agent instance Retailer of distinguished roles Seller and buyer

         

         

        An associated thread of interaction is denoted as

        A thread of interaction can be split up as follows

        and

        describing a AND split of the threats of interaction, i.e. are performed in AND-parallelism style.

        OR-parallelism of the threads of interaction is defined as

        and

        XOR-parallelism of the threads of interaction is defined as

        and

         

        (- to be done: formal semantics, meta-model semantics -)

        An interruption of the vertical boxes describes a change of the threat of interaction, denoted as

      3. Defining Messages
      4. Communicative acts are defined by UML class diagrams. For the definition of communicative acts we only define attributes and no operations in the class diagram. To allow in the specification formalism beyond FIPA communicative acts e.g. KQML constructs or other communicative acts, we define an abstract class CA which is super-class of FIPA communicative acts (class FIPA-CA), KQML communicative acts (KQML-CAs),... . For each CA we define a sub-class with appropriate content. These class definitions are used in protocol schemes, where the contents area known these communicative acts are instances of theses classes. The class hierarchy looks like follows.

        whereby the FIPA communicative acts are defines as follows:

        (- to be completed wrt. the actual definition of the CAs -)

        Moreover we allow to define subclasses of the communicative acts classes restricting some attributes by constraints. Instance of these constrainted communicative acts have to satisfy these constraints (weaker and stronger preconditions)

        (- to be described in detail; weaker / stronger precondition; Believe, Desire, Intention, action refinements, refinement of conditions wrt. the class hierarchy -)

        Example:

         

      5. Sending Messages
      6. One main issue of interaction protocols is the definition of communicative pattern, especially messages have to be defined which are sent from one agent to another. This sending can be done in different ways, e.g. with different cardinalities, depending on some constraints or using AND-, OR or XOR-parallelism.

         

        ,

        The horizontal arrow describes that an agent instance or a role A-1 is sending the communicative act CA, being a subclass of the standard CAs, to an agent instance or a role A-2. The communicative act can written either above or under the arrow. If we deal with a concrete instance of a communicative act according to a special CA we denote it the second way and third way.

        Asynchronous and synchronous message exchange are described using different kinds of arrows. Synchronous messages, i.e. the agent is blocked until it receives some answer to this message, are denoted as . Asynchronous messages, i.e. the agent can process other tasks while waiting for a response to this message, are denoted as . In the following picture we use the arrow for synchronous message exchange, but these figures can also be read with the asynchronous arrow.

        Example:

        with

        A special case is when an agent instance or role sends a communicative act or instance of a communicative act to itself, called self-delegation, this is denoted as

      7. Sending of Messages – Detailed View

For the definition of communicative pattern also the definition of

has to be supported by the technique.

Note, sending messages to agents satisfying distinguished service descriptions can be handled by roles. Multiple receives, i.e. all responses to a request have to be received before other messages are triggered, can be modeled using constraints.

The arrows have the following semantics (the analogous holds for the asynchronous arrows)

  1. default message sending, with cardinality 1-1 and without any constraints, i.e.
  1. cardinality is n-m of the message sending, i.e. n agents satisfying a special role send a message CA to m agents satisfying another distinguished role. Meaningful cases are

This case is not appropriate for agent instances, because an agent instance would receive one message many times.

  1. the message CA is send iff the guard can be evaluated to true, guards are OCL-constraints.
  2. the message CA is send, if the constraints evaluates to true, constraints are OCL-constraints and
  1. explicit termination of a protocol after e.g. receiving a message.

The same holds for instances of communicative acts satisfying (distinguished roles).

Theses notations can be all be combined, unless they describe contradictory information.

Example

(- to be defined -)

      1. Defining Parallelism and Choices of Messages
      2. Usually in real world applications the communication between different agents can be performed in parallel. Moreover having e.g. a look at the FIPA-request-protocol, an agent can response to a "request" with "refuse", "not-understood" or "agree". Therefore we have to describe moreover AND-, OR- and XOR-parallelism.

        AND-parallelism of different messages is defined as

        , and

        OR-Parallelism is defined as

        , and

        XOR-Parallelism is defined as

        , and

        Note, these constructs can be combined unless contradictory information. Moreover the arrows can be within one parallelism used in both directions.

        Examples

         

        for short

        for short

         

        for short

         

      3. Defining Sub-Protocols
      4. Specifications should be constructed in a modular way. The definition of sub-protocols allows one way of structuring specifications. The reuse of specification parts increase the readability to a some extend.

        Named sub-protocols with some protocol inside are defined as follows:

         

        named sub-protocol or unnamed sub-protocols

         

        The semantics of sub-protocols is the semantics of the involved protocol with the difference that the name of the sub-protocol can be used as an abbreviation in other protocol definitions.

        Example

      5. Usage of Sub-Protocols
      6. The definition of sub-protocols allow the reuse of specification parts and increase the readability. Defined sub-protocols can be used at any place in a protocol definition.

        If a sub-protocol is defined as

        the usage of this sub-protocol can look as follows (guard and constraint are optional):

         

        The semantics of sub-protocols is the expansion of the sub-protocol notation by the definition of the sub-protocol, i.e. in this example.

        We have to identify the used roles and agent instances within the sub-protocol with the roles and agents of the actual protocol. Therefor the constraints have to be extended allowing new operations, like

        { identify(A-1, A’-1), identifiy(A-2, A’-2),... }

        identifies the roles and agent instances used in the sub-protocol with theses roles and agent instances of the complete protocol.

        Example

      7. Defining Repetition and Recursion for Sub-Protocols

Considering e.g. the FIPA iterated contract net, parts of the interaction protocol can be repeated arbitrarily until a special condition is satisfied. In other protocols a part can be repeated a fixed number of times.

The notation to express this behavior is

Informal Semantics

Constraint can either be

or a combination of these different constraints.

(- should we use an additional notation like for control flow ??-)

Example

      1. Defining Parallism and Choices on (Sub-)Protocols
      2. (Sub-)Protocols can as well be combined using some parallelism or choices, therefore we allow the notion of AND-, OR and XOR-parallelism as well to the definition of parallelism of (sub-)protocols. Instead of the communicative act the notation of (sub-)protocol, i.e. e.g. for the XOR case.

      3. Nested Protocols
      4. Specifying complete multi-agent systems, the execution of a protocol can be nested with some other protocol, e.g. a broker asks a DF to get the information about some sellers. This fact has to be definable in the framework and can be used for structuring issues.

         

        The first protocol between A-1 and A-2 is nested with another protocol between A-2 and A-3.

        Example

      5. Defining the Intention of CAs within Protocols
      6. (- to be completed -)

      7. Generic IPs

Usually domain independent interaction patterns, like the protocols suggested by FIPA auctions and contract net. Such parameterized interaction protocols can be characterized by their protocol name, some constraints applied in the parameterized protocol, the involved agent-roles and agent instances, the communicative acts and the instantiated communicative acts as well as the used sub-protocols.

The used notation is

 

An generic interaction protocol is defined named Generic-Protocol-Name. The parameter part

consists of four sections

Example

      1. Instantiation of Generic Interaction Protocols
      2. The instantiation of a generic interaction protocol is denoted with the actual arguments.

        The semantics of this construction is protocol within the generic protocol in which the parameters are substituted by the actual parameters. If a set of communicative act instances are allowed a XOR-splitting is performed as shown in the example below.

        Example

        with the expanded protocol looks like

      3. Dependencies of Protocols

(- to be written -)

 

  1. Examples – FIPA 97 IPs
  2. Since the notation is not stable, only a view examples are given for the old interaction protocols.

    1. FIPA-request-Protocol
    2.  

       

    3. FIPA-query-Protocol
    4. FIPA-request-when-Protocol
    5. FIPA-Contract-Net
    6. FIPA-iterated-contract-net protocol
    7. Has to be defined

    8. FIPA-auction-english-protocol

     

  3. Future Work
    1. Protocol Description Notation

The following notation was used in previous specifications to describe the standard interaction protocols in a convenient manner. It is left here for the time being for reference purposes:

 

Figure 2 — Example of graphical description of protocols

The above notation is meant solely to represent the protocol as it might be seen by an outside observer. In particular, only those actions should be depicted which are explicit objects of conversation. Actions which are internal to an agent in order to execute the protocol are not represented as this may unduly restrict an agent implementation (e.g. it is of no concern how an agent arrives at a proposal).

    1. Defined protocols
      1. Failure to understand a response during a protocol
      2. Whilst not, strictly speaking, a protocol, by convention an agent which is expecting a certain set of responses in a protocol, and which receives another message not in that set, should respond with a not-understood message.

        To guard against the possibility of infinite message loops, it is not permissible to respond to a not-understood message with another not-understood message!

      3. FIPA-request Protocol
      4. The FIPA-request protocol simply allows one agent to request another to perform some action, and the receiving agent to perform the action or reply, in some way, that it cannot.

        The UAML representation of this protocol would be as follows:

        Figure 3 — FIPA-Request Protocol

      5. FIPA-query Protocol
      6. In the FIPA-query protocol, the receiving agent is requested to perform some kind of inform action. Requesting to inform is a query, and there are two query-acts: query-if and query-ref. Either act may be used to initiate this protocol. If the protocol is initiated by a query-if act, it the responder will plan to return the answer to the query with a normal inform act. If initiated by query-ref, it will instead be an inform-ref that is planned. Note that, since inform-ref is a macro act, it will in fact be an inform act that is in fact carried out by the responder.

        The UAML representation of this protocol would be as follows:

         

        Figure 4 — FIPA-Query Protocol

      7. FIPA-request-when Protocol
      8. The FIPA-request-when protocol is simply an expression of the full intended meaning of the request-when action. The requesting agent uses the request-when action to seek from the requested agent that it performs some action in the future once a given precondition becomes true. If the requested agent understands the request and does not refuse, it will wait until the precondition occurs then perform the action, after which it will notify the requester that the action has been performed. Note that this protocol is somewhat redundant in the case that the action requested involves notifying the requesting agent anyway. If it subsequently becomes impossible for the requested agent to perform the action, it will send a refuse request to the original requestor.

        The UAML representation of this protocol would be as follows:

        Figure 5 — FIPA-request-when protocol

      9. FIPA-contract-net Protocol
      10. This section presents a version of the widely used Contract Net Protocol, originally developed by Smith and Davis [Smith & Davis 80]. FIPA-Contract-Net is a minor modification of the original contract net protocol in that it adds rejection and confirmation communicative acts. In the contract net protocol, one agent takes the role of manager. The manager wishes to have some task performed by one or more other agents, and further wishes to optimise a function that characterises the task. This characteristic is commonly expressed as the price, in some domain specific way, but could also be soonest time to completion, fair distribution of tasks, etc.

        The manager solicits proposals from other agents by issuing a call for proposals, which specifies the task and any conditions the manager is placing upon the execution of the task. Agents receiving the call for proposals are viewed as potential contractors, and are able to generate proposals to perform the task as propose acts. The contractor’s proposal includes the preconditions that the contractor is setting out for the task, which may be the price, time when the task will be done, etc. Alternatively, the contractor may refuse to propose. Once the manager receives back replies from all of the contractors, it evaluates the proposals and makes its choice of which agents will perform the task. One, several, or no agents may be chosen. The agents of the selected proposal(s) will be sent an acceptance message, the others will receive a notice of rejection. The proposals are assumed to be binding on the contractor, so that once the manager accepts the proposal the contractor acquires a commitment to perform the task. Once the contractor has completed the task, it sends a completion message to the manager.

        Note that the protocol requires the manager to know when it has received all replies. In the case that a contractor fails to reply with either a propose or a refuse, the manager may potentially be left waiting indefinitely. To guard against this, the cfp includes a deadline by which replies should be received by the manager. Proposals received after the deadline are automatically rejected, with the given reason that the proposal was late.

        The UAML representation of this protocol would be as follows (has to be defined as parametrized IP) :

        Figure 6 — FIPA-Contract-Net

      11. FIPA-Iterated-Contract-Net Protocol
      12. The iterated contract net protocol is an extension of the basic contract net as described above. It differs from the basic version of the contract net by allowing multi-round iterative bidding. As above, the manager issues the initial call for proposals with the cfp act. The contractors then answer with their bids as propose acts. The manager may then accept one or more of the bids, rejecting the others, or may iterate the process by issuing a revised cfp. The intent is that the manager seeks to get better bids from the contractors by modifying the call and requesting new (equivalently, revised) bids. The process terminates when the manager refuses all proposals and does not issue a new call, accepts one or more of the bids, or the contractors all refuse to bid.

        Figure 7 — FIPA-iterated-contract-net protocol

      13. FIPA-Auction-English Protocol
      14. In the English Auction, the auctioneer seeks to find the market price of a good by initially proposing a price below that of the supposed market value, and then gradually raising the price. Each time the price is announced, the auctioneer waits to see if any buyers will signal their willingness to pay the proposed price. As soon as one buyer indicates that it will accept the price, the auctioneer issues a new call for bids with an incremented price. The auction continues until no buyers are prepared to pay the proposed price, at which point the auction ends. If the last price that was accepted by a buyer exceeds the auctioneer's (privately known) reservation price, the good is sold to that buyer for the agreed price. If the last accepted price is less than the reservation price, the good is not sold.

        The UAML representation of this protocol would be as follows:

        In the following protocol diagram, the auctioneer's calls, expressed as the general cfp act, are multicast to all participants in the auction. For simplicity, only one instance of the message is portrayed. Note also that in a physical auction, the presence of the auction participants in one room effectively means that each acceptance of a bid is simultaneously broadcast to all participants, not just the auctioneer. This may not be true in an agent marketplace, in which case it is possible for more than one agent to attempt to bid for the suggested price. Even though the auction will continue for as long as there is at least one bidder, the agents will need to know whether their bid (represented by the propose act) has been accepted. Hence the appearance in the protocol of accept-proposal and reject-proposal messages, despite this being implicit in the English Auction process that is being modelled.

        Figure 8 — FIPA-auction-english protocol

      15. FIPA-Auction-Dutch Protocol
      16. In what is commonly called the Dutch Auction, the auctioneer attempts to find the market price for a good by starting bidding at a price much higher than the expected market value, then progressively reducing the price until one of the buyers accepts the price. The rate of reduction of the price is up to the auctioneer, and the auctioneer usually has a reserve price below which it will not go. If the auction reduces the price to the reserve price with no buyers, the auction terminates.

        The term "Dutch Auction" derives from the flower markets in Holland, where this is the dominant means of determining the market value of quantities of (typically) cut flowers. In modelling the actual Dutch flower auction (and indeed in some other markets), some additional complexities occur. First, the good may be split: for example the auctioneer may be selling five boxes of tulips at price x, and a buyer may step in and purchase only three of the boxes. The auction then continues, with a price at the next increment below x, until the rest of the good is sold or the reserve price met. Such partial sales of goods are only present in some markets; in others the purchaser must bid to buy the entire good. Secondly, the flower market mechanism is set up to ensure that there is no contention amongst buyers, by preventing any other bids once a single bid has been made for a good. Offers and bids are binding, so there is no protocol for accepting or rejecting a bid. In the agent case, it is not possible to assume, and too restrictive to require, that such conditions apply. Thus it is quite possible that two or more bids are received by the auctioneer for the same good. The protocol below thus allows for a bid to be rejected. This is intended only to be used in the case of multiple, competing, simultaneous bids. It is outside the scope of this specification to pre-specify any particular mechanism for resolving this conflict. In the general case, the agents should make no assumptions beyond "first come, first served". In any given domain, other rules may apply.

        Figure 9 — FIPA-auction-dutch protocol

      17. Brokering protocol
      18. Recruiting protocol