rsr.rsr.minimise_upper_states_random¶
- rsr.rsr.minimise_upper_states_random(comps_st, sfun, sys_upper_st, *, fval=None, min_state=0, step=1, seed=None, exclude_keys=('sys',))[source]¶
Random greedy reduction of component states (binary-search variant).
Like
minimise_upper_states_random_old(), but each component is resolved in a single visit instead of being lowered onestepat a time and revisited. For a given component (all others held fixed)sfunis monotone in that component’s state, so the feasibility predicatestatus >= sys_upper_stflips at most once as the state is lowered. This lets us find the lowest feasible state with an exponential (galloping) bracketing pass followed by a binary search, usingO(log m)sfuncalls per component (m= number of states) instead ofO(m). Acrossncomponents the total cost isO(n * log m).Component selection/ordering (random permutation, deque) is unchanged; only the per-component state-lowering is now a binary search, after which the component is removed from the candidate pool (no interleaved revisits).
- Returns:
final_state: dict of the minimised states.info: dict with keyspermutation,removed_on_lower,hit_min_state,attempts,final_state,final_sys_state.
- Return type:
Tuple
(final_state, info)