Lemonergy · Studio block
Comparison action router
Produces exactly one below/equal/above action flag for a configured threshold at each sample.
- Implementation ID
native-if-actions- Reviewed
- 2026-10-27
Behavior
Produces exactly one below/equal/above action flag for a configured threshold at each sample. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | — | Value; real scalar. |
out0 | output | — | Below; bool scalar. |
out1 | output | — | Equal; bool scalar. |
out2 | output | — | Above; bool scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample periodsampleTimeS | s | 1 | Positive interval between accepted control samples. Outputs hold between these instants. Minimum 0 |
Comparison thresholdparams[0] | — | 0 | Configured comparison or case value. |
Equations and rules
below = input < threshold; equal = input = threshold; above = input > threshold
Worked example
Comparison action router worked example
Default editable example at the first accepted sample (t = 0 s). The output checks below are execution oracles for this example.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Belowout0 | 0 | 1 | — | 1e-08 |
Equalout1 | 0 | 0 | — | 1e-08 |
Aboveout2 | 0 | 0 | — | 1e-08 |
Explore the recorded outputs
Comparison action router recorded example
Comparison action router / Below3 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
Download the recorded samples (JSON) · Open this Studio example after release
Use in a workflow
Comparison action router worked example
Produces exactly one below/equal/above action flag for a configured threshold at each sample.
- Comparison action router: Produces exactly one below/equal/above action flag for a configured threshold at each sample. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Control executes on an explicit sampled clock. Continuous states, history/delay kernels, residual equations, and event-source children are not supported.
- One real threshold with below/equal/above branches; arbitrary logical expression parsing is not supplied.
Scientific and mathematical references
These sources explain the scientific and mathematical background. The behavior, interface and limits above define the Lemonergy implementation; a citation does not imply every model option in the source is implemented.
- Synchronous Data Flow
Edward A. Lee, David G. Messerschmitt · Proceedings of the IEEE, 75(9), 1235–1245 · 1987
Technical reference · Background on actor firing and explicit dataflow. The sampled conditional semantics documented here are Lemonergy design choices, not a claim of a complete SDF implementation.
Implementation sources
This reference follows the public interface and locally verified numerical checks for an upcoming release.
Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27
docs/glossary/native-block-verification.json
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)