Package ptolemy.actor.util
Class FreeVariableModelAnalysis
- java.lang.Object
-
- ptolemy.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$
- Author:
- Stephen Neuendorffer
- Pt.AcceptedRating:
- Yellow (neuendor)
- Pt.ProposedRating:
- Yellow (neuendor)
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set
getFreeVariables(Entity entity)
Return the computed free variables for the given entity.
-
-
-
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.- Returns:
- The computed free variables for the given entity.
- Throws:
java.lang.RuntimeException
- If the free variables for the entity have not already been computed.
-
-