Nearest Within Steps With =: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(Marked this version for translation)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<translate>
<!--T:1-->
[[Category:Detection]]
[[Category:Detection]]
[[Category:Code Block]]
[[Category:Code Block]]
<section begin=image/>[[File:Nearest within steps with =.png|alt=Nearest within steps with =|thumb]]<section end=image/>
<section begin=image/>[[File:Nearest within steps with =.png|alt=Nearest within steps with =|thumb]]<section end=image/><p id="tooltip">Returns the closest agent of a selected breed in a given radius with a specific trait.</p>
 
<!--T:9-->
<section begin="name" />'''<code>nearest [▼] within [_] steps with [▼] = [_]</code>'''<section end="name" /> is a [[code block]] part of the [[Detection]] drawer.
<section begin="name" />'''<code>nearest [▼] within [_] steps with [▼] = [_]</code>'''<section end="name" /> is a [[code block]] part of the [[Detection]] drawer.


== Usage==
<!--T:2-->
<p id="tooltip"><code>nearest [▼] within [_] steps with [▼] = [_]</code> is used to refer to the nearest [[agent]] of a selected breed AND trait that exists within a given [[step]] limit in [[Spaceland]].</p>
==Usage==
<code>nearest [▼] within [_] steps with [▼] = [_]</code> is used to refer to the nearest [[agent]] of a selected breed AND trait that exists within a given [[step]] limit in [[Spaceland]].
 
==Syntax== <!--T:3-->
 
<!--T:4-->
[[File:Nearest Within Steps With Eq.png|right|alt=Nearest Within Steps With = |thumb]]
<!-- <code>nearest [Dropdown: Type of Agent](s) within [Textbox: Number] steps with [Dropdown: Type of Trait](s) = [Textbox: Text]</code> -->
Inputs:
#a breed from the first dropdown menu
#a number
 
==Example== <!--T:10-->


===Syntax===
<!--T:11-->
[[File:nearest_within_steps_with_example.gif|alt=Nearest Within Steps With = example gif|thumb]]
[[File:nearest_within_steps_with_example.png|alt=Nearest Within Steps With = example code|thumb]]


<code>nearest [Dropdown: Type of Agent](s) within [Textbox: Number] steps with [Dropdown: Type of Trait](s) = [Textbox: Text]</code>
<!--T:12-->
This is a model of a grazing herd of hungry elephants.  In this model, there are two species of grass (blue and red).  The elephants prefer blue glass but do not mind red grass.  Because the elephants want to eat as much bue grass as possible, they walk toward the blue grass that is closest to them within their sensing radius (while eating red grass if they happen across it on the way).  Toward the end of the simulation, you can observe that there is plenty of leftover red grass.


==Common Uses==
==Common Uses== <!--T:5-->


==Nuances==
==Nuances== <!--T:6-->


<!--T:7-->
==Related Blocks==
==Related Blocks==
*<code>[[Nearest Within Steps|nearest [▼] within [_] steps]]</code>
*<code>[[Nearest Within Steps|nearest [▼] within [_] steps]]</code>
</translate>

Latest revision as of 18:37, 11 August 2023

Other languages:
Nearest within steps with =

Returns the closest agent of a selected breed in a given radius with a specific trait.

nearest [▼] within [_] steps with [▼] = [_] is a code block part of the Detection drawer.

Usage

nearest [▼] within [_] steps with [▼] = [_] is used to refer to the nearest agent of a selected breed AND trait that exists within a given step limit in Spaceland.

Syntax

Nearest Within Steps With =

Inputs:

  1. a breed from the first dropdown menu
  2. a number

Example

Nearest Within Steps With = example gif
Nearest Within Steps With = example code

This is a model of a grazing herd of hungry elephants. In this model, there are two species of grass (blue and red). The elephants prefer blue glass but do not mind red grass. Because the elephants want to eat as much bue grass as possible, they walk toward the blue grass that is closest to them within their sensing radius (while eating red grass if they happen across it on the way). Toward the end of the simulation, you can observe that there is plenty of leftover red grass.

Common Uses

Nuances

Related Blocks