env_step#
- hybrid_aif.composition.env_step(env, params=None, *, actions=None)[source]#
The step of a black box that runs a positional environment.
envspeaks the positional convention (hybrid_aif.envs.base):reset(key, params) -> (obs, state)andstep(key, state, action, params) -> (obs, state), the observations a tuple in modality order and the actionenv.null_action()’s shape. The black box the step runs declares one out-port per observation, in that order, each of the observation’s type; its in-ports fill the action. Level in-ports make a level action (an integer vector, one level per state factor): each in-port is one level at its position,actionsmapping an in-port’s name to its state factor (by default in-portkat state factork), the other state factors atnull_action’s level. Float in-ports make a continuous action: their vectors concatenated in declaration order (float32) are the whole vector, ofnull_action’s size. In-ports of both kinds are refused. Where the environment’s own params show its transitions (a tabular process:params.transition, one table per state factor, the action axis last), a level outside a state factor’s action axis and an in-port mapped onto a state factor that takes no action are refused; elsewhere the environment receives the levels as given.paramsare the environment’s own, passed to every call.The reset call (
obs is None) isenv.reset(key, params), orenv.reset(key, params, state)whenrun(carries=...)seeds the carry with a positional state; every other call isenv.step(key, carry, action, params). The carry is the positional state, the params come back as given. The keys arerun’s, untouched, so the step’s draws are the environment’s own under the same key. AGenerativeEnv(keyed) is refused, naming itsinner.