Importing Models as Modules

Use the following procedure to import a model as a module within your model.

Note: You can also create a module directly, by building it within a model. For more information, see Creating Modules.

To Import a Model as a Module

  1. If you haven't already done so, add a module variable to your model.
  2. Select the module icon. The Module Properties will appear in the Properties panel.

  3. Click the Import button. The Open File dialog box will open.

  4. Navigate to and then select the model that you want to import as a module.
  5. Click Open.
  6. Use the options on the Module Properties panel to select the properties you want to use for the module. For more information, see Setting Module Properties and Module Properties Tab.
  7. When you're finished setting properties for the module, click , in the lower-right corner of the panel.

You can now navigate into the module by double-clicking the module icon.

To Replace in Imported Module

You can follow steps 2 to 5 above to replace the contents of a module with a model from a file. Connections between the existing module and other modules will be retained in the variable names in the imported module match.

This is a convenient way to allow work to progress separately on a module. The updated module can then be re-imported everywhere it is used (see Agent Based Examples for an explanation of why this is useful).

If you will only use the imported module in a single place, then set the save module as separate file checkbox. Any editing you do in the current model will be saved to that separate file without requiring the module to be imported again. You can only use a module file once in this manner.

Concept Link IconSee Also