@staticmethod
def run_cached(obj, algorithm, params):
    """
        Gets data from the cache if valid
        :param params:
        :param obj:
        :type algorithm: Algorithm
        :return: The data or None
        """
    key = algorithm.cache_key(params)
    if key not in obj._cache:
        algorithm.set_logger()
        val = algorithm.algorithm(obj, params)
        log = algorithm.unset_logger()
        obj._cache[key] = val, log
    else:
        val, log = obj._cache[key]
        algorithm.emulate_log(log)
    return val
