Set World To

From StarLogo Nova Wiki
Other languages:
The set world to block

Sets the value of a selected world trait. World traits can be created by adding a new trait to the World breed in the breed manager.

To add a new trait to the World breed, go to The World tab and click on the show traits button. Then, select “add custom trait.”

set world [▼] to [_] is a code block part of the Environment drawer.

Usage

set world [▼] to [_] is used to set traits of the world in a similar way to agents.

Syntax

The Create Each Do Block

Inputs:

  1. a world trait from the dropdown menu
  2. a number

Example

Set World To example code

The model above is of plant growth throughout the four seasons. The World trait temperature depends on the season. All of the seasons have different temperature ranges, using the ‘set to’ block to set a random temperature in that range. The plants in the simulation react both to the temperature of The World, and the precipitation that falls during winter and spring.

Nuances

This block is used to soley modify custom traits of the world. The traits of agents are modified using the set my [▼] to [_].

Related Blocks