|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.wireless.kernel.AtomicWirelessChannel
The base class for communication channels in the wireless domain.
To use this class, place it in a wireless model that contains a wireless director and wireless actors (actors whose ports are instances of WirelessIOPort). Then set the outsideChannel parameter of those ports to match the name of this channel. The model can also itself contain ports that are instances of WirelessIOPort, in which case their insideChannel parameter should contain the name of this channel if they should use this channel.
In this base class, transmission on a channel reaches all ports at the same level of the hierarchy that are instances of WirelessIOPort and that specify that they use this channel. These ports include those contained by entities that have the container as this channel and that have their outsideChannel parameter set to the name of this channel. They also include those ports whose containers are the same as the container of this channel and whose insideChannel parameter matches this channel name.
Derived classes will typically limit the range of the transmission, using for example location information from the ports. They may also introduce random losses or corruption of data. To do this, derived classes can override the _isInRange() protected method, or the transmit() public method.
| Yellow (cxh) |
| Green (cxh) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
Entity.ContainedObjectsIterator |
| Field Summary | |
protected boolean |
_receiversInRangeCacheValid
Flag indicating that the cached list of receivers in range is valid. |
Parameter |
defaultProperties
The default properties for transmission. |
| Fields inherited from class ptolemy.actor.AtomicActor |
_stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
AtomicWirelessChannel(CompositeEntity container,
java.lang.String name)
Construct a relation with the given name contained by the specified entity. |
|
| Method Summary | |
protected double |
_distanceBetween(WirelessIOPort port1,
WirelessIOPort port2)
Return the distance between two ports. |
protected boolean |
_isInRange(WirelessIOPort source,
WirelessIOPort destination,
RecordToken properties)
Return true if the specified destination port is in range of the specified source port, assuming the source port transmits with the specified properties. |
protected double[] |
_locationOf(IOPort port)
Return the location of the given port. |
protected java.util.List |
_receiversInRange(WirelessIOPort sourcePort,
RecordToken properties)
Return the list of receivers that can receive from the specified port with the specified transmission properties. |
protected void |
_transmitTo(Token token,
WirelessIOPort sender,
WirelessReceiver receiver,
RecordToken properties)
Transmit the specified token to the specified receiver. |
void |
attributeChanged(Attribute attribute)
If the attribute is defaultProperties, make sure its value is a record token. |
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 |
pruneDependencies()
Override the base class to declare that the dummy port returned by getChannelPort() does not depend on itself in a firing. |
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. |
RecordToken |
transformProperties(RecordToken properties,
WirelessIOPort source,
WirelessIOPort destination)
Transform the transmission property to take into account channel losses, noise, etc., for transmission between the specified source and the specified destination. |
void |
transmit(Token token,
WirelessIOPort port,
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). |
void |
valueChanged(Settable settable)
React to changes of the specified Settable. |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, fire, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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.kernel.util.Derivable |
getDerivedLevel, getDerivedList, propagateValue |
| Field Detail |
public Parameter defaultProperties
protected boolean _receiversInRangeCacheValid
| Constructor Detail |
public AtomicWirelessChannel(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - The name of the relation.
IllegalActionException - If the container is incompatible
with this relation.
NameDuplicationException - If the name coincides with
a relation already in the container.| Method Detail |
public void attributeChanged(Attribute attribute)
throws IllegalActionException
attributeChanged in class NamedObjattribute - The attribute that changed.
IllegalActionException - If the change is not acceptable
to this container.public ChannelPort getChannelPort()
getChannelPort in interface WirelessChannel
public java.util.List listeningInputPorts()
throws IllegalActionException
listeningInputPorts in interface WirelessChannelIllegalActionException - If a port is encountered
whose outsideChannel parameter cannot be evaluated.
public java.util.List listeningOutputPorts()
throws IllegalActionException
listeningOutputPorts in interface WirelessChannelIllegalActionException - If a port is encountered
whose insideChannel parameter cannot be evaluated.
public void registerPropertyTransformer(PropertyTransformer transformer,
WirelessIOPort port)
registerPropertyTransformer in interface WirelessChanneltransformer - 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.public void pruneDependencies()
pruneDependencies in class AtomicActorTimedDelay,
AtomicActor.removeDependency(IOPort, IOPort),
FunctionDependencyOfAtomicActor
public java.util.List sendingInputPorts()
throws IllegalActionException
sendingInputPorts in interface WirelessChannelIllegalActionException - If a port is encountered
whose insideChannel parameter cannot be evaluated.
public java.util.List sendingOutputPorts()
throws IllegalActionException
sendingOutputPorts in interface WirelessChannelIllegalActionException - If a port is encountered
whose outsideChannel parameter cannot be evaluated.
public RecordToken transformProperties(RecordToken properties,
WirelessIOPort source,
WirelessIOPort destination)
throws IllegalActionException
transformProperties in interface PropertyTransformerproperties - The transmission properties.source - The sending port.destination - The receiving port.
IllegalActionException - If the properties cannot
be transformed. Not thrown in this base class.registerPropertyTransformer(PropertyTransformer, WirelessIOPort)
public void transmit(Token token,
WirelessIOPort port,
RecordToken properties)
throws IllegalActionException
transmit in interface WirelessChanneltoken - 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 (ignored in this base class).
IllegalActionException - If a type conflict occurs, or the
director is not a WirelessDirector.
public void unregisterPropertyTransformer(PropertyTransformer transformer,
WirelessIOPort port)
unregisterPropertyTransformer in interface WirelessChanneltransformer - The property transformer to be unregistered.port - The port whose transmissions should be subject to the
property transformer, or null for a generic transformer.registerPropertyTransformer(PropertyTransformer, WirelessIOPort)public void valueChanged(Settable settable)
valueChanged in interface ValueListenersettable - The object that has changed value.
protected double _distanceBetween(WirelessIOPort port1,
WirelessIOPort port2)
throws IllegalActionException
port1 - The first port.port2 - The second port.
IllegalActionException - If the distance
cannot be determined.
protected boolean _isInRange(WirelessIOPort source,
WirelessIOPort destination,
RecordToken properties)
throws IllegalActionException
source - The source port.destination - The destination port.properties - The transmission properties (ignored in this base class).
IllegalActionException - If it cannot be determined
whether the destination is in range (not thrown in this base
class).
protected double[] _locationOf(IOPort port)
throws IllegalActionException
port - A port with a location.
IllegalActionException - If a valid location attribute cannot
be found.
protected java.util.List _receiversInRange(WirelessIOPort sourcePort,
RecordToken properties)
throws IllegalActionException
sourcePort - The sending port.properties - The transmission properties (ignored in this base class).
IllegalActionException - If a location of a port cannot be
evaluated.
protected void _transmitTo(Token token,
WirelessIOPort sender,
WirelessReceiver receiver,
RecordToken properties)
throws IllegalActionException
token - The token to transmit, or null to clear
the specified receiver.sender - The sending port.receiver - The receiver to which to transmit.properties - The transmission properties (ignored in this base class).
IllegalActionException - If the token cannot be converted
or if the token argument is null and the destination receiver
does not support clear.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||