SolveOptions

interface SolveOptions

Configuration for a single Solver.solve invocation: whether solutions are computed lazily or eagerly, how long resolution may run for, how many solutions to cap at, and any implementation-specific extra knob.

Instances are immutable; the set*/add* methods all return a new SolveOptions rather than mutating the receiver. Build one via the companion's factories -- allLazily, someLazily, allEagerly, someEagerly, their ...WithTimeout variants, or the general of -- or start from DEFAULT and tweak it, e.g. SolveOptions.DEFAULT.setLimit(1).

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val customOptions: Map<String, Any>

Implementation-specific extra options, keyed by name, that a particular Solver strategy may interpret.

Link copied to clipboard
open val isEager: Boolean

The negation of isLazy: true if solutions are computed eagerly, ahead of consuming the sequence.

Link copied to clipboard
abstract val isLazy: Boolean

Whether Solver.solve should stream solutions on demand as the returned Sequence is consumed (true), or compute the whole (bounded) solution set eagerly before returning (false, see isEager).

Link copied to clipboard
open val isLimited: Boolean

Whether limit actually caps the number of produced solutions (i.e. limit is not ALL_SOLUTIONS).

Link copied to clipboard
abstract val limit: Int

The maximum number of solutions to produce, or ALL_SOLUTIONS (i.e. -1) for no cap.

Link copied to clipboard
abstract val timeout: TimeDuration

The maximum duration resolution is allowed to run for, before being aborted; defaults to MAX_TIMEOUT.

Functions

Link copied to clipboard
open fun <X : Any> addOption(key: String, value: X): SolveOptions

Returns a copy of these options with a single custom option, key, added (or overridden) with value.

Link copied to clipboard
open fun <X : Any> addOptions(options: Map<String, X>): SolveOptions

Returns a copy of these options with customOptions merged with (and overridden by) options.

Link copied to clipboard
abstract fun setLazy(value: Boolean): SolveOptions

Returns a copy of these options with isLazy set to value.

Link copied to clipboard
abstract fun setLimit(value: Int): SolveOptions

Returns a copy of these options with limit set to value.

Link copied to clipboard
open fun <X : Any> setOption(key: String, value: X): SolveOptions

Returns a copy of these options with a single custom option, key, replaced by value.

Link copied to clipboard
abstract fun <X : Any> setOptions(options: Map<String, X>): SolveOptions

Returns a copy of these options with customOptions replaced entirely by options.

Link copied to clipboard
abstract fun setTimeout(value: TimeDuration): SolveOptions

Returns a copy of these options with timeout set to value.