ptolemy.caltrop.ddi
Class SDF

java.lang.Object
  extended by ptolemy.caltrop.ddi.AbstractDDI
      extended by ptolemy.caltrop.ddi.Dataflow
          extended by ptolemy.caltrop.ddi.DataflowWithRates
              extended by ptolemy.caltrop.ddi.SDF
All Implemented Interfaces:
Executable, Initializable, DDI

public class SDF
extends DataflowWithRates

A plugin for the SDF domain. In SDF, a CAL actor is valid if:

  1. The rates of each action are statically computable, and these rates are the same for each action.
  2. There is at least one unguarded action.
This plugin also adds attributes containing rate information to the ports of the actor.

Since:
Ptolemy II 4.0
Version:
$Id: SDF.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Christopher Chang, Steve Neuendorffer
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.caltrop.ddi.DataflowWithRates
DataflowWithRates.ActionRateSignature
 
Field Summary
private  DataflowWithRates.ActionRateSignature[] _actionRates
           
private  DataflowWithRates.ActionRateSignature[] _initializerRates
           
 
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
SDF(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)
          Create an new SDF DDI.
 
Method Summary
 java.lang.String getName()
          Get the name of this DDI.
 boolean isLegalActor()
          In SDF, an actor is legal if: The rates of each action are statically computable, and these rates are the same for each action.
 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, initialize, postfire, prefire, preinitialize
 
Methods inherited from class ptolemy.caltrop.ddi.AbstractDDI
addInitializable, isFireFunctional, isStrict, iterate, removeInitializable, stop, stopFire, terminate, wrapup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actionRates

private DataflowWithRates.ActionRateSignature[] _actionRates

_initializerRates

private DataflowWithRates.ActionRateSignature[] _initializerRates
Constructor Detail

SDF

public SDF(TypedAtomicActor ptActor,
           caltrop.interpreter.ast.Actor actor,
           caltrop.interpreter.Context context,
           caltrop.interpreter.environment.Environment env)
Create an new SDF 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.
Method Detail

isLegalActor

public boolean isLegalActor()
In SDF, an actor is legal if:
  1. The rates of each action are statically computable, and these rates are the same for each action.
  2. There is at least one unguarded action.
  3. The rates and guards of the initializers are statically computable.

Specified by:
isLegalActor in interface DDI
Overrides:
isLegalActor in class Dataflow
Returns:
True if the actor associated with this DDI is a legal SDF 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:
"SDF".

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