Network Example

Network Example preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

(This model has yet to be categorized with any tags)
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 627 times • Downloaded 84 times • Run 5 times
Download the 'Network Example' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

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

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

THINGS TO NOTICE

In this particular example, the links are undirected. NetLogo supports directed links too, though.

EXTENDING THE MODEL

Try making it so you can drag the nodes around using the mouse.

Use the turtle variable label to label the nodes and/or links 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 link going in or out.
  • Only connect nodes that are spatially close to each other.
  • Make some nodes into "hubs" (with lots of links).

And so on.

Make two kinds of nodes, differentiated by color, then only allow links 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.)

NETLOGO FEATURES

Nodes and edges are both agents. Nodes are turtles, edges are links.

RELATED MODELS

  • Random Network Example
  • Fully Connected Network Example
  • Preferential Attachment
  • Small Worlds

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

to setup
  clear-all
  set-default-shape turtles "circle"
  crt number-of-nodes [
    set color blue
    set size 2
  ]
  layout-circle turtles (world-width / 2 - 2)
  reset-ticks
end 

;; This procedure demos the creation and deletion of edges.
;; Here we create and delete edges at random, except that
;; we try to keep the total number of links constant.

to go
  if not any? turtles [ stop ]
  ask one-of turtles
    [ create-link-with one-of other turtles ]  ;; if link already exists, nothing happens
  while [count links > number-of-links]
    [ ask one-of links [ die ] ]
  tick
end 


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 12 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky almost 13 years ago Updated version tag Download this version
Uri Wilensky over 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky about 15 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 15 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 15 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 15 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 15 years ago Model from NetLogo distribution Download this version
Uri Wilensky about 15 years ago Network Example Download this version
Uri Wilensky about 15 years ago Network Example Download this version

Attached files

File Type Description Last updated
Network Example.png preview Preview for 'Network Example' over 12 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.