ptolemy.domains.wireless.kernel
Interface WirelessChannel

All Superinterfaces:
ptolemy.actor.Actor, ptolemy.actor.Executable, ptolemy.kernel.util.Nameable, PropertyTransformer
All Known Implementing Classes:
AtomicWirelessChannel

public interface WirelessChannel
extends ptolemy.actor.Actor, ptolemy.kernel.util.Nameable, PropertyTransformer

Interface for wireless channels in the wireless domain. Wireless channels are special components in a wireless model. They are used to determine the connectivity and deliver tokens from the transmitter to receiver(s). This interface defines a set of methods for the wireless channel components.

The transmitter can call the channel's transmit() method to deliver data to its corresponding receivers. It can specify the transmission properties by a record token including the transmission range, transmission power. The transmit properties may be modified by the channel model or by some property transformers(@see PropertyTransformer) during the transmission to take into account channel losses, antenna gain, noise, etc.

Since:
Ptolemy II 4.0
Version:
$Id: WirelessChannel.java,v 1.40 2004/04/13 03:37:35 cxh Exp $
Author:
Yang Zhao and Edward A. Lee
Accepted Rating:
Yellow (cxh)
Proposed Rating:
Green (cxh)

Field Summary
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Method Summary
 ChannelPort getChannelPort()
          Return a channel port that can be used to set type constraints between senders and receivers.
 java.util.List listeningInputPorts()
          Return a list of input ports that can potentially receive data from this channel.
 java.util.List listeningOutputPorts()
          Return a list of output ports that can potentially receive data from this channel.
 void registerPropertyTransformer(PropertyTransformer transformer, WirelessIOPort port)
          Register a property transformer for transmissions from the specified port.
 java.util.List sendingInputPorts()
          Return a list of input ports that can potentially send data to this channel.
 java.util.List sendingOutputPorts()
          Return a list of output ports that can potentially send data to this channel.
 void transmit(ptolemy.data.Token token, WirelessIOPort port, ptolemy.data.RecordToken properties)
          Transmit the specified token from the specified port with the specified properties.
 void unregisterPropertyTransformer(PropertyTransformer transformer, WirelessIOPort port)
          Unregister a property transformer for transmissions from the specified port (or from null for a generic property transformer).
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, initialize, iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
 
Methods inherited from interface ptolemy.domains.wireless.kernel.PropertyTransformer
transformProperties
 

Method Detail

getChannelPort

public ChannelPort getChannelPort()
Return a channel port that can be used to set type constraints between senders and receivers. An channel contains a single port, which is an instance of ChannelPort. The port is merely used to set up n type constrains instead of n*n, where n is the number of ports using the channel.

Returns:
The channel port.

listeningInputPorts

public java.util.List listeningInputPorts()
                                   throws ptolemy.kernel.util.IllegalActionException
Return a list of input ports that can potentially receive data from this channel. This must include input ports contained by entities contained by the container of this channel that have their outsideChannel parameter set to the name of this channel. Transparent hierarchy is not supported.

Returns:
The list of input ports of class WirelessIOPort using this channel.
Throws:
ptolemy.kernel.util.IllegalActionException - If a port is encountered whose outsideChannel parameter cannot be evaluated.

listeningOutputPorts

public java.util.List listeningOutputPorts()
                                    throws ptolemy.kernel.util.IllegalActionException
Return a list of output ports that can potentially receive data from this channel. This must include output ports contained by the container of this channel that have their insideChannel parameter set to the name of this channel. This method gets read access on the workspace.

Returns:
The list of output ports of class WirelessIOPort using this channel.
Throws:
ptolemy.kernel.util.IllegalActionException - If a port is encountered whose insideChannel parameter cannot be evaluated.

registerPropertyTransformer

public void registerPropertyTransformer(PropertyTransformer transformer,
                                        WirelessIOPort port)
Register a property transformer for transmissions from the specified port. A PropertyTransformer modifies the transmission property and returns the modified property. If null is given for the port, then the property transformer will be used for all transmissions through this channel. If multiple property transformers are registered that can operate on a given transmission, then the order in which they are applied is arbitrary. Thus, property transformers should implement commutative operations on the properties (such as multiplying a field by a value). If the property transformer is already registered with a particular port, then an implementer of this method must not register it again with that port. Similarly, if a property transformer is registered with no port, then an implementer of this method must not register it again with no port.

Parameters:
transformer - The property transformer to be registered.
port - The port whose transmissions should be subject to the property transformer, or null to make them subject to all transmissions through this channel.

sendingInputPorts

public java.util.List sendingInputPorts()
                                 throws ptolemy.kernel.util.IllegalActionException
Return a list of input ports that can potentially send data to this channel. This must include input ports contained by the container of this channel that have their insideChannel parameter set to the name of this channel. This method gets read access on the workspace.

Returns:
The list of input ports of class WirelessIOPort using this channel.
Throws:
ptolemy.kernel.util.IllegalActionException - If a port is encountered whose insideChannel parameter cannot be evaluated.

sendingOutputPorts

public java.util.List sendingOutputPorts()
                                  throws ptolemy.kernel.util.IllegalActionException
Return a list of output ports that can potentially send data to this channel. This must include output ports contained by entities contained by the container of this channel that have their outsideChannel parameter set to the name of this channel. This method gets read access on the workspace.

Returns:
The list of output ports of class WirelessIOPort using this channel.
Throws:
ptolemy.kernel.util.IllegalActionException - If a port is encountered whose outsideChannel parameter cannot be evaluated.

transmit

public void transmit(ptolemy.data.Token token,
                     WirelessIOPort port,
                     ptolemy.data.RecordToken properties)
              throws ptolemy.kernel.util.IllegalActionException
Transmit the specified token from the specified port with the specified properties. All ports that are in range must receive the token if they have room in their receiver.

Parameters:
token - The token to transmit, or null to clear all receivers that are in range.
port - The port from which this is being transmitted.
properties - The transmission properties.
Throws:
ptolemy.kernel.util.IllegalActionException - If something goes wrong during the transmission.

unregisterPropertyTransformer

public void unregisterPropertyTransformer(PropertyTransformer transformer,
                                          WirelessIOPort port)
Unregister a property transformer for transmissions from the specified port (or from null for a generic property transformer). If the transformer has not been registered, then do nothing.

Parameters:
transformer - The property transformer to be unregistered.
port - The port whose transmissions should be subject to the property transformer, or null for a generic transformer.
See Also:
registerPropertyTransformer(PropertyTransformer, WirelessIOPort)