Solutions

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

Class to support a group of solutions (each 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 100. 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)
constructor(capacity: Int = defaultCapacity, allowInfeasibleSolutions: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
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
Link copied to clipboard
open override val size: Int

Functions

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

Adds the solution to the sequence of solutions. If the capacity is met, then the oldest (first) item is evicted and returned

Link copied to clipboard
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

Returns true if and only if all cells in the list are available.

Link copied to clipboard

Converts the MCB interval data to a data frame

Link copied to clipboard

Converts the MCB result data to a data frame

Link copied to clipboard

Converts the MCB interval data to a data frame

Link copied to clipboard

Converts the observation data to a data frame

Link copied to clipboard

Converts the statistic data to a data frame

Link copied to clipboard

Filters the list such that the returned list has resources that have units available for allocation. The returned list may be empty which indicates that there are no resources in the list that have available units.

Link copied to clipboard
Link copied to clipboard

Returns the cumulative distribution probabilities as an array

Link copied to clipboard
fun clear()

Clears all solutions

Link copied to clipboard
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
Link copied to clipboard

Computes and assigns the distance to the provided location from the current location of the resource for each resource. The distance is assigned to the resource's sectionCriteria attribute. This mutates elements of the list.

Link copied to clipboard
open operator override fun get(index: Int): Solution
Link copied to clipboard
Link copied to clipboard
open override fun indexOf(element: Solution): Int
Link copied to clipboard

Returns the index associated with the minimum element in the list For ties, this returns the first found.

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

Returns the total number of available cells within the list. The count is regardless of the sequential nature of the cells. That is, regardless of whether intermediate cells are not available. This is simply the total number available.

Link copied to clipboard

Returns the total number of units that are available within the resources contained in the list.

Link copied to clipboard
open fun orderedResponseFeasibleSolutions(overallCILevel: Double = 0.99): List<Solution>

A list of solutions ordered by penalized objective function that are input feasible and have tested as response constraint feasible.

Link copied to clipboard
fun List<String>.parseToDoubles(parseFail: Double = Double.NaN): DoubleArray

Converts the list of strings to Doubles

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
fun <T> Collection<T>.powerset(): Set<Set<T>>
Link copied to clipboard

Returns the probabilities as an array

Link copied to clipboard
fun <T> List<T>.randomlySelect(streamNum: Int): T
fun <T> List<T>.randomlySelect(stream: RNStreamIfc = KSLRandom.defaultRNStream()): T
Link copied to clipboard
fun remove(solution: Solution)

Removes the specified element

Link copied to clipboard

Returns an array that holds a sample from each individual random variable in the collection.

Returns an array that holds a sample from each individual random variable in the list.

Returns an array that holds a sample of size sampleSize from each individual random variable in the collection.

fun List<RVariableIfc>.sample(sampleSize: Int = 1): Array<DoubleArray>

Returns a matrix that holds a sample of size sampleSize from each individual random variable in the list.

Link copied to clipboard

Returns a statistic that summarizes the data in the collection.

Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<Solution>
Link copied to clipboard
fun List<DesignPoint>.toDataFrame(coded: Boolean = false): AnyFrame

Turns the list of design points into a data frame. The columns of the data frame are the factor names and the rows are the design points values.

Link copied to clipboard

For compatibility purposes converts the list of CSV records to a list of string arrays

Link copied to clipboard
fun List<Double?>.toPrimitives(replaceNull: Double = 0.0): DoubleArray

Converts any null values to replaceNull. For List use toDoubleArray()

fun List<Int?>.toPrimitives(replaceNull: Int = 0): IntArray

Converts any null values to replaceNull. For List use toDoubleArray()

fun List<Long?>.toPrimitives(replaceNull: Long = 0): LongArray

Converts any null values to replaceNull. For List use toDoubleArray()

Link copied to clipboard

A simple extension function to compute the total number of replications within a set of evaluation requests.

Link copied to clipboard

Returns the values as an array

Link copied to clipboard
Link copied to clipboard
fun List<DoubleArray>.write(out: PrintWriter = KSLFileUtil.SOUT, df: DecimalFormat? = null)