layout-circle

 

layout-circle is a primitive that moves a set of turtles into an evenly spaced circle of a given radius. For example:

create-turtles 100 [
    set shape "person"
]
layout-circle turtles 10

Things to keep in mind when using layout-circle:

The model example below demonstrates how layout-circle works. It has two setup buttons: one to create an empty model and another to create a model with 10 houses at random places. When the go button is clicked, we create a new house at each tick if there are less than 10 houses (i.e. if we used the setup-empty button). Then, we use layout-turtle to organize our neighborhood. This model also includes a variable radius and increments it at each tick to show how layout-turtle works for different radius values.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the layout-circle primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Published NetLogo models that use the layout-circle primitive:
 
 
Similar primitives:
links

Reports an agentset that contains all the links in a model.

Read more
create-links-with

Creates links with every agent in an agentset.

Read more
setxy

Moves a turtle to the exact location defined by the provided x and y coordinates.

Read more
move-to

Moves a turtle to set its x and y coordinates to be the same as another turtle or patch.

Read more
 
Learn another primitive: