exists(b);
The function returns true if at least one element of the Boolean vector b is true. Otherwise, the function returns false.
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)
function exists extends Modelica.Icons.Function; input Boolean b[:] "Boolean vector"; output Boolean result "= true, if at least one element of b is true"; end exists;