Home
Learn NetLogo
What is NetLogo? Tutorial #0 Sample Model Tutorial #1 Models Tutorial #2 Commands Tutorial #3 Procedures
Documentation
NetLogo Dictionary Interface Guide Interface Tab Guide Info Tab Guide Code Tab Guide Programming Guide Transition Guide Preferences Guide Version History
Advanced Tools
Extension Manager Shapes Editor BehaviorSpace System Dynamics HubNet HubNet Authoring Logging Controlling Mathematica Link NetLogo 3D Cluster Computing (HPC)
Extensions
Extensions Guide Arduino Array Bitmap CSV GIS GoGo LevelSpace Matrix Networks Palette Profiler Python Resource Rnd Sound Simple R Table Time Vid View2.5D
FAQ
Home
Learn NetLogo
What is NetLogo? Tutorial #0 Sample Model Tutorial #1 Models Tutorial #2 Commands Tutorial #3 Procedures
Documentation
NetLogo Dictionary Interface Guide Interface Tab Guide Info Tab Guide Code Tab Guide Programming Guide Transition Guide Preferences Guide Version History
Advanced Tools
Extension Manager Shapes Editor BehaviorSpace System Dynamics HubNet HubNet Authoring Logging Controlling Mathematica Link NetLogo 3D Cluster Computing (HPC)
Extensions
Extensions Guide Arduino Array Bitmap CSV GIS GoGo LevelSpace Matrix Networks Palette Profiler Python Resource Rnd Sound Simple R Table Time Vid View2.5D
FAQ
primitive: nw:save
Networks Extension Dictionary
  • No items found

nw:save

nw:save file-name

Filetype specific variants:

  • nw:save-dl
  • nw:save-gdf
  • nw:save-gexf
  • nw:save-gml
  • nw:save-vna

Export the network context in the given format to the given file. Turtle and link attributes will be exported to formats that support node and edge properties.

Limitations:

  • x and y (not xcor and ycor) can only be numbers. x and y are commonly used in formats pertaining to position and behind the scenes NW uses Gephi’s libraries for exporting. Furthermore, x and y will be added even if they didn’t exist in the model. Again, this is because NW uses Gephi’s libraries which assume that nodes have positions stored in x and y. If you wish to export to Gephi specifically, we recommend creating x and y turtles variables and setting them to xcor and ycor before export.
  • Color will be exported in a standard RGB format. This should hopefully increase compatibility with other programs.
  • Turtle and link variables that contain values of different types will be stored as strings. Unfortunately, most network formats require that node and attributes have a single type.
  • Many programs use label to store the id of nodes. Thus, if you’re having trouble importing data exported from NetLogo into another program, you might try setting turtles’ labels to their who number.
  • Multigraphs are not supported. Thus, two turtles can share at most one link. nw:save-graphml does support multigraphs, so use that if turtles can have more than one type of link connecting them.

nw:save determines the file-type of the given file based on the extension and calls the corresponding save-* primitive on it. Note that GraphML must be exported with nw:save-graphml.

Take me to the full Networks Extension Dictionary.

Networks Extension Dictionary: path-to

Documentation for the path-to primitive.

Networks Extension Dictionary: save-graphml

Documentation for the save-graphml primitive.


NetLogo is a programmable modeling environment for simulating natural and social phenomena. It was authored by Uri Wilensky in 1999 and has been in continuous development ever since at the Center for Connected Learning and Computer-Based Modeling.

Related Links
  • NetLogo Home
  • CCL Home
  • NetLogo Web
  • NetTango Web
  • NetLogo 3D
  • BehaviorSearch
  • Contact Us

Copyright © 1999-2025 Uri Wilensky and the Center for Connected Learning and Computer-Based Modeling at Northwestern University . All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License , or (at your option) any later version.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at netlogo-commercial-admin@ccl.northwestern.edu .

For more information, visit the NetLogo website .