Solutions

class Solutions(capacity: Int = defaultCapacity, var allowInfeasibleSolutions: Boolean = false) : SolutionsIfc(source)

Class to support a group of solutions (all containing inputs, responses, objective fns, penalties) The solutions are naturally ordered by comparison of Solution instances based on their penalized objective functions (without regard to sampling error).

Parameters

capacity

the capacity for the solutions. Constrains the total number of solutions in-memory. The default capacity is defaultCapacity. Oldest solutions are evicted first.

allowInfeasibleSolutions

if true input-infeasible solutions are allowed to be saved. If false, input-infeasible solutions are silently ignored. The default is false (do not allow input-infeasible solutions to be saved)

Constructors

Link copied to clipboard
constructor(solutions: List<Solution>, capacity: Int = defaultCapacity, allowInfeasibleSolutions: Boolean = false)

Class to support a group of solutions (all containing inputs, responses, objective fns, penalties) The solutions are naturally ordered by comparison of Solution instances based on their penalized objective functions (without regard to sampling error).

constructor(capacity: Int = defaultCapacity, allowInfeasibleSolutions: Boolean = false)

Properties

Link copied to clipboard
open override var capacity: Int

The capacity of the sequence of solutions.

Link copied to clipboard

A time-ordered list of the solution, where 0 is the first (oldest) solution added, 1 is the next, etc.

Link copied to clipboard

A list of solutions that are input feasible ordered by penalized objective function.

Link copied to clipboard
open override val orderedSolutions: List<Solution>

A list of solutions ordered by penalized objective function. The solutions may or may not be feasible.

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
open override fun add(solution: Solution): Solution?

Adds the solution to the solutions.

Link copied to clipboard
open override fun addAll(solutions: List<Solution>): List<Solution>

Adds all the solutions to the sequence of solutions. If the capacity is met, then the oldest (first) item is evicted and returned. Each evicted item is returned in the order of eviction.

Link copied to clipboard
open override fun clear()

Clears all solutions

Link copied to clipboard
open operator override fun contains(element: Solution): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<Solution>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): Solution
Link copied to clipboard
open override fun increaseCapacity(increase: Int)

Increases the capacity of the sequence of solutions. The default increase is to increase by defaultCapacity.

Link copied to clipboard
open override fun indexOf(element: Solution): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<Solution>
Link copied to clipboard
open override fun lastIndexOf(element: Solution): Int
Link copied to clipboard
open override fun listIterator(): ListIterator<Solution>
open override fun listIterator(index: Int): ListIterator<Solution>
Link copied to clipboard
open override fun peekBest(): Solution?

The solution with the lowest penalized objective function value. The solution may or may not be feasible.

Link copied to clipboard
open override fun remove(solution: Solution)

Removes the specified element

Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<Solution>
Link copied to clipboard
open override fun toString(): String