discopt.solvers.mip_nlp_candidates#

Fixed-integer NLP candidate management for MIP-NLP decomposition.

Classes#

FixedNLPCandidate

One candidate integer assignment for a fixed-integer NLP solve.

FixedNLPCandidateManager

Queue and schedule fixed-NLP candidates.

Module Contents#

class discopt.solvers.mip_nlp_candidates.FixedNLPCandidate#

One candidate integer assignment for a fixed-integer NLP solve.

point: numpy.ndarray#
source: str#
objective: float | None = None#
iteration: int | None = None#
nlp_source: str = 'active'#
provider: str | None = None#
sequence: int = 0#
integer_assignment: tuple[float, ...] = ()#
trace_dict() → dict[str, object]#
class discopt.solvers.mip_nlp_candidates.FixedNLPCandidateManager(*, n_vars: int, int_indices: list[int], lb, ub, strategy: str = 'always', iteration_frequency: int = 1, time_frequency: float = 0.0, candidate_limit: int | None = None, deduplicate_used_assignments: bool = False)#

Queue and schedule fixed-NLP candidates.

The manager keeps ordering deterministic, deduplicates integer assignments, and exposes a small scheduler that mirrors SHOT’s always/iteration/time/pool activation modes without coupling to a particular MIP or NLP backend.

n_vars#
int_indices#
lb#
ub#
strategy = ''#
iteration_frequency#
time_frequency#
candidate_limit = None#
deduplicate_used_assignments = False#
added_source_counts: collections.Counter[str]#
skipped_duplicate_count = 0#
property pending_count: int#
assignment_key(point) → tuple[float, ...]#
add(point, *, source: str, objective: float | None = None, iteration: int | None = None, nlp_source: str = 'active', provider: str | None = None) → bool#
add_external_candidates(candidates, *, iteration: int | None = None, provider: str | None = None, nlp_source: str = 'active') → int#
add_master_result(master_result: Any, *, iteration: int, solution_pool: bool, limit: int, nlp_source: str = 'active') → int#
should_call(*, iteration: int, elapsed: float | None = None, has_solution_pool_candidate: bool = False) → bool#
take_ready(*, iteration: int, elapsed: float | None = None, has_solution_pool_candidate: bool = False) → list[FixedNLPCandidate]#
record_call_result(candidate: FixedNLPCandidate, *, iteration: int, elapsed: float | None, success: bool) → None#
state_signature() → tuple[object, ...]#

Everything that decides what a later take_ready returns.

Used by OA’s fixed-point exit (#1710) to tell whether the scheduler would behave identically on a repeated iteration. The call clock and iteration are excluded deliberately: the exit applies only under the always strategy, whose should_call reads neither.

scheduler_trace() → dict[str, object]#