import-world1.0

import-world filename Observer Command

Reads the values of all variables for a model, both built-in and user-defined, including all observer, turtle, and patch variables, from an external file named by the given string. The file should be in the format used by the export-world primitive.

Note that the functionality of this primitive is also directly available from NetLogo's File menu.

When using import-world, to avoid errors, perform these steps in the following order:

  1. Open the model from which you created the export file.
  2. Press the Setup button, to get the model in a state from which it can be run.
  3. Import the file.
  4. Re-open any files that the model had opened with the file-open command.
  5. If you want, press Go button to continue running the model from the point where it left off.

If you wish to import a file from a location other than the model's location, you may include the full path to the file you wish to import. See export-world for an example.

Note: This primitive is not compatible with NetLogo Web. If you wish to import a world with the same code and the same behavior in both NetLogo and NetLogo Web, see import-a:world.

Take me to the full NetLogo Dictionary