Template Modules

A Template Module is a Module that contains TemplateInput and TemplateOutput Attributes that each contain a variable specifying the input and output, respectively, of the Module. This lets you treat the module node much like a variable.

Suppose Module M contains variable Y in its TemplateOutput. When you move your mouse cursor over the node M, it shows a result icon. Click the result icon to see the value of M, which is actually the value of Y. When you draw an arrow from M to another variable or module, it acts as if you are drawing an arrow from Y. It lets you enter Y into the Definition of the destination node.

Similarly, suppose module M contains variable X in its TemplateInput. Drawing an arrow from another variable or module A into the node for M is equivalent to drawing an arrow into X. If the definition of X contains a list in square bracket [], ListOfHandles, Edit table or a function with Repeated parameters, it automatically adds A into the definition of X, as described in Model building by mouse.

If you define a Template Module with a TemplateInput containing a variable with one of these kinds of definition and TemplateOutput, you can create a model by making copies of the template, and linking them together simply by drawing arrows. In this way, you can create a class of Analytica models that are extremely easy to construct and extend simply by copying modules and linking them together. See Model building by mouse for more.

Setting the values

You can set the value of each of these attributes in the Typescript window or in the Attribute pane, but you can't set it in the Object Window. Before you can set it in the Attribute pane, you will need to make the attributes visible from the Module section of the Attributes dialog.


Introduced in Analytica 4.2.

See Also


You are not allowed to post comments.