Less Than Or Equal To/es: Difference between revisions

From StarLogo Nova Wiki
(Created page with "Category:Lógica Category:Code Block")
 
(Updating to match new version of source page)
 
(2 intermediate revisions by the same user not shown)
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">
<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:if_else_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>


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

Latest revision as of 18:24, 16 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

Less Than Or Equal To example gif
Less Than Or Equal To example code

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