cache module

class cache.Cache

Bases: object

This class acts as a cache of SetOfCims objects for a node.

_list_of_sets_of_parents

a list of Sets objects of the parents to which the cim in cache at SAME index is related

_actual_cache

a list of setOfCims objects

clear() → None

Clear the contents both of _actual_cache and _list_of_sets_of_parents.

find(parents_comb: Set)set_of_cims.SetOfCims

Tries to find in cache given the symbolic parents combination parents_comb the SetOfCims related to that parents_comb.

Parameters

parents_comb (Set) – the parents related to that SetOfCims

Returns

A SetOfCims object if the parents_comb index is found in _list_of_sets_of_parents. None otherwise.

Return type

SetOfCims

put(parents_comb: Set, socim: set_of_cims.SetOfCims) → None

Place in cache the SetOfCims object, and the related symbolic index parents_comb in _list_of_sets_of_parents.

Parameters
  • parents_comb (Set) – the symbolic set index

  • socim (SetOfCims) – the related SetOfCims object