commonMain.it.unibo.tuprolog.solve.impl.SolveOptionsImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solve-jvm Show documentation
Show all versions of solve-jvm Show documentation
Resolution-agnostic API for logic solvers
package it.unibo.tuprolog.solve.impl
import it.unibo.tuprolog.solve.SolveOptions
import it.unibo.tuprolog.solve.TimeDuration
internal data class SolveOptionsImpl(
override val isLazy: Boolean,
override val timeout: TimeDuration = SolveOptions.MAX_TIMEOUT,
override val limit: Int = SolveOptions.ALL_SOLUTIONS,
override val customOptions: Map = emptyMap(),
) : SolveOptions {
init {
require(timeout >= 0L) { "Invalid timeout: $timeout" }
require(limit != 0) { "Invalid limit: $limit" }
}
override fun setLazy(value: Boolean): SolveOptions = copy(isLazy = value)
override fun setTimeout(value: TimeDuration): SolveOptions = copy(timeout = value)
override fun setLimit(value: Int): SolveOptions = copy(limit = value)
override fun setOptions(options: Map): SolveOptions = copy(customOptions = options)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy