Home
Help
Resources
Extensions
FAQ
NetLogo Publications
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

## NetLogo Models Library:3D/Code Examples

 Note: If you download the NetLogo application, every model in the Models Library is included.

## WHAT IS IT?

This is a 3D version of the 2D model Network Example. The only significant difference from the 2D code is that we spread the nodes around the world in 3D space.

This example demonstrates how to make a network in NetLogo. The network consists of a collection of nodes, some of which are connected by edges.

This example doesn't do anything in particular with the nodes and edges. You can use it as the basis for your own model that actually does something with them.

## EXTENDING THE MODEL

Position the nodes in a circle, instead of randomly.

Use the turtle variable `label` to label the nodes and/or edges with some information.

Try calculating some statistics about the network that forms, for example the average degree.

Try other rules for connecting nodes besides totally randomly. For example, you could: - Connect every node to every other node. - Make sure each node has at least one edge going in or out. - Only connect nodes that are spatially close to each other. - Make some nodes into "hubs" (with lots of edges). And so on.

Make two kinds of nodes, differentiated by color, then only allow edges to connect two nodes that are different colors. This makes the network "bipartite." (You might position the two kinds of nodes in two straight lines.)

## RELATED MODELS

Network Example

Owen Densmore's "Layout" model, available from the NetLogo User Community Models web page (http://ccl.northwestern.edu/netlogo/models/community/), shows how to make the nodes and edges automatically reposition themselves into a pleasing-looking layout. It also shows how to generate a network with "hubs", where the distribution of the number of edges the nodes have follows a power law.