ptolemy.caltrop.ddi
Class DDF
java.lang.Object
ptolemy.caltrop.ddi.AbstractDDI
ptolemy.caltrop.ddi.Dataflow
ptolemy.caltrop.ddi.DataflowWithRates
ptolemy.caltrop.ddi.DDF
- All Implemented Interfaces:
- Executable, Initializable, DDI
public class DDF
- extends DataflowWithRates
A plugin for the DDF domain. In DDF, a CAL actor is valid if:
- The guards of each action do not depend on the inputs.
- The rates of each action do not depend on the inputs.
This plugin also adds attributes containing rate information to the
ports of the actor.
- Since:
- Ptolemy II 5.2
- Version:
- $Id: DDF.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Steve Neuendorffer
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.caltrop.ddi.Dataflow |
_actions, _actor, _actorInterpreter, _context, _currentStateSet, _currentTransitions, _env, _inputPorts, _lastFiredAction, _outputPorts, _ptActor |
Constructor Summary |
DDF(TypedAtomicActor ptActor,
caltrop.interpreter.ast.Actor actor,
caltrop.interpreter.Context context,
caltrop.interpreter.environment.Environment env)
Create an new DDF DDI. |
Method Summary |
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 firable action among the actions of the actor, if possible. |
void |
setupActor()
Setup the actor associated with this DDI. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_currentSignature
private DataflowWithRates.ActionRateSignature _currentSignature
_zeroRateSignature
private static DataflowWithRates.ActionRateSignature _zeroRateSignature
DDF
public DDF(TypedAtomicActor ptActor,
caltrop.interpreter.ast.Actor actor,
caltrop.interpreter.Context context,
caltrop.interpreter.environment.Environment env)
- Create an new DDF DDI.
- Parameters:
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.
initialize
public void initialize()
throws IllegalActionException
- Initialize the actor and select the first action to fire.
Publish rate information for this actor according to the
action.
- Specified by:
initialize
in interface Initializable
- Overrides:
initialize
in class Dataflow
- Throws:
IllegalActionException
isLegalActor
public boolean isLegalActor()
- In DDF, an actor is legal if:
- The guards of each action do not depend on the inputs.
- The rates of each action do not depend on the inputs.
- Specified by:
isLegalActor
in interface DDI
- Overrides:
isLegalActor
in class Dataflow
- Returns:
- True if the actor associated with this DDI is
a legal DDF actor.
getName
public java.lang.String getName()
- Get the name of this DDI.
- Specified by:
getName
in interface DDI
- Overrides:
getName
in class Dataflow
- Returns:
- "DDF".
postfire
public boolean postfire()
throws IllegalActionException
- Postfire this actor.
- Specified by:
postfire
in interface Executable
- Overrides:
postfire
in class Dataflow
- Returns:
- True if the execution can continue.
- Throws:
IllegalActionException
- If postfiring is not permitted.
prefire
public boolean prefire()
throws IllegalActionException
- Select a firable action among the actions of the actor, if possible.
- Specified by:
prefire
in interface Executable
- Overrides:
prefire
in class Dataflow
- Returns:
- True, if an action could be selected.
- Throws:
IllegalActionException
- If an error occurred during the
action selection.
setupActor
public void setupActor()
- Setup the actor associated with this DDI. Assumes that
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.
- Specified by:
setupActor
in interface DDI
- Overrides:
setupActor
in class Dataflow
_hasInputDependentGuard
protected boolean _hasInputDependentGuard()