David Lillis: Example 1: A Simple Request/Response Protocol

Below is an Agent UML representation of a simple Request/Response protocol. This is designed to allow one agent (the initiator) to ask for information from another (the respondent) on a one-off basis. The initial message is required to use the request performative, with the response using inform .


This protocol would be represented in ACRE by the diagram below. This protocol consists of three states: Start at the beginning of the conversation when no messages have yet been sent, Requested after the initial request message has been sent by the Initiator agent, and End after the Respondent has replied with the required information. The Start state is highlighted in red as this is the initial state of any conversation that is to follow the Request/Response protocol.

A conversation moves between states by using transitions: these describe details about the message that should be sent to advance the conversation. In this protocol, each of the transitions are labelled with these message details. Note that the performative is set: request for the first message and inform for the response.

The participants in the protocol, however, are indicated by variables that are matched against the names of the agents. In this example, both the ?initiator and ?respondent variables are used to refer to the names of the agents participating in the conversation. This means that the agent that sends the initial message (at which point its name is bound to the ?initiator variable) must be the recipient of the response that follows.


Given this protocol, suppose a request message is sent by an agent named agent1 to an agent named agent2. This message matches the first transition and the conversation moves to the Requested state, as shown below. Note that the transition from Requested to End is now shown differently. Because agent1 sent the first message, further uses of the ?initiator variable must also refer to agent1. This ensures that agents maintain the same role throughout the conversation.

The text in the middle of the 'Requested state shows the current variable bindings associated with the conversation: each of the variables that has been matched against some previous value is bound to that value.


Next, suppose agent2 replies with an inform message. This matches the next transition as the message has the same performative and is sent by agent2 to agent1, as required by the transition.


In this protocol, the End state is a terminal state (i.e. once the conversation reaches that state there are no more transitions that could be triggered by further messages). The conversation has now come to an end.