Skip to content

RoundRobinComponentSelector

gepa.strategies.component_selector.RoundRobinReflectionComponentSelector

Bases: ReflectionComponentSelector

Functions

__call__(state: GEPAState, trajectories: list[Trajectory], subsample_scores: list[float], candidate_idx: int, candidate: dict[str, str]) -> list[str]

Source code in gepa/strategies/component_selector.py
def __call__(
    self,
    state: GEPAState,
    trajectories: list[Trajectory],
    subsample_scores: list[float],
    candidate_idx: int,
    candidate: dict[str, str],
) -> list[str]:
    pid = state.named_predictor_id_to_update_next_for_program_candidate[candidate_idx]
    state.named_predictor_id_to_update_next_for_program_candidate[candidate_idx] = (pid + 1) % len(
        state.list_of_named_predictors
    )
    name = state.list_of_named_predictors[pid]
    return [name]