aggregating_input_port() when several upstream outputs should feed the same input (for example summing branch currents at a node, averaging redundant temperature sensors, or applying custom combine logic).
Fan-out vs fan-in
Regular
input_port() ports still raise DuplicateConnectionError if you connect a second source.
Built-in aggregation
Built-in modes
Optional limits:
Custom aggregation (callable wins entirely)
Pass anaggregate callable to fully control how values are combined. When present, it replaces any built-in aggregation mode. The engine passes the raw list of upstream values to your function.
Aggregator signature
solve(inputs) receives under port.name: always a single value, never a list.
Wiring a graph
Disconnecting one source
Serialization
Port.to_dict() serializes the aggregation mode ("sum", "custom", etc.) but not the callable. Custom functions live on the component class at definition time (the same pattern as solve()). When you deserialize a graph with SimulationGraph.from_dict(), the registered component class supplies aggregation_fn.
