public class DDF extends DataflowWithRates
DataflowWithRates.ActionRateSignature
_actions, _actor, _actorInterpreter, _context, _currentStateSet, _currentTransitions, _env, _inputPorts, _lastFiredAction, _outputPorts, _ptActor
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
DDF(TypedAtomicActor ptActor,
caltrop.interpreter.ast.Actor actor,
caltrop.interpreter.Context context,
caltrop.interpreter.environment.Environment env)
Create an new DDF DDI.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_hasInputDependentGuard() |
java.lang.String |
getName()
Get the name of this DDI.
|
void |
initialize()
Initialize the actor and select the first action to fire.
|
boolean |
isLegalActor()
In DDF, an actor is legal if:
The guards of each action do not depend on the inputs.
|
boolean |
postfire()
Postfire this actor.
|
boolean |
prefire()
Select a fireable action among the actions of the actor, if possible.
|
void |
setupActor()
Setup the actor associated with this DDI.
|
_allEqual, _annotatePortsWithRates, _atLeastOneUnguardedAction, _checkInitializerGuards, _computeActionRates, _computeActionRates, _isBoundByPortVar
_selectAction, _selectInitializer, fire, preinitialize
addInitializable, isFireFunctional, isStrict, iterate, removeInitializable, stop, stopFire, terminate, wrapup
public DDF(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)
ptActor
- The instance of ptolemy.actor.Actor
that the plugin will be associated with.actor
- The abstract syntax tree of the CAL source.context
- The context that the plugin will use.env
- The environment that the plugin will use.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class Dataflow
IllegalActionException
public boolean isLegalActor()
isLegalActor
in interface DDI
isLegalActor
in class Dataflow
public java.lang.String getName()
public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class Dataflow
IllegalActionException
- If postfiring is not permitted.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class Dataflow
IllegalActionException
- If an error occurred during the
action selection.public void setupActor()
isLegalActor()
is called first.
Setup involves attaching attributes with token consumption/production rates to the input and output ports of the actor associated with this DDI.
setupActor
in interface DDI
setupActor
in class Dataflow
protected boolean _hasInputDependentGuard()