Package ptolemy.caltrop.ddi
Class Dataflow
- java.lang.Object
-
- ptolemy.caltrop.ddi.AbstractDDI
-
- ptolemy.caltrop.ddi.Dataflow
-
- All Implemented Interfaces:
Executable
,Initializable
,DDI
- Direct Known Subclasses:
DataflowWithRates
public class Dataflow extends AbstractDDI
- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Jörn W. Janneck, Steve Neuendorffer
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
Fields Modifier and Type Field Description protected caltrop.interpreter.ast.Action[]
_actions
protected caltrop.interpreter.ast.Actor
_actor
protected DataflowActorInterpreter
_actorInterpreter
protected caltrop.interpreter.Context
_context
protected java.util.Set
_currentStateSet
protected caltrop.interpreter.ast.Transition[]
_currentTransitions
protected caltrop.interpreter.environment.Environment
_env
protected java.util.Map
_inputPorts
protected caltrop.interpreter.ast.Action
_lastFiredAction
protected java.util.Map
_outputPorts
protected TypedAtomicActor
_ptActor
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description Dataflow(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
_selectAction()
This method picks an action for which the actor interpreter evaluates the guard to true.protected int
_selectInitializer()
void
fire()
Executes the selected action on the firstfire()
call.java.lang.String
getName()
Get the name of the domain that this DDI implements.void
initialize()
In SDF, selecting which initializer to fire is already done in preinitialize().boolean
isLegalActor()
Perform static checking on the actor, ensuring its validity in a given domain.boolean
postfire()
Postfire this actor.boolean
prefire()
Select a fireable action among the actions of the actor, if possible.void
preinitialize()
Preinitialize this actor.void
setupActor()
Perform any domain dependent setup.-
Methods inherited from class ptolemy.caltrop.ddi.AbstractDDI
addInitializable, isFireFunctional, isStrict, iterate, removeInitializable, stop, stopFire, terminate, wrapup
-
-
-
-
Field Detail
-
_ptActor
protected TypedAtomicActor _ptActor
-
_actor
protected caltrop.interpreter.ast.Actor _actor
-
_actions
protected caltrop.interpreter.ast.Action[] _actions
-
_context
protected caltrop.interpreter.Context _context
-
_env
protected caltrop.interpreter.environment.Environment _env
-
_currentStateSet
protected java.util.Set _currentStateSet
-
_currentTransitions
protected caltrop.interpreter.ast.Transition[] _currentTransitions
-
_actorInterpreter
protected DataflowActorInterpreter _actorInterpreter
-
_inputPorts
protected java.util.Map _inputPorts
-
_outputPorts
protected java.util.Map _outputPorts
-
_lastFiredAction
protected caltrop.interpreter.ast.Action _lastFiredAction
-
-
Constructor Detail
-
Dataflow
public Dataflow(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)
-
-
Method Detail
-
isLegalActor
public boolean isLegalActor()
Description copied from interface:DDI
Perform static checking on the actor, ensuring its validity in a given domain.- Returns:
- True, if the actor is legal.
-
setupActor
public void setupActor()
Description copied from interface:DDI
Perform any domain dependent setup. This can include hanging various attributes off of the actor, for example, the rate of the input and output ports.
-
getName
public java.lang.String getName()
Description copied from interface:DDI
Get the name of the domain that this DDI implements.- Returns:
- The name of the domain that this DDI implements.
-
fire
public void fire() throws IllegalActionException
Executes the selected action on the firstfire()
call. On successive calls, it rolls back previous state changes, selects a new action and executes it.Note: Is this correct behavior? What is the contract between the result of prefire() and successive calls to fire()?
- Throws:
IllegalActionException
- If an error occurs during the interpretation of the action.
-
preinitialize
public void preinitialize() throws IllegalActionException
Preinitialize this actor.- Throws:
IllegalActionException
- If initializing is not permitted.
-
_selectAction
protected int _selectAction()
This method picks an action for which the actor interpreter evaluates the guard to true. Note that this does not necessarily mean that all preconditions for firing are satisfied---the amount of "prechecking" depends on the model of computation ddi. (FIXMELATER)- Returns:
- The action number that was selected, a value <0 if no action was selected.
-
_selectInitializer
protected int _selectInitializer()
-
initialize
public void initialize() throws IllegalActionException
In SDF, selecting which initializer to fire is already done in preinitialize().- Throws:
IllegalActionException
-
postfire
public boolean postfire() throws IllegalActionException
Postfire this actor.- 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.- Returns:
- True, if an action could be selected.
- Throws:
IllegalActionException
- If an error occurred during the action selection.
-
-