Package 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.
- Since:
- Ptolemy II 5.2
- Version:
- $Id$
- Author:
- Steve Neuendorffer
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.caltrop.ddi.DataflowWithRates
DataflowWithRates.ActionRateSignature
-
-
Field Summary
-
Fields inherited from class ptolemy.caltrop.ddi.Dataflow
_actions, _actor, _actorInterpreter, _context, _currentStateSet, _currentTransitions, _env, _inputPorts, _lastFiredAction, _outputPorts, _ptActor
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description DDF(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)
Create an new DDF DDI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class ptolemy.caltrop.ddi.DataflowWithRates
_allEqual, _annotatePortsWithRates, _atLeastOneUnguardedAction, _checkInitializerGuards, _computeActionRates, _computeActionRates, _isBoundByPortVar
-
Methods inherited from class ptolemy.caltrop.ddi.Dataflow
_selectAction, _selectInitializer, fire, preinitialize
-
Methods inherited from class ptolemy.caltrop.ddi.AbstractDDI
addInitializable, isFireFunctional, isStrict, iterate, removeInitializable, stop, stopFire, terminate, wrapup
-
-
-
-
Constructor Detail
-
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 ofptolemy.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.
-
-
Method Detail
-
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 interfaceInitializable
- Overrides:
initialize
in classDataflow
- 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 interfaceDDI
- Overrides:
isLegalActor
in classDataflow
- 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.
-
postfire
public boolean postfire() throws IllegalActionException
Postfire this actor.- Specified by:
postfire
in interfaceExecutable
- Overrides:
postfire
in classDataflow
- Returns:
- True if the execution can continue.
- Throws:
IllegalActionException
- If postfiring is not permitted.
-
prefire
public boolean prefire() throws IllegalActionException
Select a fireable action among the actions of the actor, if possible.- Specified by:
prefire
in interfaceExecutable
- Overrides:
prefire
in classDataflow
- 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 thatisLegalActor()
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 interfaceDDI
- Overrides:
setupActor
in classDataflow
-
_hasInputDependentGuard
protected boolean _hasInputDependentGuard()
-
-