CSP for Java
(JCSP) 1.0-rc4

jcsp.plugNplay
Class DynamicDelta

java.lang.Object
  |
  +--jcsp.plugNplay.DynamicDelta
All Implemented Interfaces:
CSProcess

public final class DynamicDelta
extends Object
implements CSProcess

This process broadcasts objects arriving on its input channel in parallel to its output channel array -- those output channels can be changed dynamically.

Process Diagram

               ________________
              |                |    out[0]
      in      |                |------>------
 ------>------|                |    .
              |  DynamicDelta  |    .
   configure  |                |    .
 ------>------|                |------>------
              |________________|   out[n-1]
 

Description

A DynamicDelta process is a broadcasting node whose array of broadcasting channels can be changed dynamically. Any process can become one of the recipients of the broadcast by sending the DynamicDelta a channel on which it will be listening. A process may leave the broadcast be re-sending that same channel.

In each cycle, DynamicDelta waits for either its in or configure channel to become ready, giving priority to configure.

Anything arriving from in is broadcast in parallel down each element of its array of out channels.

The configure channel delivers ChannelOutput channels -- anything else is discarded. If the delivered ChannelOutput channel is not one of the channels already in the output array, it is added -- otherwise it is removed.

Channel Protocols

Input Channels
in java.lang.Object The in Channel can accept data of any Class.
in jcsp.lang.ChannelOutput The configure Channel accepts Objects of type ChannelOutput only.
Output Channels
out[] java.lang.Object The output Channels will carry a broadcast of whatever is sent down the in Channel.

Author:
P.D.Austin

Constructor Summary
DynamicDelta(AltingChannelInput in, AltingChannelInput config)
          Construct a new DynamicDelta process with the input channel in and the configuration channel configure.
DynamicDelta(AltingChannelInput in, AltingChannelInput config, ChannelOutput[] out)
          Construct a new DynamicDelta process with the input channel in, the configuration channel configure and the initial output channels out.
 
Method Summary
 void run()
          The main body of this process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicDelta

public DynamicDelta(AltingChannelInput in,
                    AltingChannelInput config)
Construct a new DynamicDelta process with the input channel in and the configuration channel configure.
Parameters:
in - the input Channel
configure - the configuration Channel

DynamicDelta

public DynamicDelta(AltingChannelInput in,
                    AltingChannelInput config,
                    ChannelOutput[] out)
Construct a new DynamicDelta process with the input channel in, the configuration channel configure and the initial output channels out. The ordering of the channels in the out array make no difference to the functionality of this process.
Parameters:
in - the input channel
configure - the configuration channel
out - the output channels
Method Detail

run

public void run()
The main body of this process.
Specified by:
run in interface CSProcess

CSP for Java
(JCSP) 1.0-rc4

Submit a bug or feature to jcsp-team@ukc.ac.uk
Version 1.0-rc4 of the JCSP API Specification (Copyright 1997-2000 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.