public class BootstrapSampleDelay extends SampleDelay
The BootstrapSampleDelay works in the same way as a regular sample delay actor, but with the added feature that it records the initial value passed into it and will send that value out as the initial value on the next run.
Frequently, sample delays are placed as dependency loop-breakers so that a model can run, but their default value of {0} is undesirable. This is commonly fixed by examining the first value passed into the sample delay and either setting the sample delay's starting value to this value; or recording that value in a parameter within the same container as the sample delay and setting the sample delay's starting value to reference the parameter.
The Bootstrap sample delay internalizes the above solutions and furthermore needs no additional manual upkeep should starting values change.
| Red (cxh) |
| Red (cxh) |
Entity.ContainedObjectsIteratorinitialOutputsinput, input_tokenConsumptionRate, output, output_tokenInitProduction, output_tokenProductionRate_typesValid_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
BootstrapSampleDelay(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fire()
During the first iteration, read exactly one input token, update
the initialOutputs for a future run and send the token to the output.
|
void |
wrapup()
Reset the state for the next run.
|
_customTypeConstraints, attributeTypeChanged, clone, initialize, preinitializeprefire_containedTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, 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, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListisFireFunctional, isStrict, iterate, postfire, stop, stopFire, terminateaddInitializable, removeInitializabledescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic BootstrapSampleDelay(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container.name - The name of this actor.IllegalActionException - If the actor cannot be contained
by the proposed container.NameDuplicationException - If the container already has an
actor with this name.public void fire()
throws IllegalActionException
fire in interface Executablefire in class SampleDelayIllegalActionException - If the get() or send() methods
of the ports throw it.public void wrapup()
throws IllegalActionException
wrapup in interface Initializablewrapup in class AtomicActor<TypedIOPort>IllegalActionException - If thrown by a base class.