public class Ramp extends SequenceSource
Accumulator actor.
The type of the output is determined by the constraint that it must
be greater than or equal to the types of the parameter (and/or the
step port, if it is connected).
Thus, this actor is
polymorphic in the sense that its output data type can be that
of any token type that supports addition.Accumulator| Green (bilung) |
| Green (eal) |
Entity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
PortParameter |
init
The value produced by the ramp on its first iteration.
|
PortParameter |
step
The amount by which the ramp output is incremented on each iteration.
|
_firingCountLimit, _iterationCount, firingCountLimit_triggered, output, trigger_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 |
|---|
Ramp(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attributeChanged(Attribute attribute)
If the argument is the init parameter, then reset the
state to the specified value.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
fire()
Send the current value of the state of this actor to the output.
|
void |
initialize()
Set the state to equal the value of the init parameter.
|
int |
iterate(int count)
Invoke a specified number of iterations of this actor.
|
boolean |
postfire()
Update the state of the actor by adding the value of the
step parameter to the state.
|
_customTypeConstraints, prefire_containedTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup_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, 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, stop, stopFire, terminateaddInitializable, preinitialize, removeInitializable, wrapupdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic PortParameter init
public PortParameter step
public Ramp(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
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 attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class LimitedFiringSourceattribute - The attribute that changed.IllegalActionException - If init cannot be evaluated
or cannot be converted to the output type, or if the superclass
throws it.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
init and step
public members to the parameters of the new actor.clone in class TypedAtomicActorworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void fire()
throws IllegalActionException
fire in interface Executablefire in class SourceIllegalActionException - If calling send() or super.fire()
throws it.public void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class LimitedFiringSourceIllegalActionException - If the parent class throws it.public int iterate(int count)
throws IllegalActionException
This method should be called instead of the usual prefire(), fire(), postfire() methods when this actor is used in a domain that supports vectorized actors. This leads to more efficient execution.
iterate in interface Executableiterate in class AtomicActor<TypedIOPort>count - The number of iterations to perform.IllegalActionException - If iterating cannot be
performed.public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class LimitedFiringSourceIllegalActionException - If the firingCountLimit parameter
has an invalid expression.