register_planner

register_planner#

hybrid_aif.planning.register_planner(name, *, needs_key=False, branching=False, legal_depth=False)[source]#

Decorator registering a planner under name for resolution by Systems.

needs_key=True marks a stochastic planner, which reads PlannerContext.key. branching=True marks a closed-loop planner that scores each step on beliefs updated by the outcomes of earlier steps; it may be declared with a System’s branch_on modalities, and when they are declared its context’s step and terminal terms score a state target by its cross-entropy rather than its KL (design: per-variable-infogain.md V11 decisions 6 and 8). The marks are set on the function object, so they travel with a planner passed as a callable: System.infer_policies / act then require a plan_key for a stochastic planner and build the branching step terms for a branching one. legal_depth=True marks a planner that reads PlannerContext.legal_steps, masking the illegal actions at every depth of its plan; a legal= mask given per step is then handed to it, and the System applies only the first step’s row to the policies the planner returns.