Lemonergy · Studio block

Case action router

Routes an integer mode to exactly one configured case flag or the final default flag, without fall-through.

Implementation ID
native-switch-case-actions
Reviewed
2026-10-27

Behavior

Routes an integer mode to exactly one configured case flag or the final default flag, without fall-through. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.

Interface

Case action router interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Case action routerStudio blockin0out0out1out2out3
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input—Case; i32 scalar.
out0output—Case 0; bool scalar.
out1output—Case 1; bool scalar.
out2output—Case 2; bool scalar.
out3output—Default; bool scalar.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample period
sampleTimeS
s1Positive interval between accepted control samples. Outputs hold between these instants.
Minimum 0
Case values
params[0]
—0Distinct 32-bit integers, one for each output; a default output is added.
Case values
params[1]
—1Distinct 32-bit integers, one for each output; a default output is added.
Case values
params[2]
—2Distinct 32-bit integers, one for each output; a default output is added.

Equations and rules

  • case[i] = input = configuredCase[i]
  • default = no configured case matches

Worked example

Case 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 →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Case 0
out0
00—1e-08
Case 1
out1
00—1e-08
Case 2
out2
01—1e-08
Default
out3
00—1e-08

Explore the recorded outputs

Case action router recorded example

Case action router / Case 0
Case action router / Case 0 against timeRecorded synthetic simulation values. Time in seconds; output in —.-0.50-0.250.5010.251.50.52—Time (s)
Case action router / Case 0: 0 — at 0 s

3 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.

Download the recorded samples (JSON) · Open this Studio example after release

Use in a workflow

Case action router worked example

Routes an integer mode to exactly one configured case flag or the final default flag, without fall-through.

  1. Case action router: Routes an integer mode to exactly one configured case flag or the final default flag, without fall-through. 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.
Open Studio example after release

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.
  • 1–31 distinct signed 32-bit cases and one default branch. There is no fall-through.

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.

  1. 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)