NetLogo 7.0.0-beta2:

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