|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.de.kernel.DEActor
ptolemy.domains.de.lib.DETransformer
ptolemy.domains.de.lib.Server
This actor models a server with a fixed or variable service time. A server is either busy (serving a customer) or not busy at any given time. If an input arrives when it is not busy, then the input token is produced on the output with a delay given by the serviceTime parameter. If an input arrives while the server is busy, then that input is queued until the server becomes free, at which point it is produced on the output with a delay given by the serviceTime parameter. If several inputs arrive while the server is busy, then they are served on a first-come, first-served basis.
If the serviceTime parameter is not set, it defaults to 1.0. The value of the parameter can be changed at any time during execution of the model by providing an input event at the newServiceTime input port. The token read at that port replaces the value of the serviceTime parameter.
This actor declares that there is delay between the input and the output ports and between newServiceTime and output. The director uses this information for assigning priorities to firings.
Like the TimedDelay actor, the output is produced with a future time stamp (larger than current time by serviceTime). That output token cannot be retracted once produced, even if the server actor is deleted from the topology. If the service time is zero, then the output event is queued to be processed in the next microstep, after all events with the current time in the current microstep. Thus, a service time of zero can be usefully viewed as an infinitesimal service time.
TimedDelay,
VariableDelay,
SampleDelay,
Serialized Form
| Yellow (cxh) |
| Yellow (eal) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
ptolemy.kernel.Entity.ContainedObjectsIterator |
| Field Summary | |
DEIOPort |
newServiceTime
A port to supply new service times. |
ptolemy.data.expr.Parameter |
serviceTime
The service time. |
| Fields inherited from class ptolemy.domains.de.lib.DETransformer |
input, output |
| Fields inherited from class ptolemy.actor.AtomicActor |
_stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
Server(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Construct an actor with the specified container and name. |
|
| Method Summary | |
void |
attributeChanged(ptolemy.kernel.util.Attribute attribute)
If the attribute is serviceTime, then check that the value is non-negative. |
void |
fire()
If there is an input token, read it to begin servicing it. |
void |
initialize()
Indicate that the server is not busy. |
boolean |
postfire()
If a token was read in the fire() method, then produce it on the output and schedule a firing to occur when the service time elapses. |
boolean |
prefire()
If the server is not busy, return true. |
void |
pruneDependencies()
Override the base class to declare that the output does not depend on the input or newServiceTime in a firing. |
| Methods inherited from class ptolemy.domains.de.kernel.DEActor |
newPort |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
_addPort, attributeTypeChanged, clone, typeConstraintList |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, preinitialize, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ptolemy.actor.Actor |
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
iterate, preinitialize, stop, stopFire, terminate, wrapup |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
getDerivedLevel, getDerivedList, propagateValue |
| Methods inherited from interface ptolemy.kernel.util.Nameable |
description, getFullName, getName, getName |
| Field Detail |
public DEIOPort newServiceTime
public ptolemy.data.expr.Parameter serviceTime
| Constructor Detail |
public Server(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.NameDuplicationException,
ptolemy.kernel.util.IllegalActionException
container - The composite actor to contain this one.name - The name of this actor.
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained
by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an
actor with this name.| Method Detail |
public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
throws ptolemy.kernel.util.IllegalActionException
attribute - The attribute that changed.
ptolemy.kernel.util.IllegalActionException - If the service time is negative.
public void fire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If there is no director.
public void initialize()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the base class throws it.
public boolean prefire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If there is no director.
public boolean postfire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If there is no director.public void pruneDependencies()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||