saealib.execution.AsyncEvaluationScheduler#

class saealib.execution.AsyncEvaluationScheduler(evaluator, *, max_pending=1, max_reserved_fe=None, max_reserved_cost=None, timeout=None, retry_limit=0, feedback_builder=None, algorithm=None, callback_manager=None)[ソース]#

ベースクラス: object

Coordinate asynchronous requests and serialized state mutation.

パラメータ:
  • evaluator (Evaluator)

  • max_pending (int)

  • max_reserved_fe (int | None)

  • max_reserved_cost (float | None)

  • timeout (float | None)

  • retry_limit (int)

  • feedback_builder (FeedbackBuilder | None)

  • algorithm (Any)

  • callback_manager (Any)

Methods

__init__

cancel

Cancel a pending request and commit its terminal update.

checkpoint

Save pending state only when the evaluator can reattach it.

contract

Return the scheduler contract and its evaluator part.

enable_feedback_accumulator

Enable delivery through a compiler-inserted accumulator.

pending_candidate_ids

Return candidate IDs reserved by pending requests.

poll

Collect completed work and commit updates serially.

poll_result

Collect completed work and report whether this call made progress.

reattach

Rebuild runtime handles for checkpointed requests.

reserved_cost

Return reserved estimated cost.

reserved_fe

Return reserved candidate count.

submit

Submit disjoint requests within capacity and budget limits.

Method Details

AsyncEvaluationScheduler.__init__(evaluator, *, max_pending=1, max_reserved_fe=None, max_reserved_cost=None, timeout=None, retry_limit=0, feedback_builder=None, algorithm=None, callback_manager=None)[ソース]#
パラメータ:
  • evaluator (Evaluator)

  • max_pending (int)

  • max_reserved_fe (int | None)

  • max_reserved_cost (float | None)

  • timeout (float | None)

  • retry_limit (int)

  • feedback_builder (FeedbackBuilder | None)

  • algorithm (Any)

  • callback_manager (Any)

戻り値の型:

None

AsyncEvaluationScheduler.cancel(state, request_id)[ソース]#

Cancel a pending request and commit its terminal update.

パラメータ:
  • state (OptimizationState)

  • request_id (int)

戻り値の型:

OptimizationState

AsyncEvaluationScheduler.checkpoint(state, path)[ソース]#

Save pending state only when the evaluator can reattach it.

パラメータ:
  • state (OptimizationState)

  • path (str)

戻り値の型:

None

AsyncEvaluationScheduler.contract()[ソース]#

Return the scheduler contract and its evaluator part.

戻り値の型:

ComponentContract

AsyncEvaluationScheduler.enable_feedback_accumulator()[ソース]#

Enable delivery through a compiler-inserted accumulator.

戻り値の型:

None

AsyncEvaluationScheduler.pending_candidate_ids(state)[ソース]#

Return candidate IDs reserved by pending requests.

パラメータ:

state (OptimizationState)

戻り値の型:

np.ndarray

AsyncEvaluationScheduler.poll(state, *, wait=False)[ソース]#

Collect completed work and commit updates serially.

パラメータ:
  • state (OptimizationState)

  • wait (bool)

戻り値の型:

OptimizationState

AsyncEvaluationScheduler.poll_result(state, *, wait=False)[ソース]#

Collect completed work and report whether this call made progress.

パラメータ:
  • state (OptimizationState)

  • wait (bool)

戻り値の型:

PollResult

AsyncEvaluationScheduler.reattach(state)[ソース]#

Rebuild runtime handles for checkpointed requests.

パラメータ:

state (OptimizationState)

戻り値の型:

OptimizationState

AsyncEvaluationScheduler.reserved_cost(state)[ソース]#

Return reserved estimated cost.

パラメータ:

state (OptimizationState)

戻り値の型:

float

AsyncEvaluationScheduler.reserved_fe(state)[ソース]#

Return reserved candidate count.

パラメータ:

state (OptimizationState)

戻り値の型:

int

AsyncEvaluationScheduler.submit(state, requests)[ソース]#

Submit disjoint requests within capacity and budget limits.

パラメータ:
戻り値の型:

OptimizationState