Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revisionBoth sides next revision | ||
| alvis:in [2013/12/15 00:09] marcin | — (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== In statement ====== | ||
| - | An agent can communicate with its outside world using **ports**. Each port can be used both as an input or an output one. The current role of a port is determined by two factors: | ||
| - | - Connections to the port in the corresponding communication diagram -- e.g. if a port '' | ||
| - | - Statements used in the code layer -- e.g. if a port '' | ||
| - | |||
| - | Any communication through a port can be a **pure communication** or a **value passing combination**. | ||
| - | |||
| - | In case of a **pure communication**, | ||
| - | |||
| - | In case of a **value passing communication**, | ||
| - | |||
| - | |||
| - | The **in** statement is a single-step statement. | ||
| - | |||
| - | < | ||
| - | in p; | ||
| - | in p x; | ||
| - | </ | ||
| - | |||
| - | **Listing 1. ** In statement syntax: '' | ||
| - | |||
| - | ===== Example 1 ===== | ||
| - | |||
| - | {{: | ||
| - | |||
| - | **Figure 1. ** Example 1 communication diagram | ||
| - | |||
| - | < | ||
| - | agent A { | ||
| - | out a; | ||
| - | } | ||
| - | |||
| - | agent B { | ||
| - | in b; | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | **Listing 1. ** Example 1 code layer | ||
| - | |||
| - | The only task of the '' | ||
| - | |||
| - | A communication between two active agents can be initialised by any of them. The agent that initialises it, performs the **out** statement to provide some information and waits for the second agent to take it, or performs the **in** statement to express its readiness to collect some information and waits until the second agent provides it. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | **[[: | ||