Memory Solution Cache
A memory-based cache to hold solutions. A simplified cache to avoid including more advanced caches in the dependency tree. This cache holds solutions in a map based on (RequestData, Solution) pairs. The cache is capacity constrained to the specified capacity. The user can supply an eviction rule that will identify a solution to evict when the capacity is reached. If no eviction rule is supplied, then by default the algorithm removes the first solution that is deterministically infeasible, infinite, or undefined in some manner. Then, it will identify the oldest solution with the largest penalized objective function for removal.
Parameters
the maximum permitted size of the cache
if true, the input infeasible solutions are allowed to be saved in the cache. If false, input-infeasible solutions are silently ignored. The default is false (do not allow input infeasible solutions to be saved)
Properties
Functions
By default, the eviction candidate will be:
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
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.
Converts the data in the cache to a list containing instances of the SolutionData