World Trait: Difference between revisions
(Marked this version for translation) |
(Marked this version for translation) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
<section begin=image/> | <section begin=image/> | ||
[[File:World trait.png|alt=World trait|thumb]] | [[File:World trait.png|alt=World trait|thumb]] | ||
<section end=image/><p id="tooltip">Returns 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. You can think of this as a “global | <section end=image/><p id="tooltip">Returns 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. You can think of this as a “global variable."</p> | ||
<!--T:9--> | |||
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." | |||
<!--T:8--> | <!--T:8--> | ||
Line 11: | Line 14: | ||
<!--T:2--> | <!--T:2--> | ||
== Usage== | ==Usage== | ||
<code>world trait: [▼]</code> refers to 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 (go to The World tab and click on the show traits button. Then, select “add custom trait”). This can be thought of as a “global variable." | <code>world trait: [▼]</code> refers to 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 (go to The World tab and click on the show traits button. Then, select “add custom trait”). This can be thought of as a “global variable." | ||
Line 17: | Line 20: | ||
<!--T:4--> | <!--T:4--> | ||
[[File:World Trait Nums.png|right|alt=The Create Each Do Block|thumb]] | |||
<!-- <code>world trait: [Dropdown: Trait]</code> --> | <!-- <code>world trait: [Dropdown: Trait]</code> --> | ||
Inputs: | Inputs: | ||
Line 25: | Line 28: | ||
==Common Uses== | ==Common Uses== | ||
This is used to refer to an aspect of a simulation that affects all parts in scope. All traits attributed to The World will happen to all Agents in the simulation. | This is used to refer to an aspect of a simulation that affects all parts in scope. All traits attributed to The World will happen to all Agents in the simulation. | ||
==Example== <!--T:10--> | |||
<!--T:11--> | |||
[[File:world_trait_example.gif|alt=World Trait example gif|thumb]] | |||
[[File:world_trait_example.png|alt=World Trait example code|thumb]] | |||
<!--T:12--> | |||
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. The plants in the simulation react both to the temperature of The World, and the precipitation that falls during winter and spring. The plants shrink and turn brown while the temperature is cold, they grow and turn green when the temperature is warmer. The plants also grow faster when they come in contact with rain, and shrink faster when they come in contact with snow. | |||
==Nuances== <!--T:6--> | ==Nuances== <!--T:6--> |
Latest revision as of 19:07, 11 August 2023
Returns 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. You can think of this as a “global variable."
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."
world trait: [▼]
is a code block part of the Environment drawer.
Usage
world trait: [▼]
refers to 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 (go to The World tab and click on the show traits button. Then, select “add custom trait”). This can be thought of as a “global variable."
Syntax
Inputs:
- a world trait from dropdown menu
Common Uses
This is used to refer to an aspect of a simulation that affects all parts in scope. All traits attributed to The World will happen to all Agents in the simulation.
Example
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. The plants in the simulation react both to the temperature of The World, and the precipitation that falls during winter and spring. The plants shrink and turn brown while the temperature is cold, they grow and turn green when the temperature is warmer. The plants also grow faster when they come in contact with rain, and shrink faster when they come in contact with snow.