Skip to main content

Not

Negates the input. So, if the expression evaluates to true, then returns false. If the expression evaluates to false, then returns true.

Not block

Description

The Not block negates the input. So, if the expression evaluates to true, then returns false. If the expression evaluates to false, then returns true. This is a code block from the Logic drawer.

Usage

Negates the input. So, if the expression evaluates to true, then returns false. If the expression evaluates to false, then returns true.

Syntax

Inputs in this block:

  • A comparative statement block (= statements, > statements, not statement, and/or statements)

Example

This is a model of mosquitoes spreading malaria through a population of adults and children. A small portion of the population has sickle cell anemia which reduces the agent's susceptibility to malaria. When the custom trait 'sickle cell anemia' or 'malaria' equals 1, the agent has the disease. When the malaria trait is set to 0, the agent does not have malaria. The not block allows the code to isolate the agents without sickle cell anemia.

Not example code
  • And - Returns true if both inputs are true
  • Or - Returns true if at least one input is true