|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.util.ConstVariableModelAnalysis
An analysis that traverses a model to determine all the constant variables in a hierarchical model. Basically, a constant variable in a particular model is any variable in the model that is defined by a expression of constants, or any variable that is defined by an expression of constants and identifiers that reference other constant variables.
This class computes the set of constant variables by computing the
set of variables that are not constant and then performing the
complement. This is somewhat easier to compute. The computation is
performed in two passes, the first of which extracts the set of
variables which must be not-constant either by not being evaluatable,
by inclusion in an initial set, by virtue of being a PortParameter
with an external connection, or by assignment from within a modal
model. The second pass collects all the variables which are not
constant because they depend on other variables which are not
constant. This class also recognizes dependence declarations
represented by the DependencyDeclaration class.
This class also keeps track of the "change context" of each dynamic variable. The change context of a variable is an actor that contains that variable. During a firing of the actor, the variable's value should not change. This is important for supporting parameter changes in the context of domains that perform scheduling based on parameter values, like SDF. The change context of a PortParameter with an external connection is the container of the PortParameter. The change context of a variable assigned by a finite state machine in a modal model is the container of the finite state machine. The change context of asserted not constant variables and variables with no expression are assumed to be the toplevel of the model.
| Yellow (neuendor) |
| Yellow (neuendor) |
| Constructor Summary | |
ConstVariableModelAnalysis(Entity model)
Analyze the given model to determine which variables must be constants and which variables may change dynamically during execution. |
|
ConstVariableModelAnalysis(Entity model,
java.util.Set variableSet)
Analyze the given model to determine which variables must be constants and which variables may change dynamically during execution, given that all variables in the given set may change dynamically. |
|
| Method Summary | |
void |
addDependencyDeclaration(DependencyDeclaration declaration)
Add the information in the given dependency declaration to the dependence graph of this analysis. |
static ConstVariableModelAnalysis |
getAnalysis(NamedObj object)
Return the analysis that is active for the given object. |
Entity |
getChangeContext(Variable variable)
Return the change context of the given variable. |
java.util.Set |
getConstVariables(NamedObj container)
Return the computed constant variables for the given container. |
DirectedGraph |
getDependencyGraph()
Return the parameter dependency graph constructed through this analysis. |
java.util.Set |
getNotConstVariables(NamedObj container)
Return the computed not constant variables for the given container. |
java.util.Set |
getVariablesWithChangeContext(NamedObj container)
Return the set of variables anywhere in the model that have the given container as least change context. |
boolean |
isIndependent(Variable variable)
Return true if the variable has been analyzed by this analysis and it depends on no other parameters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConstVariableModelAnalysis(Entity model)
throws IllegalActionException
model - The model to be analyzed.
IllegalActionException - If an exception occurs
during analysis.
public ConstVariableModelAnalysis(Entity model,
java.util.Set variableSet)
throws IllegalActionException
IllegalActionException - If an exception occurs
during analysis.| Method Detail |
public void addDependencyDeclaration(DependencyDeclaration declaration)
throws IllegalActionException
IllegalActionException
public static ConstVariableModelAnalysis getAnalysis(NamedObj object)
throws IllegalActionException
IllegalActionExceptionpublic Entity getChangeContext(Variable variable)
public java.util.Set getConstVariables(NamedObj container)
java.lang.RuntimeException - If the constant variables for the
container have not already been computed.public DirectedGraph getDependencyGraph()
public java.util.Set getNotConstVariables(NamedObj container)
java.lang.RuntimeException - If the constant variables for the
container have not already been computed.public java.util.Set getVariablesWithChangeContext(NamedObj container)
public boolean isIndependent(Variable variable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||