connectorRiskBus

collects pharmacogene risk contributions; sizes itself from the connections

Information

Every pharmacogene component that can flag a risk carries one of these, and Modifiers.RiskSummary carries one too. Connect them all together and the summary reports how many are flagged, with NOTHING to keep in step by hand.

Why a flow variable, and why not literally an expandable connector

An expandable connector is the obvious first choice for a self-sizing bus, but it cannot do this job twice over: Modelica forbids the flow prefix inside one, and there is no way to iterate its members, so routing Booleans through it would never aggregate to "is any of these true".

A flow variable on a plain connector aggregates by construction, because Modelica requires the flow variables of a connection set to sum to zero. Each source contributes its own count as a negative flow and the one unassigned port is left holding the positive total, so the bus sizes itself from whatever is connected and the nu parameter that the vector-input version made every model maintain by hand disappears.

level exists to balance the connector — Modelica requires as many potential as flow variables — and carries something useful rather than a dummy: RiskSummary drives it to 1 when the set is flagged, so a component may read the aggregate verdict back off the bus.

Components

TypeNameDefaultDescription
Reallevelpotential: 1 when the set is flagged, 0 otherwise (driven by RiskSummary)
RealnRisknumber of flagged risk sources — contributions sum at the connection