weighted_choice#

eclypse.policies.compose.weighted_choice(policies, weights)[source]#

Run one policy sampled from explicit weights.

Parameters:
  • policies (list[UpdatePolicy] | tuple[UpdatePolicy, ...]) – Candidate policies to sample from.

  • weights (list[float] | tuple[float, ...]) – Sampling weights aligned with policies.

Returns:

Policy that calls one weighted-sampled child policy.

Return type:

UpdatePolicy