ptolemy.domains.wireless.kernel
Interface PropertyTransformer
- All Known Subinterfaces:
- WirelessChannel
- All Known Implementing Classes:
- AtomicWirelessChannel, DelayChannel, ErasureChannel, LimitedRangeChannel, PowerLossChannel, TerrainProperty, TransmitPropertyTransformer
public interface PropertyTransformer
Interface for transmit property transformers. Property transformers
are components that register with the channel a callback that they can
use to modify the transmission properties of a transmission. They can
register to modify the transmission properties of transmissions from a
specific port, or they can register to modify all transmissions
through the channel. Note that 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).
It is possible to return the modified transmission properties with
different record types from the previous transmit property, i.e. some
record fields may be removed or added. The channel should merge the
returned transmission properties with its defaultProperties to
make sure that the transmission properties contains at least all the
fields of the defaultProperties.
Anything that needs to know the locations of the sender and receiver
to alter the transmit properties should implement this interface.
For example, for a sender with a specific antenna pattern to send data
to receivers, it needs to know each receiver's position and its own
position to calculator the antenna gain. To do so, the sender can
implement this interface and register itself with the wireless channel
it uses. The channel will call the transformProperties method
later and provide the required information for the sender to calculate,
for example, the antenna gain to a specific receiver.
- Since:
- Ptolemy II 4.0
- Version:
- $Id: PropertyTransformer.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Yang Zhao and Edward Lee
- See Also:
WirelessChannel
- Accepted Rating:
- Proposed Rating:
transformProperties
RecordToken transformProperties(RecordToken properties,
WirelessIOPort source,
WirelessIOPort destination)
throws IllegalActionException
- Modify the transmission properties and return a new token with the
modifications. Implementers may also return the specified token
unchanged.
- Parameters:
properties
- The transmission properties to modify.source
- The sending port.destination
- The receiving port.
- Returns:
- The (possibly) modified transmission properties.
- Throws:
IllegalActionException
- If the properties cannot be
transformed for some reason.