with_mirror#
- hybrid_aif.composition.with_mirror(
- system,
- params,
- *,
- per_component=False,
- lower=True,
- param_key=None,
- names=('model', 'world'),
systemcoupled with its own mirror: the closed System of a model and the world it models.The coupling of
names[0](systemas given) andnames[1](mirror(system, params, lower=lower, param_key=param_key), the world that generated what the model perceives): each modality ofsystemthatSystem.observesdoes not name is identified with the world’s emission of the same name, and each action node with the world’s control node it realises, which is then driven by it. Any System is accepted, a merged or coupled one included, and nothing is assumed of it; the result is a closed System, whichrun()steps withplan()for the model’s leaves andsample()for the world. A modalitysystemfeeds from its own emission is no in-port and gets no emission, asmirror()drops it.lower=True(the default) gives the world each learnable declaration at its posterior mean, or at one draw underparam_key;lower=Falsekeeps the declarations as the model has them.per_component=Truecouples the System with the merge of one mirror per component (mirror_components()) in place of the mirror of the System whole: a state factor of one component that another reads is then fed to the reader as an identity emission of its owner, and each component of the world is a leaf thatrun()steps on its own.