Less Than Or Equal To/es: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>
<div lang="en" dir="ltr" class="mw-content-ltr">
<section begin="image"/>[[File:less_than_or_equal_to.png|alt=The Less Than Or Equal To Block|thumb]]<section end="image"/>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Usage==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
<p id="tooltip">Determines if the first input is less than or equal to the second input and returns true or false.</p>
<p id="tooltip">Determines if the first input is less than or equal to the second input and returns true or false.</p>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Syntax==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Inputs in this block:
#a number
#a number
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Example==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:less_than_or_equal_to_example.gif|alt=Less Than Or Equal To example gif|thumb]]
[[File:less_than_or_equal_to_example.png|alt=Less Than Or Equal To example code|thumb]]
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
This is a model of a hungry frog attempting to catch two different types of fly. While ‘fly around’ is toggled, the frog moves toward the closest fly. The fly detects whether the frog is nearby and will move in the opposite direction. The <= block is used to determine the speed of each fly based on the size of each agent. In this case, large flies are fast, whereas small flies are slow. It can be seen from the line graph that the population of the larger, faster flies decreases more slowly than the smaller, slower flies.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Related Blocks==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
*[[Special:MyLanguage/Greater Than Or Equal To|>=]]
</div>
</div>


[[Category:Lógica]]
[[Category:Lógica]]
[[Category:Code Block]]
[[Category:Code Block]]

Revision as of 16:00, 14 August 2023

Other languages:
The Less Than Or Equal To Block

Determines if the first input is less than or equal to the second input and returns true or false.

Syntax

Inputs in this block:

  1. a number
  2. a number

Example

This is a model of a hungry frog attempting to catch two different types of fly. While ‘fly around’ is toggled, the frog moves toward the closest fly. The fly detects whether the frog is nearby and will move in the opposite direction. The <= block is used to determine the speed of each fly based on the size of each agent. In this case, large flies are fast, whereas small flies are slow. It can be seen from the line graph that the population of the larger, faster flies decreases more slowly than the smaller, slower flies.

Related Blocks