black_box

Contents

black_box#

hybrid_aif.composition.black_box(ins=None, outs=None)[source]#

An external process declared by its ports alone, as (System, SystemParams).

ins maps each in-port’s name to its type, outs each out-port’s, a type being (LEVEL, levels) or (FLOAT, width) (hybrid_aif.controls.LEVEL and FLOAT). The System has one control node per in-port, with no action node and no reader, and one emission per out-port, with no parents and the static kernel "black_box", in the order given; System.black_box holds every port’s type. The params hold nothing.

Couple it as any component: Identify("agent.a_v", "world.v") drives the in-port v with an action node, Identify("world.fix", "agent.fix") feeds a modality from the out-port fix; the types of the two ends must agree, and an in-port nothing drives leaves the coupling open, which run refuses. Step it under run with a custom step (a function of the step contract, or env_step()); System.ports reads its ports back.

Refused: no port at all, a name given as both an in-port and an out-port, a dotted or empty name, a type that is not one of the two forms.