SolutionChecker

class SolutionChecker(var equalityChecker: SolutionEqualityIfc = InputEquality, noImproveThreshold: Int = defaultNoImproveThreshold)(source)

A solution checker holds solutions up to a capacity (threshold). The solution checker will hold a maximum number of solutions to check (capacity/threshold). If the contained solutions all test as equal, then the checker returns true.

Parameters

equalityChecker

the comparator to use for checking. The default is to use a InputEquality

noImproveThreshold

This value is used as a termination threshold for the largest number of iterations, during which no improvement of the captured solutions is found. By default, set to 5, which can be controlled globally via the companion object's defaultNoImproveThreshold

Constructors

Link copied to clipboard
constructor(equalityChecker: SolutionEqualityIfc = InputEquality, noImproveThreshold: Int = defaultNoImproveThreshold)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This value is used as a termination threshold for the largest number of iterations, during which no improvement of the captured solutions is found. By default, set to 5, which can be controlled globally via the companion object's defaultNoImproveThreshold

Functions

Link copied to clipboard
fun captureSolution(solution: Solution)
Link copied to clipboard

This will cause the solution checker to test whether the contained solutions are all the same based on the comparator. If any are different (not equal), then the function returns false.

Link copied to clipboard
fun clear()