The World

From StarLogo Nova Wiki
Other languages:


The world

Returns an agent (data type) that represents The World. Can be used as a location to mean the center of spaceland (0,0).

The World is a code block part of the Environment drawer.

Usage

The World refers to an agent that represents The World. Can be used as a location to mean the center of SpaceLand, which is (0,0).

Syntax

[Textbox Insert] The World

Common Uses

Useful for simulations that require recursion, or agents that can act as the base case.

Example

The World example gif
The World example code

The model above shows two different types of elephants living in the same environment. ‘Hungry elephants’ prioritize eating more grass higher than ‘elephant’ agents do. All elephants must eat grass in order to survive and reproduce. At the end of the simulation, if you wish to see how many elephants of each type that were in the first generation are still alive, you can push the ‘Highlight First Generation’ button, which turns all ‘elephants’ that were in the first generation magenta and all ‘hungry elephants’ that were in the first generation yellow.

Nuances

Related Blocks