Objects and Their Attributes - Part 1 of 3

Revision as of 05:40, 19 June 2007 by Fredbrunt (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Objects and Their Attributes

The entities known to Analytica, such as commands, models, and variables, are called Objects. Each object has a unique Identifier, and a set of properties known as Attributes. For example, many objects have Title, Units, and Description attributes. Every object belongs to a general category, called a Class. Object classes include variables, functions, and models (among others).

Creating New Objects

You can create new objects of the following base classes: variable, Function, attribute, and model. Some classes form a hierarchy. There are additional variable and model classes. The usual way to create a new object is to specify the Object class, followed by a unique identifier. For example, in the Typescript window:

Example>variable life  
  • Note :Analytica will not be able to evaluate variables in the
model until it understands the definitions of all of the objects it contains.

When creating a new object, you should also specify the following user-specified attributes by default:

Variable Title, Units, Description, Definition. Module Title, Description, Author. Attribute Title, Description. Function Title, Description, Definition, Parameters. Button Title, Description, Script.

Attributes That are Longer Than One Line

User-specified attributes may be longer than one line. To continue a Definition, Description, or other attribute over several lines, you place a tilde (“~”) or continuation character (option-L, “¬”) at the end of each line to be continued (Analytica will finish the Description or Definition when it receives a line that does not end with a tilde). Analytica will also allow you to continue an attribute over several lines if you leave an open parenthesis on the first line of the attribute. When you close the parentheses, Analytica will assume that you have finished typing in the attribute. s Note When entering attributes using the Analytica user interface (the Object window, Diagram window etc.), you do not need to specify a continuation character. In ADE, it is best to build a large string, and then pass that string directly to the Command property, without using the continuation characters. For example, s = “very long string…..” Ana.Command = “title: “ & s Ana.Send

Object classes

There are many different Object classes in Analytica, providing important elements of the modeling language. The following are the primary Object classes: Alias An object that represents a variable in a model other than the model containing the variable. Attribute A property of an object. Command An instruction from you to Analytica. Function A user-defined mathematical function that computes a value from its parameters. Keyword Words used in certain commands and expressions. For example, keywords are used in logical operators and in user-defined functions. Module An object that contains a set of variables and other user-defined objects. Sysfunction A standard built-in function, such as Sine (Sin), Standard Deviation (SDeviation), etc. Sysvar A pre-defined variable that controls the way Analytica formats information or executes certain commands. Variable An element of a model that can have a value. Of the Object classes listed above, you can create variables, models, functions, aliases, and attributes. In addition, you can create more specific variable classes: Chance, Decision, Objective, Index, and Determ. You can create more specific model classes: Model, Version, Library, Linkmodule, and Linklibrary. Objects of the remaining Object classes are created by Analytica.

Class Hierarchy

Analytica provides a hierarchy of object classes. Some object classes inherit functionality from other object classes (that is, they are similar, with a few important differences).



Identifiers of Objects

The entities that Analytica recognizes are known as objects. If you create an object, its identifier can be up to 20 characters long (any characters beyond the 20th will be ignored). The first character must be a letter. The rest may be letters, digits, underscores (“_”), or periods (“.”). Analytica treats upper and lower case letters as equivalent (e.g., it is case-insensitive). The following are all legal identifiers: a, Alpha1, OOOOO, B.B.C., X12345678901, net_value

s Note You may not include any other special characters, including spaces, in an identifier. You can type the command “List” for a list of all predefined identifiers. However, this is a very long list. See the User Guide Appendix for a list of all predefined identifiers. Abbreviations of Identifiers

Analytica permits abbreviation of identifiers in many, but not all, cases. You can abbreviate the identifier of an object when you type it at the prompt (“>“). If your abbreviation is ambiguous, Analytica will report an error and will not execute the command. In such cases, you must type the full identifier of the object. For example: Fishinapond>sh Syntax error:

?The Identifier 'Sh' is ambiguous. Choose one of: Show Showhier Showkey Showundef

You cannot abbreviate identifiers of variables or other objects when you put them in the Definition of another object.

Comments


You are not allowed to post comments.