NetLogo Help: undirected-link-breed

### undirected-link-breed

#### undirected-link-breed [<link-breeds> <link-breed>]

This keyword, like the globals and breeds keywords, can only be used at the beginning of the Code tab, before any procedure definitions. It defines an undirected link breed. Links of a particular breed are always either all directed or all undirected. The first input defines the name of the agentset associated with the link breed. The second input defines the name of a single member of the breed.

Any link of the given link breed:

- is part of the agentset named by the link breed name
- has its built-in variable `breed` set to that agentset
- is directed or undirected as declared by the keyword

Most often, the agentset is used in conjunction with ask to give commands to only the links of a particular breed.

    undirected-link-breed [streets street]
    undirected-link-breed [highways highway]
    to setup
      clear-all
      crt 2
      ask turtle 0 [ create-street-with turtle 1 ]
      ask turtle 0 [ create-highway-with turtle 1 ]
    end

    ask turtle 0 [ show sort my-links ]
    ;; prints [(street 0 1) (highway 0 1)]

See also breed, directed-link-breed

Take me to the full NetLogo Dictionary