Difference between revisions of "Using Add Module... to import a Model file"

 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The top-level object in an Analytica (*.ana) file may be a Model object, a Linked Module oblect, or a Linked Library object.  Linked Modules and Linked Libraries are meant to be imported into models and re-used, while a Model is intended to serve as the top-level object.  Model files differ from linked module or linked library files in that in addition to storing the module and contained objects, the Model file also stores system variables (such as [[Time]] and [[SampleSize]]) and preferences.
+
[[Category: Models]]
  
If you use '''Add Module...''' to add a Model file to an existing model, the system variable settings ([[Time]], [[SampleSize]], and preferences) that are in that file are normally read from the file and replace the current settings.
+
An Analytica (<code>*.ana</code>) file may contain a Model, Module, or Library as its top level object. (Any of these objects may, of course, contain subModules.) A Model file, unlike a Linked Module or Library, usually contains settings for various System variables (such as [[Time]] and [[SampleSize]]) and [[Preferences]], set in the Preferences and other dialogs.  
  
In Analytica 4.2.2 and later, you will be asked:
+
When running a Model <code>M1</code> and you use '''Add Module...''' to import a Model file <code>M2</code>, it shows the dialog below (in Analytica 4.2.2 and later). This dialog lets you decide whether you want to retain all the current settings for <code>M1</code> (answer "Yes") or apply any nondefault settings from <code>M2</code> (answer "No").<br>
  
[[image:Add Model as Module.png]]
+
:[[Image:Add Model as Module.png]]  
  
Answering Yes reads in the system variable settings from the imported file, answering no leaves your current system variable settings in tact.
+
''Analytica 4.4'': Answering '''No''' reads in the system variable settings from the imported file, answering '''Yes''' leaves your current system variable settings in tact.  
  
If you are linking (rather than embedding), the model will remember your answer.  However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced.  Also, when linking, the checkbox at the bottom appears, giving you the option of converting the top-level object in the file being linked to a linked module.  Note that this will cause the system variable settings to be lost when the model is saved.
+
''Analytica 4.3 and earlier:'' (Yes and No are the other way around -- '''Yes''' reads in settings from the imported file.
  
In general, if you intend a file to be shared between models, don't use a Model class.  Change the class of the top-level object to LinkModule or LinkLibrary.
+
If you are linking (rather than embedding), the model will remember your answer. However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced. Also, when linking, the checkbox at the bottom appears, giving you the option of converting the top-level object in the file being linked to a linked module. Note that this will cause the system variable settings to be lost when the model is saved.  
  
= See Also =
+
In general, if you intend a file to be shared between models, don't use a Model class. Change the class of the top-level object to LinkModule or LinkLibrary.
  
 +
== See Also  ==
 +
* [[Import a module or library]]
 
* [[Modules and Libraries]]
 
* [[Modules and Libraries]]
 +
* [[Obfuscated and Browse-Only Models]]
 +
* [[Filed modules and libraries]]
 +
* [[Working with Models, Modules, and Files in ADE]]
 +
* [[Combining models into an integrated model]]
 +
* [[Example Models and Libraries]]
 +
* [[Objects and Values]]

Latest revision as of 01:00, 18 February 2016


An Analytica (*.ana) file may contain a Model, Module, or Library as its top level object. (Any of these objects may, of course, contain subModules.) A Model file, unlike a Linked Module or Library, usually contains settings for various System variables (such as Time and SampleSize) and Preferences, set in the Preferences and other dialogs.

When running a Model M1 and you use Add Module... to import a Model file M2, it shows the dialog below (in Analytica 4.2.2 and later). This dialog lets you decide whether you want to retain all the current settings for M1 (answer "Yes") or apply any nondefault settings from M2 (answer "No").

Add Model as Module.png

Analytica 4.4: Answering No reads in the system variable settings from the imported file, answering Yes leaves your current system variable settings in tact.

Analytica 4.3 and earlier: (Yes and No are the other way around -- Yes reads in settings from the imported file.

If you are linking (rather than embedding), the model will remember your answer. However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced. Also, when linking, the checkbox at the bottom appears, giving you the option of converting the top-level object in the file being linked to a linked module. Note that this will cause the system variable settings to be lost when the model is saved.

In general, if you intend a file to be shared between models, don't use a Model class. Change the class of the top-level object to LinkModule or LinkLibrary.

See Also

Comments


You are not allowed to post comments.