ptolemy.actor.util
Class FreeVariableModelAnalysis

java.lang.Object
  extended byptolemy.actor.util.FreeVariableModelAnalysis

public class FreeVariableModelAnalysis
extends java.lang.Object

An analysis that traverses a model to determine all the free variables in a hierarchical model. The free variables in a model are defined to be the set of identifiers that are referenced by the model, but are not defined in the model. The free variables must be assigned values for the model to be executable. This class traverses the model, but it not read synchronized on the model, therefore its caller should be.

Since:
Ptolemy II 4.0
Version:
$Id: FreeVariableModelAnalysis.java,v 1.10 2004/04/13 03:11:55 cxh Exp $
Author:
Stephen Neuendorffer
Accepted Rating:
Yellow (neuendor)
Proposed Rating:
Yellow (neuendor)

Constructor Summary
FreeVariableModelAnalysis(Entity model)
          Analyze the given model to return a set of names which must be defined externally for the model to be completely specified.
 
Method Summary
 java.util.Set getFreeVariables(Entity entity)
          Return the computed free variables for the given entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeVariableModelAnalysis

public FreeVariableModelAnalysis(Entity model)
                          throws IllegalActionException
Analyze the given model to return a set of names which must be defined externally for the model to be completely specified. In addition, store the intermediate results for contained actors so they can be retrieved by the getFreeVariables() method.

Parameters:
model - The model that will be analyzed.
Throws:
IllegalActionException - If an exception occurs during analysis.
Method Detail

getFreeVariables

public java.util.Set getFreeVariables(Entity entity)
Return the computed free variables for the given entity.

Parameters:
entity - An entity, which must be deeply contained by the model for which this analysis was created.
Throws:
java.lang.RuntimeException - If the free variables for the entity have not already been computed.