Difference between revisions of "Manage attributes"
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
− | + | <breadcrumbs>Analytica User Guide > Working with Large Models > {{PAGENAME}}</breadcrumbs> | |
− | + | ||
Every node in an Analytica model is described by a collection of '''''attributes'''''. For some models, you might want to control the display of attributes or create new attributes. Some attributes apply to all classes (variable, module, and function). Others apply to specific classes, as listed in the following table. | Every node in an Analytica model is described by a collection of '''''attributes'''''. For some models, you might want to control the display of attributes or create new attributes. Some attributes apply to all classes (variable, module, and function). Others apply to specific classes, as listed in the following table. | ||
Line 125: | Line 125: | ||
For descriptions of the attributes, see [[Glossary]]. | For descriptions of the attributes, see [[Glossary]]. | ||
− | + | === Attributes dialog === | |
+ | Use the '''Attribute'''s dialog to control the display of optional attributes in the '''Object''' window and '''Attribute''' panel and to define new attributes. | ||
To open the '''Attributes''' dialog, select '''Attributes''' from the '''Object''' menu. | To open the '''Attributes''' dialog, select '''Attributes''' from the '''Object''' menu. | ||
Line 135: | Line 136: | ||
: This list shows attributes for the selected class. Attributes with an asterisk (*) are always displayed in the '''Object''' window and '''Attribute''' panel. Attributes with a checkmark (√) are displayed optionally | : This list shows attributes for the selected class. Attributes with an asterisk (*) are always displayed in the '''Object''' window and '''Attribute''' panel. Attributes with a checkmark (√) are displayed optionally | ||
− | + | === Displaying optional attributes === | |
+ | To display an optional attribute in the '''Object''' window and '''Attribute''' panel, click it once to select it, then click it again to show a checkmark. | ||
To hide an optional attribute, click it once to select it, then click it again to remove the checkmark. | To hide an optional attribute, click it once to select it, then click it again to remove the checkmark. | ||
− | + | === Creating new attributes === | |
+ | You can create up to five additional attributes. For example, you could use a reference attribute to include the bibliographic reference for a module or variable. | ||
To create a new attribute in the '''Attributes''' dialog: | To create a new attribute in the '''Attributes''' dialog: | ||
Line 148: | Line 151: | ||
not it is displayed for modules, variables, or functions, select the '''Class''' popup menu in the '''Attributes '''dialog, and turn the checkmark on or off. | not it is displayed for modules, variables, or functions, select the '''Class''' popup menu in the '''Attributes '''dialog, and turn the checkmark on or off. | ||
− | + | === Renaming an attribute === | |
+ | To rename a created attribute: | ||
# Select it in the '''Attribute''' list. The ''Title'' field and the '''Rename''' button appear. | # Select it in the '''Attribute''' list. The ''Title'' field and the '''Rename''' button appear. | ||
# Edit the name of the attribute in the ''Title'' field. | # Edit the name of the attribute in the ''Title'' field. | ||
Line 156: | Line 160: | ||
Analytica includes the following function for referring to the value of an attribute in a variable’s definition. | Analytica includes the following function for referring to the value of an attribute in a variable’s definition. | ||
− | =====''Attrib'' Of x===== | + | ===== ''Attrib'' Of x ===== |
Returns the value of attribute '''attrib''' of object '''x''', where '''x''' might be a variable, function, or module. For most attributes, including ''Identifier, Title, Description, Units, Definition'', and user-defined attributes the result is a text value. For ''Value'' and ''Probvalue'', the result is the value of the variable (deterministic or probabilistic, respectively). For ''Inputs, Outputs,'' and ''Contains'' (an attribute of a module), the result is a vector of variables. | Returns the value of attribute '''attrib''' of object '''x''', where '''x''' might be a variable, function, or module. For most attributes, including ''Identifier, Title, Description, Units, Definition'', and user-defined attributes the result is a text value. For ''Value'' and ''Probvalue'', the result is the value of the variable (deterministic or probabilistic, respectively). For ''Inputs, Outputs,'' and ''Contains'' (an attribute of a module), the result is a vector of variables. | ||
Line 172: | Line 176: | ||
<tip title="Tip">Changes to attributes other than ''Definition'' do not automatically cause recomputation of the variables whose definitions refer to those attributes. So, if you change Units of <code>Boiling_point</code> to C, the value of <code>Boiling_point</code> does not change until <code>Boiling_point</code> is recomputed for some other reason.</Tip> | <tip title="Tip">Changes to attributes other than ''Definition'' do not automatically cause recomputation of the variables whose definitions refer to those attributes. So, if you change Units of <code>Boiling_point</code> to C, the value of <code>Boiling_point</code> does not change until <code>Boiling_point</code> is recomputed for some other reason.</Tip> | ||
− | ==See Also== | + | == See Also == |
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5 | {| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5 | ||
|- style="text-align: center" | |- style="text-align: center" | ||
− | | | + | | <footer>Finding variables / {{PAGENAME}} / Invalid variables </footer> |
|} | |} |
Revision as of 19:47, 26 October 2015
Every node in an Analytica model is described by a collection of attributes. For some models, you might want to control the display of attributes or create new attributes. Some attributes apply to all classes (variable, module, and function). Others apply to specific classes, as listed in the following table.
Attribute | Function | Module | Variable |
---|---|---|---|
Author | * | ||
Check | + | + | |
Class | * | * | * |
Created | * | ||
Definition | * | * | |
Description | * | * | * |
Domain | + | ||
File Info | * | ||
Help | + | + | + |
Identifier | * | * | * |
Inputs | + | + | |
Last Saved | * | ||
MetaOnly | + | ||
Outputs | + | + | |
Parameters | * | ||
Probvalue | + | ||
Recursive | + | ||
Title | * | * | * |
Units | * | * | |
Value | + | ||
User-created (up to 5) | + | + | + |
Key:
- plain = modifiable by user
- italic = set by Analytica
- * = always displayed
- + = optionally displayed
For descriptions of the attributes, see Glossary.
Attributes dialog
Use the Attributes dialog to control the display of optional attributes in the Object window and Attribute panel and to define new attributes. To open the Attributes dialog, select Attributes from the Object menu.
- Class popup menu
- Use this menu to select the Attribute list for variables, modules, or functions.
- Attribute list
- This list shows attributes for the selected class. Attributes with an asterisk (*) are always displayed in the Object window and Attribute panel. Attributes with a checkmark (√) are displayed optionally
Displaying optional attributes
To display an optional attribute in the Object window and Attribute panel, click it once to select it, then click it again to show a checkmark. To hide an optional attribute, click it once to select it, then click it again to remove the checkmark.
Creating new attributes
You can create up to five additional attributes. For example, you could use a reference attribute to include the bibliographic reference for a module or variable.
To create a new attribute in the Attributes dialog:
- Select new Attribute from the attribute list to show the new Attribute Title field and the Create button.
- Enter the title for the new attribute in the Title field. The title can contain a maximum of 14 characters; 10 characters are the maximum recommended for visibility with all screen fonts.
- Click the Create button to define the new attribute.
A newly created attribute is displayed for modules, variables, and functions. To control whether or not it is displayed for modules, variables, or functions, select the Class popup menu in the Attributes dialog, and turn the checkmark on or off.
Renaming an attribute
To rename a created attribute:
- Select it in the Attribute list. The Title field and the Rename button appear.
- Edit the name of the attribute in the Title field.
- Click the Rename button.
Referring to the value of an attribute
Analytica includes the following function for referring to the value of an attribute in a variable’s definition.
Attrib Of x
Returns the value of attribute attrib of object x, where x might be a variable, function, or module. For most attributes, including Identifier, Title, Description, Units, Definition, and user-defined attributes the result is a text value. For Value and Probvalue, the result is the value of the variable (deterministic or probabilistic, respectively). For Inputs, Outputs, and Contains (an attribute of a module), the result is a vector of variables.
You cannot refer to an attribute of a variable by naming the variable in the definition of that variable. Instead, refer to it as Self
, for example:
Variable Boiling_point Units: F Definition: If (Units of Self) = 'C' THEN 100 ELSE 212 Boiling_point → 212
Library
: Special
Example
: Units of Time → 'Years'
Boiling_point
to C, the value of Boiling_point
does not change until Boiling_point
is recomputed for some other reason.
Enable comment auto-refresher