add

abstract fun add(solution: Solution): Solution?(source)

Adds the solution to the solutions.

If the solution is input-infeasible and the allowInfeasibleSolutions flag is false, then the solution is silently ignored.

If the capacity is met, then the worst solution is evicted and returned.

If the solution is already in the sequence of solutions (based on input-equality), and it has more samples than the existing solution, then the existing solution is replaced; otherwise the existing solution is not replaced.

Return

a possibly evicted item or null if the solution was not added

Parameters

solution

the solution to add