Class Backoff
- 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.lib.network.NetworkActorBase
-
- ptolemy.domains.wireless.lib.network.mac.MACActorBase
-
- ptolemy.domains.wireless.lib.network.mac.Backoff
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class Backoff extends MACActorBase
This actor does the back off after a frame transmission. It randomly choose a slot from the back off window and wait for that amount of time before trying to access the medium.- Since:
- Ptolemy II 4.0
- Version:
- Backoff.java,v 1.14 2004/04/22 19:46:18 ellen_zh Exp
- Author:
- Yang Zhao
- Pt.AcceptedRating:
- Red (pjb2e)
- Pt.ProposedRating:
- Red (ellen_zh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.domains.wireless.lib.network.NetworkActorBase
NetworkActorBase.Timer
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Random
_random
TypedIOPort
BKDone
The output port that produces messages that indicate the backoff is done.TypedIOPort
fromDataPump
The input port for channel status message.TypedIOPort
getBackoff
The input port for backoff message from the Protocol control block.Parameter
seed
The seed that controls the random number generation.-
Fields inherited from class ptolemy.domains.wireless.lib.network.mac.MACActorBase
_aCWmax, _aCWmin, _aPlcpHeaderLength, _aPreambleLength, _aRxPlcpDelay, _aRxRfDelay, _aRxTxTurnaroundTime, _aSifsTime, _aSlotTime, _dot11LongRetryLimit, _dot11ShortRetryLimit, _dotllRTSThreshold, _mBkIP, _mBrate, _sAckCtsLng, _tNavEnd, aCWmax, aCWmin, aPlcpHeaderLength, aPreambleLength, aRxPlcpDelay, aRxRfDelay, aRxTxTurnaroundTime, aSifsTime, aSlotTime, Backoff, BackoffDoneMsgFields, BkDone, Cancel, ClearNav, ControlCh, ControlType, CSMsgFields, DataCh, DataType, dot11LongRetryLimit, dot11ShortRetryLimit, dotllRTSThreshold, getBackoffMsgFields, GotAckMsg, GotCts, GotCtsMsgFields, mac_broadcast_addr, mBrate, misc, NeedAck, NeedAckMessageFields, nosrc, PCcheck, PCmax, PCmin, PCremove, PCremove2, PCrequest, PCresponse, PduRequest, RtsTimeout, RtsTimeoutMsgFields, RxIndicate, RxIndicateMessageFields, RxMpdu, RxMpduMsgFields, sAckCtsLng, SetNav, SetNavMessageFields, Slot, startRsp, TxConfirm, TxConfirmMsgFields, TxDataMsgFields, TxRequest, TxRequestMsgFields, TxStartMsgFields, UseDifs, UseEifs, UseIfsMsgFields
-
Fields inherited from class ptolemy.domains.wireless.lib.network.NetworkActorBase
_timersSet, Ack, AckPacket, appl_data_msg, appl_interest_msg, Busy, cNetwDataMessageFields, cNetwInterestMessageFields, Cts, Data, DataPacket, Error, Gilbert, Idle, netw_data_msg, netw_interest_msg, NoError, PCRequestMsgFields, PCResponseMsgFields, Rts, RtsPacket, RxData, Rxdelay, RxEnd, RxStart, StartRspMsgFields, Timeout, Turnaround, TxData, TxEnd, TxStart, TxStartConfirm, UNKNOWN
-
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 Backoff(CompositeEntity container, java.lang.String name)
Construct an actor with the specified name and container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone(Workspace workspace)
Clone the object into the specified workspace.void
declareDelayDependency()
Override the base class to declare that the BKDone output port does not depend on the getBackoff of fromDataPump input ports in a firing.void
fire()
The main functionvoid
initialize()
Initialize the private variables.-
Methods inherited from class ptolemy.domains.wireless.lib.network.mac.MACActorBase
_setAttribute, attributeChanged, getID
-
Methods inherited from class ptolemy.domains.wireless.lib.network.NetworkActorBase
cancelTimer, setTimer, whoTimeout
-
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
-
-
-
-
Field Detail
-
fromDataPump
public TypedIOPort fromDataPump
The input port for channel status message. This has undeclared type.
-
getBackoff
public TypedIOPort getBackoff
The input port for backoff message from the Protocol control block.
-
BKDone
public TypedIOPort BKDone
The output port that produces messages that indicate the backoff is done.
-
seed
public Parameter seed
The seed that controls the random number generation. A seed of zero is interpreted to mean that no seed is specified, which means that each execution of the model could result in distinct data. For the value 0, the seed is set to System.currentTimeMillis() + hashCode(), which means that with extremely high probability, two distinct actors will have distinct seeds. However, current time may not have enough resolution to ensure that two subsequent executions of the same model have distinct seeds. This parameter contains a LongToken, initially with value 0.
-
_random
protected java.util.Random _random
-
-
Constructor Detail
-
Backoff
public Backoff(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an actor with the specified 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. This constructor write-synchronizes on the workspace.- Parameters:
container
- The container.name
- The name of the actor.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name coincides with an actor already in the container.
-
-
Method Detail
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Clone the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an object with no container.- Overrides:
clone
in classTypedAtomicActor
- Parameters:
workspace
- The workspace for the cloned object.- Returns:
- The new Attribute.
- Throws:
java.lang.CloneNotSupportedException
- Not thrown in this base class- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
declareDelayDependency
public void declareDelayDependency() throws IllegalActionException
Override the base class to declare that the BKDone output port does not depend on the getBackoff of fromDataPump input ports in a firing.- Overrides:
declareDelayDependency
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If the causality interface cannot be computed.- See Also:
AtomicActor.getCausalityInterface()
,AtomicActor._declareDelayDependency(IOPort, IOPort, double)
-
fire
public void fire() throws IllegalActionException
The main function- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If an error occurs reading or writing inputs or outputs.
-
initialize
public void initialize() throws IllegalActionException
Initialize the private variables.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classNetworkActorBase
- Throws:
IllegalActionException
- If thrown by the base class.
-
-