Lemonergy · Studio block
Exclusive action merge
Accepts one explicitly active branch at a sample, holds its prior value when none is active, and rejects competing writers.
- Implementation ID
native-exclusive-merge- Reviewed
- 2026-10-27
Behavior
Accepts one explicitly active branch at a sample, holds its prior value when none is active, and rejects competing writers. Trial evaluations read the held output without mutating state.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | — | Branch 1 value; real scalar. |
in1 | input | — | Branch 2 value; real scalar. |
in2 | input | — | Branch 1 active; bool scalar. |
in3 | input | — | Branch 2 active; bool scalar. |
out0 | output | — | Merged value; real scalar. |
out1 | output | — | Accepted branch (0 means held); u32 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 period between accepted updates; outputs hold between updates. |
Initial held outputtables[0] | — | [0] | Output held before the first accepted update, with one value per output lane. |
Branch countparams[0] | — | 2 | Number of data branches and matching Boolean ownership flags. Minimum 2; Maximum 16 |
Equations and rules
Exactly one active branch i: held value ← branch[i]; accepted branch ← i + 1No active branch: retain held value; accepted branch ← 0More than one active branch: reject the sample without committing state
Worked example
Exclusive action merge worked example
Branch values are 2 and 5. Only branch 2 is active, so the accepted value is 5 and its owner index is 2.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Merged valueout0 | 0 | 5 | — | 1e-08 |
Accepted branch (0 means held)out1 | 0 | 2 | — | 1e-08 |
Explore the recorded outputs
Exclusive action merge recorded example
Exclusive action merge / Merged value3 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
Exclusive action merge worked example
Accepts one explicitly active branch at a sample, holds its prior value when none is active, and rejects competing writers.
- Exclusive action merge: Accepts one explicitly active branch at a sample, holds its prior value when none is active, and rejects competing writers. Trial evaluations read the held output without mutating state.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- 2–16 explicitly declared, identically typed branches. Boolean action flags supply ownership; ownership is not inferred from an arbitrary source subsystem.
- All inputs are validated even when inactive. Branches should share the declared sample clock. A conflict stops the run instead of choosing a writer by connection order.
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.
- Statecharts: A visual formalism for complex systems
David Harel · Science of Computer Programming, 8(3), 231–274 · 1987
Technical reference · Background on explicit states and events. Lemonergy bounded control blocks are not a complete Statecharts 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)