tauopt.engine.strategies.random_#
Uniform-random strategy – the robustness ladder’s floor.
Deliberately stdlib-only (requires no extras): the never-fail guarantee (pin P6) rests on this rung being importable and crash-proof in ANY environment. Linear constraints are honored by rejection (a capped scan; an effectively-empty feasible region raises honestly – experiment creation already probes for that).
Module Contents#
Classes#
Uniform-random strategy (the module docstring carries the floor contract). The final rung of both never-fail ladders (pin P6), never routed directly by the default policy; stdlib-only, so it requires no extras and stays importable in any environment. |
API#
- class tauopt.engine.strategies.random_.RandomStrategy#
Uniform-random strategy (the module docstring carries the floor contract). The final rung of both never-fail ladders (pin P6), never routed directly by the default policy; stdlib-only, so it requires no extras and stays importable in any environment.
- name#
‘random’
- suggest(state: tauopt.engine.state.ExperimentState, cfg: tauopt.engine.config.OptimizerConfig, n: int = 1) list[tauopt.engine.strategies.base.SuggestionDraft]#
Return the next n decoded, linearly-feasible uniform draws from a stdlib random.Random seeded from (state, cfg), with the state’s draw counts mixed in so a fixed explicit seed still progresses across asks (pin P4). Raises ValueError when linear constraints reject 100,000 consecutive draws (feasible region too small to sample).
- suggest_unique(state: tauopt.engine.state.ExperimentState, cfg: tauopt.engine.config.OptimizerConfig, n: int = 1, exclude: frozenset[str] = frozenset()) list[tauopt.engine.strategies.base.SuggestionDraft]#
The dedup repair path: advance to the next draw past collisions, at most SEQUENCE_REPAIR_FACTOR * n examined candidates.