cesarp.SIA2024.demand_generators.ValuePerKeyCache module

class cesarp.SIA2024.demand_generators.ValuePerKeyCache.ValuePerKeyCache(cache_keys: List[Any], value_calc_for_key_method: Callable[[str], Any])[source]

Bases: object

__init__(cache_keys: List[Any], value_calc_for_key_method: Callable[[str], Any])[source]
Parameters:
  • cache_keys – keys for the cache

  • value_calc_for_key_method – method to calculate the value to be stored, Argument should match key type

lookup_value(cache_key)[source]