Objects and Their Attributes - Part 2 of 3
Objects may be described by various attributes. Some of these attributes may be specified by the user. These are known as user-specified attributes. For example, when you create a variable, you usually supply four attributes for it: Title, Units, Description, and Definition. The user-specified attributes are summarized below:
The author(s) of a model or another object. By default, this is the computer’s registered user name (on Macintosh, specified in the Sharing Setup control panel).
Brief text used to identify a variable. Titles can be up to 255 characters; however Analytica often truncates them to fit.
One or more lines about what an object represents. Descriptions will help you, and other people who access the model, understand it.
An expression that Analytica uses to compute the value of an object. A definition may be a simple number, an array, a probability distribution or a mathematical Expression that includes other variables. Definitions may be several lines long.
The units of measurement of a variable, e.g., $/yr. You can leave the Units field blank if the variable is a number or a dimensionless ratio.
A test that Analytica conducts on the validity of the value of a variable. A Check attribute is an Expression that contains the variable to be tested. If checking evaluates to False (or 0), Analytica warns you that the value of the variable is questionable. Check attributes are described later in this manual.
An attribute that controls whether a variable will (or won't) be checked for legality according to its Check attribute whenever it is evaluated. Usecheck overrides the system variable Checking for the particular variable to which it is attached.
An attribute that contains a sequence of commands each separated by carriage returns that are executed when the user clicks on the button containing the script.
An attribute that contains help that appears when the mouse is over the object's node in a Diagram window. By default, Analytica uses the Description attribute for an object in Balloon Help. This attribute is available only on the Macintosh.
An attribute that may be defined as a list or list of labels, and function as a Self index for a variable table definition. This attribute is normally set by Analytica, but can be user-specified.
An attribute that may be defined as a list or list of labels, and function as a Self domain for a variable probtable definition. This attribute is normally set by Analytica, but can be user-specified.
In addition to user-specified attributes, there are computed attributes that Analytica adds to objects. Analytica generates the values of computed attributes. Other computed attributes used internally by Analytica are listed in the Appendix.
Date (displays as Created)
The date and time the model was first created.
The last time the model was saved.
The user who last modified a model, if different from the owner of the computer on which the model is created.
A list of variables and functions that appear in the definition of the specified variable or function.
A list of variables and functions that refer to this object in their Definitions.
The deterministic value of a variable.
The probabilistic value of a variable.
The list of variables and other objects created within a model.
The model to which an object belongs.
User Interface Attributes
Many computed attributes are set by the graphical user interface in Analytica, and are called User Interface attributes. User Interface attributes are only represented visually and are usually not examined or modified directly by the user. These attributes range from window state information, to node location, color and font.
An object's node location and node size can be specified using the following attributes:
Nodelocation h, v
Horizontal and vertical coordinates (in Diagram space) of the node representing this object.
Nodesize w, h
Half-width and half-height (in Diagram space) of the node representing this object.
An object’s information can be viewed in a number of windows; hence there are several different attributes used to store window state information, depending on the window type needed. The format of these window state attributes is as follows:
attribute version, left, top, width, height [, attribs]
- version indicates the version of this attribute's format; 1 in the current version of Analytica
- left and top are the top-left screen coordinates of the window
- width and height are the window’s width and height
Additional information regarding node style, diagram style, and result state may follow these values, depending on the attribute.
red, green, blue
Nodecolor red, green, blue
These are Diagram and Node background color attributes, respectively; light gray by default for diagrams, white by default for nodes. Color information is stored as RGB (Red, Green, Blue) components. Each RGB component is an integer value from 0 to 65,535. RGB color is additive, which means that as the value of a component is increased, the amount of that component in the total color decreases. An RGB color is black if all three components are set to 0; white if each component is set to 65,535. A negative value (-32767 to -1) is internally transformed by adding 65536.
Fontstyle fontname, fontsize
Nodefont fontname, fontsize
These are Diagram and Node font attributes, respectively, containing font name and font size. , fontsize is in pixels, not points. These are the same on a 1/72 dots per inch screen. VGA screens are usually 1/96 dots per inch, so an n pixel font size is 72/96 * n points.
(Note, the NodeFont attribute is only used when the NodeInfo attribute setting for UseNodeFont is set to 1.)
Defaultsize width, height
This is the default half-height and half-width for a node, used when creating new nodes in a diagram.
Node icon information is stored as hexadecimal ASCII text. Analytica automatically "compiles" this information into the icon format when an icon is represented on the screen.
Graphsetup contains a sequence of graph system variable assignments separated by carriage returns (and using the "~" continuation character), to be used when creating a graph result of the variable to which it is assigned.
ReformDef [ col, row ]
ReformVal [ col, row ]
These are row/column reform state attributes for Edit Table and Result windows, respectively. col and row, inside brackets specify the index variable for the column and row, respectively.
Numberformat version, formatcode, digits, zeroes, separators, currency Numberformat specifies how a number (result or output node) should be displayed.
- version is the current format version (1.0)
- formatcode has the following values:
code name example D Suffix 1.235K E Expoential 1.235e+4 F Fixed point 12345.68 I Integer 12346 % Percent 1234567.80% DD Date Tue, Oct 19, 1937 DB Boolean True
- digits specifies the number of digits for suffix and exponent formats.
- zeroes specifies the number of digits after the decimal point for fixed point, integer and percent formats.
- separators and currency only apply to fixed point formats; values are 0 (don’t show) or 1 (show).
Specifies an expression to graph against, as an x-y scatter graph. This is used by the Analytica interface.
To see all of the user-specified attributes of an object, you use the Show Command, as illustrated in the transcript below:
Title: miles per year
Description: Annual mileage driven
To see the entire contents of a model (i.e., all of the user-defined objects in the model), you use the Allshow Command. Note that the output from Allshow may be as large as the model file itself.
To see a particular attribute of an object, you type the attribute and the object's identifier, as illustrated below:
miles per year
To see a summary of a variable, including its title, units, and value, you type its identifier. For example, to see a summary of variable Mpy (the entire variable is shown in the preceding example),
mpy Miles per year (miles/year) = 12K
To display the value of a variable, you ask for the Value attribute, as illustrated below:
A discussion of possible values for variables is given elsewhere in this manual.