Appendix A - Part 1 of 3
This Appendix provides language summary for the Analytica Script.
In the following descriptions, the name of each Analytica object is in Bold face, and Analytica concepts or terms without corresponding objects are in italic. Optional parameters are enclosed in [ ...]. In general, if you omit the main parameter of a command, Analytica will assume you mean the current object (i.e., the last object explicitly mentioned). If you omit the last parameter of a function such as Sum, Min, or Max, whose second parameter is an optional index specifying the dimension of a multi-dimensional array over which to perform the operation, Analytica will assume the outermost dimension.
Attributes fall under the following categories:
- User-specified attributes - attributes that can be created and/or modified by the user. You assign a value v to an attribute a of object o with the following syntax: a o: v. In general, to display an attribute of a particular object you use the syntax a o.
- Computed attributes - attributes that are computed by Analytica.
- User Interface attributes - attributes that are set by visual manipulation in the Analytica user interface.
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.
When you create a new mathematical Function, you may specify a list of parameters for each Function. User-defined functions are described in the Analytica Reference.
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 only available 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.
The data the model was 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
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.
Nodeinfo version, showinputs, showoutputs, showlabel, showborder, fill, usenodefont, formwidth, showbevel, showformicon Controls display options for a node, including arrows, node border, label and so on.
- version indicates the version of this attribute's format; 1 in the current version of Analytica
- showinputs, showoutputs, showlabel, showborder, fill, usenodefont, showbevel and showformicon have values of 0 (for off) or 1 (for on). Showformicon only applies to output nodes.
- formwidth specifies the width of an input node’s or output node’s field (0 is the default, which means the actual width will be computed based on the font size).
DiagramColor 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 n pixels fontsize is 72/96 * n dots per inch.
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 commands 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]
Reformdval [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).
FileInfo alias, class object, importSysVars, platformID, pathID, isXml, pathname Information about a file's location on a disk.
- alias refers to a Macintosh File alias (type ‘alis’) resource ID, or 0 if none is specified. If a non-zero value is specified and the resource exists, Analytica uses the Alias manager to resolve the location of the file and ignores the additional information in this attribute. If a zero value is specified or if the resource doesn't exist, Analytica uses the additional information stored in this attribute to locate the file. On Windows, alias should always be 0.
- class and object are this object's class and identifier, respectively, used to check consistency.
- importSysVars: 2=import system variables, 3=ignore incoming sys vars when adding as a module.
- platformID represents the platform the fileinfo is saved on, and may have the following values:
value platform 1 Macintosh (HFS) 2 Windows
- pathID is used by the MacOS at runtime to identify a working directory for the file. Not used by Windows.
- isXml: 1=Save in XML format. 0 or omitted = saved in standard typescript format.
- pathname is a path name which is relative to the including file.
Enable comment auto-refresher