Class BluetoothChannel
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity<T>
-
- ptolemy.actor.AtomicActor<TypedIOPort>
-
- ptolemy.actor.TypedAtomicActor
-
- ptolemy.domains.wireless.kernel.AtomicWirelessChannel
-
- ptolemy.domains.wireless.lib.ErasureChannel
-
- ptolemy.domains.wireless.lib.DelayChannel
-
- ptolemy.domains.wireless.lib.LimitedRangeChannel
-
- ptolemy.domains.wireless.demo.PersonalAreaNetwork.BluetoothChannel
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,ChannelListener
,PropertyTransformer
,WirelessChannel
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,ValueListener
public class BluetoothChannel extends LimitedRangeChannel
Models a bluetooth communication between nodes. All powersave and tranmit characteristics of the Bluetooth protocol will be modelled in this channel.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- TODO: Philip Baldwin
- Pt.AcceptedRating:
- Red (pjb2e)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
increaseRange
True if the range should be increased.-
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.TypedAtomicActor
_typesValid
-
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _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
Constructors Constructor Description BluetoothChannel(CompositeEntity container, java.lang.String name)
Construct an actor with the given container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_isInRange(WirelessIOPort source, WirelessIOPort destination, RecordToken properties)
Return true if the specified port is in range of the specified source port, assuming the source port transmits with the specified properties.boolean
isInBluetoothRange()
void
valueChanged(Settable settable)
React to the fact that the specified Settable has changed.-
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, declareDelayDependency, getChannelPort, listeningInputPorts, listeningOutputPorts, registerPropertyTransformer, removeChannelListener, sendingInputPorts, sendingOutputPorts, transformProperties, transmit, unregisterPropertyTransformer
-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, 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
_addPort, _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, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, 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, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, 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.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
BluetoothChannel
public BluetoothChannel(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an actor with the given container and name.- Parameters:
container
- The container.name
- The name of this actor.- Throws:
IllegalActionException
- If the actor cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
-
Method Detail
-
valueChanged
public void valueChanged(Settable settable)
React to the fact that the specified Settable has changed. This class registers as a listener to attributes that specify transmit properties. If those change, then it is necessary to invalidate the cache of receivers in range. This method simply invalidates the cache if it is called, so subclasses should be careful to not register as value listeners unnecessarily to objects that do not affect the validity of this cache.- Specified by:
valueChanged
in interfaceValueListener
- Overrides:
valueChanged
in classLimitedRangeChannel
- Parameters:
settable
- The object that has changed value.
-
isInBluetoothRange
public boolean isInBluetoothRange()
-
_isInRange
protected boolean _isInRange(WirelessIOPort source, WirelessIOPort destination, RecordToken properties) throws IllegalActionException
Return true if the specified port is in range of the specified source port, assuming the source port transmits with the specified properties. If the properties are an instance of DoubleToken, then that token is assumed to be the range of the transmission. This method returns true if the distance between the source and the destination is less than or equal to the value of the properties. If the properties argument is not a DoubleToken, then it simply returns true.- Overrides:
_isInRange
in classLimitedRangeChannel
- Parameters:
source
- The source port.destination
- The destination port.properties
- The range of transmission.- Returns:
- True if the destination is in range of the source.
- Throws:
IllegalActionException
- If it cannot be determined whether the destination is in range (not thrown in this base class).
-
-