Package ptolemy.domains.ptides.lib.qm
Class VariableDelaySwitch
- 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.actor.lib.aspect.AtomicCommunicationAspect
-
- ptolemy.domains.de.lib.aspect.BasicSwitch
-
- ptolemy.domains.ptides.lib.qm.VariableDelaySwitch
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,CommunicationAspect
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Decorator
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class VariableDelaySwitch extends BasicSwitch
ACommunicationAspect
actor that applies packet-size and priority dependent delay to incoming packets. Intended to use with RecordTokens only. Assumes record token includes the encapsulated packages with a label "packets" and a TCP header with label "TCPlabel"- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ilge Akkaya
- Pt.AcceptedRating:
- Pt.ProposedRating:
- Red (ilgea)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.domains.de.lib.aspect.BasicSwitch
BasicSwitch.BasicSwitchAttributes
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_allowPDV
Aallow or disallow input buffer packet delay variation.protected boolean
_allowPriority
Allow or disallow priority switching.protected int
_channelBandwidth
The channel bandwidth that will be used to determine the delay (in bits/sec).protected int
_unitTokenSize
The unit token size in bits.Parameter
allowPDV
A Boolean to enable/disable packet-length dependent input delay.Parameter
allowPriority
A Boolean to enable/disable priority dependent input delay.Parameter
channelBandwidth
The channel bandwidth in bits/second.protected static int
TCPHeaderSize
The default header size for TCP.Parameter
unitTokenSize
The size of one data token in bits.-
Fields inherited from class ptolemy.domains.de.lib.aspect.BasicSwitch
_inputBufferDelay, _inputTokens, _ioPortToSwitchInPort, _ioPortToSwitchOutPort, _nextFireTime, _numberOfPorts, _outputBufferDelay, _outputTokens, _switchFabricDelay, inputBufferDelay, numberOfPorts, outputBufferDelay, switchFabricDelay
-
Fields inherited from class ptolemy.actor.lib.aspect.AtomicCommunicationAspect
_parameters, _tokenCount
-
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.CommunicationAspect
decoratorHighlightColorName
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description VariableDelaySwitch(CompositeEntity container, java.lang.String name)
Construct a VariableDelaySwitch.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attributeChanged(Attribute attribute)
Process the attributes.void
sendToken(Receiver source, Receiver receiver, Token token)
Initiate a send of the specified token to the specified receiver.-
Methods inherited from class ptolemy.domains.de.lib.aspect.BasicSwitch
_getNextFireTime, _getPortID, _scheduleRefire, clone, createDecoratorAttributes, createIntermediateReceiver, fire, getReceiver, initialize, postfire, reset, setContainer, setPortIn, setPortOut
-
Methods inherited from class ptolemy.actor.lib.aspect.AtomicCommunicationAspect
_sendToReceiver, decoratedObjects, isGlobalDecorator, registerListener, sendCommunicationEvent
-
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, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, 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, 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
-
allowPDV
public Parameter allowPDV
A Boolean to enable/disable packet-length dependent input delay. The initial default value is true.
-
allowPriority
public Parameter allowPriority
A Boolean to enable/disable priority dependent input delay. The initial default value is false.
-
channelBandwidth
public Parameter channelBandwidth
The channel bandwidth in bits/second. The initial default value is the integer 1000000, signifying 1Mbps.
-
unitTokenSize
public Parameter unitTokenSize
The size of one data token in bits. The initial default value is an integer with the value 1000.
-
_channelBandwidth
protected int _channelBandwidth
The channel bandwidth that will be used to determine the delay (in bits/sec).
-
_unitTokenSize
protected int _unitTokenSize
The unit token size in bits.
-
_allowPDV
protected boolean _allowPDV
Aallow or disallow input buffer packet delay variation.
-
_allowPriority
protected boolean _allowPriority
Allow or disallow priority switching.
-
TCPHeaderSize
protected static final int TCPHeaderSize
The default header size for TCP.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VariableDelaySwitch
public VariableDelaySwitch(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a VariableDelaySwitch.- Parameters:
container
- the container.name
- the name.- Throws:
IllegalActionException
- If there is a problem with construction.NameDuplicationException
- If there is a name collision.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
Process the attributes.- Overrides:
attributeChanged
in classBasicSwitch
- Parameters:
attribute
- The attribute that changed.- Throws:
IllegalActionException
- If value is inappropriate.
-
sendToken
public void sendToken(Receiver source, Receiver receiver, Token token) throws IllegalActionException
Initiate a send of the specified token to the specified receiver. This method will schedule a refiring of this actor if there is not one already scheduled. Additional input delays are calculated and added to the timing constraints here.- Specified by:
sendToken
in interfaceCommunicationAspect
- Overrides:
sendToken
in classBasicSwitch
- Parameters:
source
- Sender of the token.receiver
- The sending receiver.token
- The token to send.- Throws:
IllegalActionException
- If the refiring request fails.
-
-