SimulationRunCacheIfc

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

Inheritors

Properties

Link copied to clipboard
abstract val capacity: Int

The maximum permitted size of the cache

Link copied to clipboard

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

Functions

Link copied to clipboard
open fun clear()

Removes all items from the cache

Link copied to clipboard
abstract fun put(requestData: RequestData, simulationRun: SimulationRun): SimulationRun?

Places the simulation run into the cache. It is important that implementors ensure that the input names and response names associated with the request are consistent with the input names and response names of the simulation run.

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

Places all input-solution pairs into the cache

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

Looks up and removes the simulation run associated with the supplied request. Null is returned if there is no associated simulation run. It is important that implementors handle the reduced size relative to the cache.

Link copied to clipboard

Retrieves the simulation runs associated with the requests

Link copied to clipboard
open operator fun set(requestData: RequestData, simulationRun: SimulationRun)

Allows use of bracket operator for setting values

Link copied to clipboard

Retrieves the simulation runs in the cache as a list of simulation runs