saealib.CompositeSurrogateManager

class saealib.CompositeSurrogateManager(managers, combine_fn)[source]

Bases: SurrogateManager

Surrogate manager that combines scores from multiple sub-managers.

Each sub-manager’s score_candidates is called independently. The resulting score arrays are combined by combine_fn. Predictions (for tell_f assignment) are taken from managers[0].

Parameters:
  • managers (list[SurrogateManager]) – Sub-managers to combine. Must be non-empty. managers[0] provides the SurrogatePrediction objects returned by score_candidates; its predicted objective values flow into assign_tell_f in the strategies.

  • combine_fn (callable(list[np.ndarray]) -> np.ndarray) – Accepts a list of score arrays (each shape (n_candidates,)) and returns a single combined score array of the same shape. Use product_combine() for element-wise product (e.g. EI x PoF) or rank_weighted_combine() for rank-normalised weighted average.

Examples

EI x PoF (objective x feasibility product):

>>> manager = CompositeSurrogateManager(
...     [ei_manager, pof_manager],
...     combine_fn=product_combine,
... )

Rank-normalised ensemble (equivalent to former EnsembleSurrogateManager):

>>> manager = CompositeSurrogateManager(
...     [m1, m2],
...     combine_fn=rank_weighted_combine(weights=[0.3, 0.7]),
... )

Methods

__init__

score_candidates

Combine scores from all sub-managers using combine_fn.

Method Details

CompositeSurrogateManager.__init__(managers, combine_fn)[source]
Parameters:
  • managers (list[SurrogateManager])

  • combine_fn (Callable[[list[ndarray]], ndarray])

CompositeSurrogateManager.score_candidates(candidates_x, archive, provider=None, ctx=None)[source]

Combine scores from all sub-managers using combine_fn.

Returns the predictions from managers[0] as representative.

Parameters:
  • candidates_x (np.ndarray)

  • archive (Archive)

  • provider (ComponentProvider | None)

  • ctx (OptimizationContext | None)

Return type:

tuple[np.ndarray, list[SurrogatePrediction]]