Difference between revisions of "Manage attributes"

m
 
(11 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
<breadcrumbs>Analytica User Guide > Working with Large Models > {{PAGENAME}}</breadcrumbs>  
 
<breadcrumbs>Analytica User Guide > Working with Large Models > {{PAGENAME}}</breadcrumbs>  
 +
{{ReleaseBar}}
  
<nowiki> </nowiki>Each object, such as a variable, module, or function, is a collection of [http://wiki.analytica.com/Attributes attributes]. Some attributes, notably class, identifier, title, and description, apply to all objects of any [http://wiki.analytica.com/Class class]. Others apply only to selected classes. For example, Definition, Inputs, and Outputs apply to Variables and Functions, but not Modules. You can see the Attributes of an object in the [http://wiki.analytica.com/Object_Window Object Window] and in the [http://wiki.analytica.com/Attribute_panel Attribute panel], and edit some of them in Edit mode. This table shows which attributes you can see in these two views for Functions, Modules, and Variables, always, by default, or optionally if you use the Attributes dialog below:
+
Each object, such as a variable, module, or function, is a collection of [[Attributes]]. Some attributes, notably class, identifier, title, and description, apply to all objects of any [[Class]]. Others apply only to selected classes. For example, Definition, Inputs, and Outputs apply to Variables and Functions, but not Modules. You can see the Attributes of an object in the [[Object Window]] and in the [[Attribute panel]], and edit some of them in Edit mode. See [[Attributes]] for a brief explanation of these (and other) attributes.
 +
 
 +
See below to [[#To show optional attributes for an Object]] or the [[#Attributes dialog]] to show or hide them for all objects of a Class:
 +
 
 +
== Attributes by Object Class ==
 +
 
 +
This table shows which attributes you can see in these views, ''always'', marked as <span style="color:#32CD32">'''✓'''</span>, or '''optional''', marked as +. (Blank means the attribute does not apply to that class of objects.)
  
 
:{| class="wikitable"
 
:{| class="wikitable"
Line 12: Line 19:
 
!Function
 
!Function
 
!Module
 
!Module
 +
!
 +
!Notes
 
|-
 
|-
|Class
+
|[[Class]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;<nowiki><span style="color:#32CD32">'''</nowiki><nowiki>'''</nowiki><nowiki></span></nowiki>
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|Classes of object include Decision, Variable, Function, Model, Module, and Attribute itself
 +
|
 
|-
 
|-
|Identifier
+
|[[Identifier]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|The unique name of the object. Up to 20 characters starting with a letter
 +
|
 
|-
 
|-
|Description
+
|[[Description]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|Explains what this object represents
 +
|
 
|-
 
|-
|Title
+
|[[Title]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|Brief text that appears in the objects node in a Diagram
 +
|
 
|-
 
|-
|Definition
+
|[[Definition]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|
 +
|A number, array, or expression from which to compute the value of this variable or function
 
|
 
|
 
|-
 
|-
|Units
+
|[[Units]]
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|
 +
|For example, km/hr, KWh, or Btu
 
|
 
|
 
|-
 
|-
|Help
+
|[[Help]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|If specified, this text appears in balloon when you move the cursor over a node, instead of the Description
 +
|
 
|-
 
|-
|Domain
+
|[[Domain]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|
 
|
 +
|
 +
|The range of numbers or list of numbers or text values valid for this variable.
 
|
 
|
 
|-
 
|-
|''Inputs''
+
|''[[Inputs]]''
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|
 +
|List of variables and functions used in the Definition
 
|
 
|
 
|-
 
|-
|''Outputs''
+
|''[[Outputs]]''
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|
 +
|List of variables and functions that use this variable in their Definitions
 
|
 
|
 
|-
 
|-
|Domain
+
|''[[Value]]''
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|
 
|
 +
|
 +
|The computed mid (deterministic) value of a variable
 
|
 
|
 
|-
 
|-
|''Value''
+
|[[Optimizer_Attributes#Initial_Guess|Initial Guess]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|
 
|
 
|
 
|
 +
|For nonlinear optimization, the solver uses this as the starting value for a Decision when finding its optimal value.
 +
| Optimizer edition, decision nodes
 
|-
 
|-
|''Probvalue''
+
|[[MetaOnly]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|
 
|
 +
|
 +
|Set true for an Index that contains handles to variables which should not be evaluated in this index.
 
|
 
|
 
|-
 
|-
|MetaOnly
+
|[[OnChange]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|
 
|
 
|
 
|
 +
|For a user input, an expression to evaluate when the user changes the definition of the variable.
 +
|Shown in [[Object window]] only for [[User Input nodes|user inputs]].
 
|-
 
|-
|Parameters
+
|[[Script]]
 +
|<nowiki>+</nowiki>
 +
|
 +
|
 +
|For a Button, a script to evaluate when the user clicks the Button.
 +
|Obsolete. Use [[OnClick]] and [[OnChange]] instead.
 +
|-
 +
|[[Parameters]]
 
|
 
|
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|
 +
|The list of parameters of a user-defined Function
 
|
 
|
 
|-
 
|-
|Recursive
+
|[[Recursive]]
 
|
 
|
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|
 +
|Set true if the function can call itself.
 
|
 
|
 
|-
 
|-
|Check
+
|[[Check]]
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|
 +
|Evaluate this expression to check the validity of the value whenever the Variable or Function is evaluated.
 
|
 
|
 
|-
 
|-
|Author
+
|[[Author]]
 
|
 
|
 
|
 
|
|&bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|The name(s) of the person (people) who created this model.
 +
|
 
|-
 
|-
|''Created''
+
|''[[Created]]''
 
|
 
|
 
|
 
|
| &bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|Date this module was created.
 +
|
 
|-
 
|-
|''File Info''
+
|''[[FileInfo|File Info]]''
 
|
 
|
 
|
 
|
| &bull;
+
|<span style="color:#32CD32">'''✓'''</span>
 +
|The name of the file into which this model was last saved.
 +
|
 
|-
 
|-
|''Last Saved''
+
|''[[SaveDate|Last Saved]]''
 +
|
 
|
 
|
 +
|<span style="color:#32CD32">'''✓'''</span>
 +
|The date this model was last saved.
 
|
 
|
|&bull;
 
 
|-
 
|-
 
|User-created (up to 5)
 
|User-created (up to 5)
Line 122: Line 180:
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 
|<nowiki>+</nowiki>
 +
|You can create your own attributes to do what you want.
 +
|
 +
|-
 +
|[[CachingMethod|Caching Method]]
 +
|<nowiki>+</nowiki>
 +
|
 +
|
 +
|Specifies whether the variable should cache its value after computing it, or reclaim the memory for other purposes.
 +
|
 +
|+
 +
|[[AcpStyles]]
 +
| <nowiki>+</nowiki>
 +
| <nowiki>+</nowiki>
 +
| <nowiki>+</nowiki>
 +
|Flags and codes that specify styles and options used by the Analytica Cloud Player.
 +
|
 +
|+
 +
|[[TableCellDefault|Cell Default]]
 +
|<nowiki>+</nowiki>
 +
|
 +
|
 +
|The default value(s) to use in a new cell (row, column, or slice) of an Edit table when one of its Indexes is expanded.
 +
|Does not appear for non-tables
 +
|-
 +
|[[Cell Format Expression]]
 +
|<nowiki>+</nowiki>
 +
|
 +
|
 +
|An expression that computes the format of a table cell -- for example, making negative numbers red.
 +
|[[Analytica 5.0]] or later
 +
|-
 +
|[[EditBoxCueText|Cue Text]]
 +
|<nowiki>+</nowiki>
 +
|
 +
|
 +
|Light gray text that appears in a user input field to prompt on what kind of input is expected.
 +
|[[Analytica 5.0]] or later
 +
|-
 +
|[[ParameterEnumeration|Parameter Enumerations]]
 +
|
 +
|<nowiki>+</nowiki>
 +
|
 +
|List(s) of possible values for function parameters that allow only selected values.
 +
|
 +
|-
 +
|[[TemplateInput|Template Input]]
 +
|
 +
|
 +
|<nowiki>+</nowiki>
 +
|The identifier of a variable in the module used as the default input when you draw an arrow to the module node.
 +
|
 +
|-
 +
|[[TemplateOutput|Template Output]]
 +
|
 +
|
 +
|<nowiki>+</nowiki>
 +
|The identifier of a variable in the module used as the default output  when you draw an arrow from the module node.
 +
|
 
|}
 
|}
  
 
Key:
 
Key:
: plain = editable by user       
+
: plain editable by user       
: ''italic'' = set by Analytica             
+
: ''italic'' set by Analytica             
: &bull; = always displayed
+
: <span style="color:#32CD32">'''✓'''</span> always displayed
: + = optionally displayed
+
: + optionally displayed
  
For descriptions of the attributes, see [[Glossary]].
+
{{Release|6.3||
 +
== To show optional attributes for an Object ==
  
=== Attributes dialog ===
+
By default, the Object view and Attribute panel don't show optional attributes. Here's how to see them (or hide them again) for a given Object -- you must be in [[Edit mode]]:
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]].
+
 
 +
From the [[Object Window]], click the hover icon in the bottom left corner to see the menu to show or hide attributes. Move the mouse in the Object window, to show the button.
 +
 
 +
:[[image:showHideAttributeHoverInObjectWindow.png]]
 +
 
 +
From the Attribute menu in the [[Attribute panel]], chose the '''More ▸''' submenu. You can select which attributes to show or hide from the main Attribute menu:
 +
 
 +
:[[image:showHideAttributeFromAttributePane.png]]
 +
 
 +
In each case, the changes to which attributes are visible applies only to the currently selected object.  If you want to change which attributes appear by default for all objects, see the next section.
 +
}}
 +
 
 +
== Attributes dialog ==
 +
The Attributes dialog lets you select which optional attributes to display the [[Object window]] and [[Attribute panel]] and define new attributes. From the [[Object menu]], select the '''Attributes...''' dialog:
  
 
:[[File:Chapter19_12.png]]
 
:[[File:Chapter19_12.png]]
  
* '''Class: '''Use this menu to select variables, modules, or functions, so you can see and select the '''Attributes''' for that class.
+
* '''Class: '''Use this menu to select variables, modules, or functions, so you can see and select and control the '''Attributes''' for that class.
 +
 
 +
* '''Attribute list: ''' shows the attributes that  may be visible for the selected class. An asterisk (*) identifies attributes that it always displays in the [[Object window]] and [[Attribute panel]]. Other Attributes with a checkmark are displayed optionally
  
* '''Attribute list: '''A list of the attributes optionally visible for the selected class. Attributes with an asterisk (*) are always displayed in the [[Object window]] and [[Attribute panel]]. Other Attributes with a checkmark are displayed optionally
 
 
=== Display optional attributes ===  
 
=== Display optional attributes ===  
 +
 
To display an optional attribute in the [[Object window]] and [[Attribute panel]], click the attribute once to select it, then again to show a checkmark  (√) to indicate it will be shown in these two views.
 
To display an optional attribute in the [[Object window]] and [[Attribute panel]], click the attribute once to select it, then again to show a checkmark  (√) to indicate it will be shown in these two views.
  
To hide an optional attribute, click it once to select it, then again to remove the checkmark.
+
To hide an attribute, click it once to select it, then again to remove the checkmark.
  
 
=== Create new attributes ===  
 
=== Create new attributes ===  
You can create up to five additional attributes. For example, you could use a '''Source''' attribute to include a bibliographic reference or URL for information on which this number or expression of the Variable is based.
 
  
To create a new attribute in the '''Attributes''' dialog:
+
You can create your own "User-Defined Attributes". For example, you could use a '''Source''' attribute to include a bibliographic reference or URL for information on which this number or expression of the Variable is based.
 +
 
 +
To create a new User-Defined Attribute (UDA) in the '''Attributes''' dialog:
 
# Select '''new Attribute''' from the attribute list to show the new ''Attribute Title'' field and the '''Create''' button.
 
# 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.
 
# 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.
 
# 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.
+
By default, it displays a newly created attribute for modules, variables, and functions. You can switch off display for modules, variables, and/or functions, using the [[Class]] popup menu in the '''Attributes '''dialog, and clicking to turn off the checkmark.
  
 
=== Rename an attribute ===  
 
=== Rename an attribute ===  
 +
 
To rename a created 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.
 
# Click the '''Rename''' button.
 
# Click the '''Rename''' button.
 
=== Refer to the value of an attribute ===
 
You can access the value of an Attribute in a definition using this construct:
 
 
===== ''Attrib'' Of x =====
 
Returns the value of attribute «attrib» of object «x», where «x» is a variable, function, module, or other object. 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. See [[Attrib of Obj]]().
 
 
You cannot refer to an attribute of a variable by naming the variable in the definition of that variable because that would create a circular reference. Instead, refer to it as [[Self]], for example:
 
:<code>Variable Boiling_point</code>
 
:<code> Units: F</code>
 
:<code>Definition: If (Units of Self) = 'C'</code>
 
::<code>THEN 100 ELSE 212</code>
 
:<code>Boiling_point &rarr; 212 </code>
 
 
;Library: Special
 
 
;Example: <code>Units of Time &rarr; 'Years'</code>
 
 
<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 <code>C</code>, 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 ==
* [[Attributes]]
+
* [[Attributes]]: Describes all attributes, including obscure inside attributes not usually visible to users,
* [[Attribute panel]]
+
* [[Attribute panel]]: Panel that you can open below a Diagram window to view selected attributes.
 +
* [[Object Window]]: WIndow that shows selected attributes of an Object
 
* [[Objects_and_Their_Attributes_-_Part_1_of_3|Objects and Their Attributes]]
 
* [[Objects_and_Their_Attributes_-_Part_1_of_3|Objects and Their Attributes]]
 
* [[Attrib of Obj]]
 
* [[Attrib of Obj]]

Latest revision as of 19:46, 5 February 2025




Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5


Each object, such as a variable, module, or function, is a collection of Attributes. Some attributes, notably class, identifier, title, and description, apply to all objects of any Class. Others apply only to selected classes. For example, Definition, Inputs, and Outputs apply to Variables and Functions, but not Modules. You can see the Attributes of an object in the Object Window and in the Attribute panel, and edit some of them in Edit mode. See Attributes for a brief explanation of these (and other) attributes.

See below to #To show optional attributes for an Object or the #Attributes dialog to show or hide them for all objects of a Class:

Attributes by Object Class

This table shows which attributes you can see in these views, always, marked as , or optional, marked as +. (Blank means the attribute does not apply to that class of objects.)

Attribute Variable Function Module Notes
Class Classes of object include Decision, Variable, Function, Model, Module, and Attribute itself
Identifier The unique name of the object. Up to 20 characters starting with a letter
Description Explains what this object represents
Title Brief text that appears in the objects node in a Diagram
Definition A number, array, or expression from which to compute the value of this variable or function
Units For example, km/hr, KWh, or Btu
Help + + + If specified, this text appears in balloon when you move the cursor over a node, instead of the Description
Domain + The range of numbers or list of numbers or text values valid for this variable.
Inputs + + List of variables and functions used in the Definition
Outputs + + List of variables and functions that use this variable in their Definitions
Value + The computed mid (deterministic) value of a variable
Initial Guess + For nonlinear optimization, the solver uses this as the starting value for a Decision when finding its optimal value. Optimizer edition, decision nodes
MetaOnly + Set true for an Index that contains handles to variables which should not be evaluated in this index.
OnChange + For a user input, an expression to evaluate when the user changes the definition of the variable. Shown in Object window only for user inputs.
Script + For a Button, a script to evaluate when the user clicks the Button. Obsolete. Use OnClick and OnChange instead.
Parameters + The list of parameters of a user-defined Function
Recursive + Set true if the function can call itself.
Check + + Evaluate this expression to check the validity of the value whenever the Variable or Function is evaluated.
Author The name(s) of the person (people) who created this model.
Created Date this module was created.
File Info The name of the file into which this model was last saved.
Last Saved The date this model was last saved.
User-created (up to 5) + + + You can create your own attributes to do what you want.
Caching Method + Specifies whether the variable should cache its value after computing it, or reclaim the memory for other purposes.
AcpStyles + + + Flags and codes that specify styles and options used by the Analytica Cloud Player.
Cell Default + The default value(s) to use in a new cell (row, column, or slice) of an Edit table when one of its Indexes is expanded. Does not appear for non-tables
Cell Format Expression + An expression that computes the format of a table cell -- for example, making negative numbers red. Analytica 5.0 or later
Cue Text + Light gray text that appears in a user input field to prompt on what kind of input is expected. Analytica 5.0 or later
Parameter Enumerations + List(s) of possible values for function parameters that allow only selected values.
Template Input + The identifier of a variable in the module used as the default input when you draw an arrow to the module node.
Template Output + The identifier of a variable in the module used as the default output when you draw an arrow from the module node.

Key:

plain editable by user
italic set by Analytica
always displayed
+ optionally displayed

To show optional attributes for an Object

By default, the Object view and Attribute panel don't show optional attributes. Here's how to see them (or hide them again) for a given Object -- you must be in Edit mode:

From the Object Window, click the hover icon in the bottom left corner to see the menu to show or hide attributes. Move the mouse in the Object window, to show the button.

ShowHideAttributeHoverInObjectWindow.png

From the Attribute menu in the Attribute panel, chose the More ▸ submenu. You can select which attributes to show or hide from the main Attribute menu:

ShowHideAttributeFromAttributePane.png

In each case, the changes to which attributes are visible applies only to the currently selected object. If you want to change which attributes appear by default for all objects, see the next section.

Attributes dialog

The Attributes dialog lets you select which optional attributes to display the Object window and Attribute panel and define new attributes. From the Object menu, select the Attributes... dialog:

Chapter19 12.png
  • Class: Use this menu to select variables, modules, or functions, so you can see and select and control the Attributes for that class.
  • Attribute list: shows the attributes that may be visible for the selected class. An asterisk (*) identifies attributes that it always displays in the Object window and Attribute panel. Other Attributes with a checkmark are displayed optionally

Display optional attributes

To display an optional attribute in the Object window and Attribute panel, click the attribute once to select it, then again to show a checkmark (√) to indicate it will be shown in these two views.

To hide an attribute, click it once to select it, then again to remove the checkmark.

Create new attributes

You can create your own "User-Defined Attributes". For example, you could use a Source attribute to include a bibliographic reference or URL for information on which this number or expression of the Variable is based.

To create a new User-Defined Attribute (UDA) in the Attributes dialog:

  1. Select new Attribute from the attribute list to show the new Attribute Title field and the Create button.
  2. 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.
  3. Click the Create button to define the new attribute.

By default, it displays a newly created attribute for modules, variables, and functions. You can switch off display for modules, variables, and/or functions, using the Class popup menu in the Attributes dialog, and clicking to turn off the checkmark.

Rename an attribute

To rename a created attribute:

  1. Select it in the Attribute list. The Title field and the Rename button appear.
  2. Edit the name of the attribute in the Title field.
  3. Click the Rename button.

See Also


Comments


You are not allowed to post comments.