def calc_mean_lifetime(agent_stats, skill_headers=None, verbose=False, pop=None):
    lifetimes = get_pop_stats(agent_stats['lifespans'], pop)
    if (len(lifetimes) != 0):
        lifetimes = np.hstack(lifetimes)
    else:
        lifetimes = [0]
    mean_lifetime = lifetimes.mean()
    return mean_lifetime
def calc_mean_lifetime(agent_stats, skill_headers=None, verbose=False, pop=None):
    lifetimes = get_pop_stats(agent_stats['lifespans'], pop)
    if (len(lifetimes) != 0):
        lifetimes = np.hstack(lifetimes)
    else:
        lifetimes = [0]
    mean_lifetime = lifetimes.mean()
    return mean_lifetime