Memory Simulation Run Cache
A memory-based cache to hold simulation runs. A simplified cache to avoid including more advanced caches in the dependency tree. This cache holds simulation runs in a map based on (RequestData, SimulationRun) pairs. The cache capacity is constrained to the specified capacity. The user can supply an eviction rule that will identify a simulation run to evict when the capacity is reached. If no eviction rule is supplied, then by default, the algorithm removes the oldest simulation run.
Parameters
the maximum permitted size of the cache
the map to use as the cache. The map must be mutable.
Throws
if the capacity is less than 2.
Properties
Functions
By default, the eviction candidate will be the oldest request in the cache.
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.
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.
Retrieves the simulation runs in the cache as a list of simulation runs
Validates whether a given RequestData instance is compatible with a specified SimulationRun instance.