SolverFactoryIfc

fun interface SolverFactoryIfc(source)

Creates a fresh solver instance bound to the supplied per-member evaluation resources.

Concurrent solver execution (parallel random restarts, solver portfolios) runs several solver instances at the same time, each on its own worker. Solver instances are stateful and must never be shared across workers, so the runner asks this factory for a new instance per member, handing it an evaluator whose entire resource chain (cache, simulation provider, model, stream tape) is private to that member.

Contract for implementations:

  • Return a NEW solver instance on every call; never a cached or shared one.

  • Bind the instance to the supplied EvaluatorIfc only — routing evaluations through any other (shared) evaluator is a data race under concurrent execution.

  • Give the instance its own random number stream provider (the solver constructors' default of a fresh provider is correct) so member solvers never share solver-side streams. The member's simulation-side streams are isolated by the evaluator.

  • The factory itself may be closed over problem definition and algorithm parameters; it is invoked on worker threads, so anything it captures must be safe to read concurrently.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun create(evaluator: EvaluatorIfc, memberIndex: Int, name: String): Solver

Creates a fresh solver for one member of a concurrent run.