Check out the new USENIX Web site. next up previous
Next: Events Up: Communication Previous: Channel and Gate

Dynamic Grouping

  A role name say R can be used as a channel without being explicitly declared in the collaboration bus to deliver messages to all the participants currently in the role. However, since only participants enacting role R can receive those messages, we require that only R can define on-arrival rules at the gate it represents.

Predicate channel/2 can be used to declare channels dynamically. The following names a channel C which connects a group of participants denoted by Agent1, Agent2, ..., Agentn:
\begin{smalltab}
{\bf channel}($C$, [$Agent_{1}$, $Agent_{2}$, ..., $Agent_{n}$]).
 \end{smalltab}

Agenti can be a defined static channel name, a role name, some self, or even another defined dynamic channel name. A channel (static or dynamic, excluding that denoted by a role name) can be later redefined. The same channel predicate, if the second argument is a variable, can be used to get the list of agents connected by a given channel.

An offer predicate can send messages through a variable channel like the following.
\begin{smalltab}
$C$\space !($T_{1}, T_{2}, ..., T_{n}$)
 \end{smalltab}
However, the variable C must have been bound to an agent (some self), an agent group, a role name, or a declared channel name.

There are two ways to receive messages sent via a dynamical channel. One is to define active rules at the gate denoted self. Another way is to define an active rule in which the gate name is a variable. When a message arrives not unifying with any active rules with constant gate names, the variable gates rules will be tried.


next up previous
Next: Events Up: Communication Previous: Channel and Gate
Du Li
8/25/1999