O

From StarLogo Nova Wiki
Revision as of 17:01, 14 August 2023 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
The Or Block

Usage

Determines if either the first or second input are true. If at least one is true then returns true; else returns false.

Syntax

Inputs in this block:

  1. a comparative statement block (= statements, > statements, not statement, and/or statements)
  2. another comparative statement block

Example

In this epidemic model, the trait ‘Had disease’ was created to keep track of all of the agents who had contracted the disease at some point. These agents were tracked on the line graph in purple. The ‘or’ block was used in the if statement so that agents with the color red or the color blue could be specified.

Note: Because the ‘or’ block has a round peg and the ‘count within’ block used for the line graph only takes inputs with a square peg, it is impossible to simply count agents with ‘color red or blue’ for the line graph. This is why the trait ‘Had disease?’ was created. Now the line graph ‘contracted disease’ series counts agents within 200 steps with ‘Had disease?’ = 1.