Template Modules

Revision as of 01:38, 23 May 2021 by Max (talk | contribs) (Clarified use of Template module and TemplateInput and Output attribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


A Template Module is a Module that contains TemplateInput and TemplateOutput Attributes that contain, respectively a variable specifying the input and output 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<\code> 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.

History

Introduced in Analytica 4.2.

See Also

Comments


You are not allowed to post comments.