exists function
Requirements.LogicalFunctions.exists
· source
Returns true if at least one element of a Boolean vector is true ('or' of all elements)
Extends Modelica.Icons.Function
Syntax
exists(b);
Description
The function returns true if at least one element of the Boolean vector b is true. Otherwise, the function returns false.
Example
The property is demonstrated with the following example calling the function as:
Boolean atleastOnePumpActive = exists({p.isActive for p in pumps})
results in
![]() | |
| simulation result |
Note, the same result can be achieved with the max(..) built-in operator:
Boolean atleastOnePumpActive2 = max(p.isActive for p in pumps)
Inputs
| Name | Type | Description |
|---|---|---|
b[…] input | Boolean | Boolean vector |
Outputs
| Name | Type | Description |
|---|---|---|
result output | Boolean | = true, if at least one element of b is true |
