SolutionCacheIfc

A solution cache should be designed to efficiently look up a solution based on a given set of input settings.

Inheritors

Properties

Link copied to clipboard

If true input infeasible solutions are allowed to be saved in the cache. If false, input-infeasible solutions should not be saved in the cache. Implementors are free to decide how to handle what to do with unsaved input infeasible solutions. The default is false (do not allow input infeasible solutions to be saved)

Link copied to clipboard
abstract val capacity: Int

The maximum permitted size of the cache

Link copied to clipboard
Link copied to clipboard

A rule to govern which solution should be evicted when the cache capacity is met.

Link copied to clipboard
abstract val keys: Set<RequestData>
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract val values: Collection<Solution>

Functions

Link copied to clipboard

Computes the box plot summaries for the data within the map

Link copied to clipboard
open fun clear()

Removes all items from the cache

Link copied to clipboard

Computes the confidence intervals for the data in the map

Link copied to clipboard
abstract fun containsKey(key: RequestData): Boolean
Link copied to clipboard
abstract fun containsValue(value: Solution): Boolean
Link copied to clipboard
abstract operator fun get(key: RequestData): Solution?
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard

The map of arrays is considered rectangular if all arrays in the map have the same number of elements (same size).

Link copied to clipboard
abstract fun put(requestData: RequestData, solution: Solution): Solution?

Places the solution into the cache. It is important that implementors handle the insertion of infeasible inputs and ensure that the input map is associated with the solution

Link copied to clipboard
open fun putAll(from: Map<out RequestData, Solution>)

Places all input-solution pairs into the cache

Link copied to clipboard
abstract fun remove(requestData: RequestData): Solution?

Looks up and removes the solution associated with the supplied input map. Null is returned if there is no associated solution. It is important that implementor handle the reduced size relative to the cache.

Link copied to clipboard

Retrieves the solutions associated with the requests

Link copied to clipboard
open operator fun set(requestData: RequestData, solution: Solution)

Allows use of bracket operator for setting values

Link copied to clipboard
abstract fun solutions(): Solutions

Retrieves the solution in the cache as a group of solutions

Link copied to clipboard
fun <K, V : Comparable<V>> Map<K, V>.sortMapByValue(): Map<K, V>
Link copied to clipboard
Link copied to clipboard

Computes the statistical summaries for the data within the map

Link copied to clipboard

Converts the data map to a 2-D array. The values of the map are extracted

Link copied to clipboard
fun Map<String, DoubleArray>.toDataFrame(): AnyFrame

Converts the data stored in each array to columns within a DataFrame, with the column names as the key from the map and the columns holding the data. Each array must have the same size.

Link copied to clipboard
Link copied to clipboard

Converts the inner DoubleArray to List

Link copied to clipboard
fun Map<String, DoubleArray>.toObservationData(tableName: String = "tblObservations", context: String? = null, subject: String? = null): List<ObservationDataDb>

Converts the data map to a long format view of the observations.