Compartilhar via


Feature Attribute

Classes defined within a model program can be labeled as belonging to named feature sets using the [Feature(name)] attribute (where name is a string value). A feature is a named grouping of related state variables and rules representing a submodel of the overall model program.

A feature or a set of features can be explored independently by selecting it in the model program construct. For more information, see ModelProgramConstruct. If no feature is selected explicitly, all features are explored together.

Exploration of a set of features is similar to synchronized or interleaved parallel composition. Assuming that each feature has its own configuration, the following code examples are equivalent.

construct model program from Config where features="f1,...,fn"

construct model program from Config1 where features="f1"
   |?| construct model program from Config2 where features="f2"
   ... 
   |?| construct model program from Confign where features="fn" 

Therefore, features synchronize on common actions and interleave on disjointed ones.

If a class does not have a feature attribute, it is associated with a default feature.

Besides providing a programmatic way to express parallel composition, features can also be useful in state viewing. Exploring a set of features is a way to project the state view by grouping states that cannot be distinguished from the viewpoint of that feature set.

See Also

Reference

ModelProgramConstruct
FeatureAttribute

Concepts

Model Programs

Other Resources

Model Program Attributes