SimulationGraph is a directed acyclic graph of component instances connected by typed ports. Hardwave validates wiring at construction time so type errors surface before any simulation runs.
Adding components
instance_id string used in connections and result queries.
Connecting ports
connect() call creates a directed edge from an output port to an input port.
Fan-out and fan-in
- Fan-out: connect one output to many inputs (always allowed).
- Fan-in: connect many outputs to one input only when the target port is declared with
aggregating_input_port().
Connection rules
Hardwave enforces these rules at wiring time:Aggregating Input Ports
Declare multi-connection ports and custom aggregation
Validation
Always validate before running:validate() checks that every required input port is either:
- Connected to an upstream output
- Has a default value
- Will be satisfied by an external input passed to
run()
GraphValidationError before simulation starts. Aggregating ports with min_connections raise INSUFFICIENT_CONNECTIONS when too few wires are present.
External inputs
Some ports are driven from outside the graph (ambient temperature, user commands, test fixtures):validate() so validation matches the run configuration.
Editing graphs
engine.run(), Hardwave calls graph.topological_order() to determine a safe evaluation sequence. For each component it collects input values from upstream outputs (aggregating multi-connection ports when declared), external inputs, or port defaults, calls the solver, and stores outputs for downstream components.
Next steps
Steady-State Simulation
Solve the graph once and read scalar outputs
Saving Graphs
Serialize, reload, and save snapshots to the cloud dashboard
