ptolemy.domains.wireless.lib
Class PowerLossChannel

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.actor.AtomicActor
                      extended by ptolemy.actor.TypedAtomicActor
                          extended by ptolemy.domains.wireless.kernel.AtomicWirelessChannel
                              extended by ptolemy.domains.wireless.lib.ErasureChannel
                                  extended by ptolemy.domains.wireless.lib.DelayChannel
                                      extended by ptolemy.domains.wireless.lib.LimitedRangeChannel
                                          extended by ptolemy.domains.wireless.lib.PowerLossChannel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, ChannelListener, PropertyTransformer, WirelessChannel, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, ValueListener

public class PowerLossChannel
extends LimitedRangeChannel

This is a model of a wireless channel with a specified power propagation formula. The power propagation is given as an expression that is evaluated and then multiplied by the power field of the transmit properties before delivery to the receiver. For convenience, a variable named "distance" is available and equal to the distance between the transmitter and the receiver when the power propagation formula is evaluated. Thus, the expression can depend on this distance. The value of the power field should be interpreted as power at the transmitter but power density at the receiver. A receiver may multiply the power density with its efficiency and an area(typically the antenna area). A receiver can then use the resulting power to compare against a detectable threshold, or to determine signal-to-interference ratio, for example.

The default value of powerPropagationFactor is

 1.0 / (4 * PI * distance * distance).
 
This assumes that the transmit power is uniformly distributed on a sphere of radius distance. The result of multiplying this by a transmit power is a power density (power per unit area). The receiver should multiply this power density by the area of the sensor it uses to capture the energy (such as antenna area) and also an efficiency factor which represents how effectively it capture the energy.

The power field of the transmit properties can be supplied by the transmitter as a record with a power field of type double. The default value provided by this channel is Infinity, which when multiplied by any positive constant will yield Infinity, which presumably will be above any threshold. Thus, the default behavior is to encounter no power loss and no limits to communication due to power.

In addition, this channel can have a specified limited transmission range. If a transmission range less than Infinity (the default) is specified, then receivers outside the specified range will not be notified of transmission, irrespective of power loss. The transmission range can be specified in one of two ways. Either it is the value of the range field in the defaultProperties parameter (a record) of this channel, or it is provided by the transmitter on each call to transmit() as a property argument. To use the latter mechanism, it is necessary that the property token be an instance of RecordToken with a field named "range" that can be converted to a double (i.e., it can be a double, an int, or a byte). The default value for range is Infinity, which indicates that by default, there is no range limit.

Any receiver that is within the specified range when transmit() is called will receive the transmission, unless the lossProbability parameter is set to greater than zero.

Since:
Ptolemy II 4.0
Version:
$Id: PowerLossChannel.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Yellow (cxh)
Proposed Rating:
Green (cxh)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 Parameter powerPropagationFactor
          The default formula for the power loss factor.
 
Fields inherited from class ptolemy.domains.wireless.lib.DelayChannel
propagationSpeed
 
Fields inherited from class ptolemy.domains.wireless.lib.ErasureChannel
_random, distance, lossProbability, seed
 
Fields inherited from class ptolemy.domains.wireless.kernel.AtomicWirelessChannel
_receiversInRangeCacheValid, defaultProperties, name
 
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
PowerLossChannel(CompositeEntity container, java.lang.String name)
          Construct a channel with the given name and container.
 
Method Summary
 RecordToken transformProperties(RecordToken properties, WirelessIOPort source, WirelessIOPort destination)
          Transform the properties to take into account channel losses, noise, etc., for transmission between the specified sender and the specified receiver.
 
Methods inherited from class ptolemy.domains.wireless.lib.LimitedRangeChannel
_isInRange, valueChanged
 
Methods inherited from class ptolemy.domains.wireless.lib.DelayChannel
_transmitTo, attributeChanged, clone, fire
 
Methods inherited from class ptolemy.domains.wireless.lib.ErasureChannel
initialize
 
Methods inherited from class ptolemy.domains.wireless.kernel.AtomicWirelessChannel
_distanceBetween, _locationOf, _receiversInRange, addChannelListener, channelNotify, getChannelPort, listeningInputPorts, listeningOutputPorts, preinitialize, registerPropertyTransformer, removeChannelListener, sendingInputPorts, sendingOutputPorts, transmit, unregisterPropertyTransformer
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, removeInitializable, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Field Detail

powerPropagationFactor

public Parameter powerPropagationFactor
The default formula for the power loss factor. This value, when multiplied by the transmit power, yields the power density (per unit area) at a receiver. It can be an expression that depends on a variable "distance," which has the value of the distance between a transmitter and receiver when this parameter is evaluated. This is a double that defaults to "1.0 / (distance * distance))".

Constructor Detail

PowerLossChannel

public PowerLossChannel(CompositeEntity container,
                        java.lang.String name)
                 throws IllegalActionException,
                        NameDuplicationException
Construct a channel with the given name and container. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string.

Parameters:
container - The container.
name - The name of the channel.
Throws:
IllegalActionException - If the container is incompatible.
NameDuplicationException - If the name coincides with an actor already in the container.
Method Detail

transformProperties

public RecordToken transformProperties(RecordToken properties,
                                       WirelessIOPort source,
                                       WirelessIOPort destination)
                                throws IllegalActionException
Transform the properties to take into account channel losses, noise, etc., for transmission between the specified sender and the specified receiver. In this base class, the specified properties are merged with the defaultProperties so that the resulting properties contain at least all the fields of the defaultProperties.

Specified by:
transformProperties in interface PropertyTransformer
Overrides:
transformProperties in class AtomicWirelessChannel
Parameters:
properties - The transmit properties.
source - The sending port.
destination - The receiving port.
Returns:
The transformed properties.
Throws:
IllegalActionException - If the properties cannot be transformed. Not thrown in this base class.
See Also:
AtomicWirelessChannel.registerPropertyTransformer(PropertyTransformer, WirelessIOPort)