AggregationStrategy

class AggregationStrategy[source]

Bases: ABC

Combines per-partition candidates into scored global solutions.

Subclasses implement aggregate(), which receives the executed programs plus the problem-specific hooks needed to build and score global solutions, and returns the top-N (score, solution) pairs.

Methods Summary

aggregate(programs, initial_solution, ...[, ...])

Aggregate per-partition candidates into the top-N global solutions.

Methods Documentation

abstractmethod aggregate(programs, initial_solution, extend_fn, evaluate_fn, top_n=1)[source]

Aggregate per-partition candidates into the top-N global solutions.

Parameters:
Return type:

list[tuple[float, list[int]]]

Returns:

List of (score, solution) tuples sorted ascending by score (best first), with at most top_n entries.