LIBRARY
Math.IntegerToBoolean
Convert Integer to Boolean signal.
This block computes the Boolean output y from the Integer input u by the equation:
y = u ≥ thresholdwhere threshold is a parameter.
This component extends from BlockComponents.Interfaces.PartialBooleanSO
Usage
BlockComponents.Math.IntegerToBoolean(threshold=1)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
threshold | Output signal y is true, if input u >= threshold | – | 1 |
Connectors
y- This connector represents a boolean signal as an output from a component (BooleanOutput)u- This connector represents an integer signal as an input to a component (IntegerInput)
Behavior
Source
dyad
"""
Convert Integer to Boolean signal.
This block computes the Boolean output `y` from the Integer input `u` by the equation:
```
y = u ≥ threshold
```
where `threshold` is a parameter.
"""
component IntegerToBoolean
extends BlockComponents.Interfaces.PartialBooleanSO
"Connector of Integer input signal"
u = IntegerInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Output signal y is true, if input u >= threshold"
parameter threshold::Integer = 1
relations
y = u >= threshold
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/IntegerToBoolean.svg"}
}
}
endFlattened Source
dyad
"""
Convert Integer to Boolean signal.
This block computes the Boolean output `y` from the Integer input `u` by the equation:
```
y = u ≥ threshold
```
where `threshold` is a parameter.
"""
component IntegerToBoolean
"Connector of Boolean output signal"
y = BooleanOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Connector of Integer input signal"
u = IntegerInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Output signal y is true, if input u >= threshold"
parameter threshold::Integer = 1
relations
y = u >= threshold
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/IntegerToBoolean.svg"}
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses
Tests