Less Than: Difference between revisions

From StarLogo Nova Wiki
(Marked this version for translation)
(updates from Blockument)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<section begin="image"/>[[File:less_than.png|alt=The Less Than Block|thumb]]<section end="image"/>
==Usage==


<!--T:2-->
<!--T:2-->
<p id="tooltip">Determines if the first input is less than the second input and returns true or false.</p>
<p id="tooltip">Determines if the first input is less than the second input and returns true or false.</p>
==Syntax==
Inputs in this block:
#a number
#a number
==Example==
[[File:less_than_example.gif|alt=Less Than example gif|thumb]]
[[File:less_than_example.png|alt=Less Than example code|thumb]]
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 [[Special:MyLanguage/If Else|if else]] 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.


<!--T:1-->
<!--T:1-->

Revision as of 15:15, 14 August 2023

Other languages:
The Less Than Block

Usage

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

Syntax

Inputs in this block:

  1. a number
  2. a number

Example

Less Than 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 if else 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.