NetLogo 7.0.0-beta2:

nw:get-context

nw:get-context

Reports the content of the current graph context as a list containing two agentsets: the agentset of turtles that are part of the context and the agentset of links that are part of the context.

Let’s say we start with a blank slate and the default context consisting of turtles and links, nw:get-context will report a list the special turtles and links breed agentsets:

If we add some turtles and links to our context, we’ll still see the same thing, even though turtles and links have internally grown:

If you had set your context to normal agentsets instead (built with turtle-set, link-set or with) here is what you would see:

If you then create new turtles and links, they are not added to the context because normal agentsets don’t grow (see Special agentsets vs normal agentsets):

But if you construct new agentsets and set the context to them, your new agents will be there:

If you want to see the actual content of your context, it is easy to turn your agentsets into lists that can be nicely displayed. Just use a combination of map and sort:

Finally, you can use nw:get-context to store a context that you eventually want to restore:

Here is the result:

Take me to the full Networks Extension Dictionary