Nearest Within Steps/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 21: | Line 21: | ||
[[File:nearest_within_steps_example.gif|alt=Nearest Within Steps example gif|thumb]] | [[File:nearest_within_steps_example.gif|alt=Nearest Within Steps example gif|thumb]] | ||
[[File: | [[File:face_towards_example.png|alt=Nearest Within Steps example code|thumb]] | ||
This is a model of a grazing herd of elephants. Because the elephants want to acquire the most food possible, they walk toward the grass that is closest to them within their sensing radius (30 steps). | This is a model of a grazing herd of elephants. Because the elephants want to acquire the most food possible, they walk toward the grass that is closest to them within their sensing radius (30 steps). |
Latest revision as of 15:37, 16 August 2023
Returns the closest agent of a selected breed in a given radius.
nearest [▼] within [_] steps
is a code block part of the Detection drawer.
Usage
nearest [▼] within [_] steps
is used to refer to the nearest agent of a selected breed that exists within a given step limit in Spaceland.
Syntax
Inputs in this block:
- a breed from the dropdown menu
- a number
Example
This is a model of a grazing herd of elephants. Because the elephants want to acquire the most food possible, they walk toward the grass that is closest to them within their sensing radius (30 steps).