def expand_by_lifespan(agent_stats, lifespans):
    'Push agents further from their mean according to how short-lived they were. For punishing abundance of premature\n   death when rewarding homogeneity.'
    weights = sigmoid_lifespan(lifespans)
    n_agents = lifespans.shape[0]
    mean_agent = agent_stats.mean(axis=0)
    mean_agents = np.repeat(mean_agent.reshape(1, mean_agent.shape[0]), n_agents, axis=0)
    agent_deltas = (mean_agents - agent_stats)
    agent_deltas = ((agent_deltas / np.linalg.norm(agent_deltas)) * 100)
    agent_skills = (agent_stats - (weights * agent_deltas.T).T)
    return agent_skills
Push agents further from their mean according to how short-lived they were. For punishing abundance of premature
death when rewarding homogeneity.
def expand_by_lifespan(agent_stats, lifespans):
    'Push agents further from their mean according to how short-lived they were. For punishing abundance of premature\n   death when rewarding homogeneity.'
    weights = sigmoid_lifespan(lifespans)
    n_agents = lifespans.shape[0]
    mean_agent = agent_stats.mean(axis=0)
    mean_agents = np.repeat(mean_agent.reshape(1, mean_agent.shape[0]), n_agents, axis=0)
    agent_deltas = (mean_agents - agent_stats)
    agent_deltas = ((agent_deltas / np.linalg.norm(agent_deltas)) * 100)
    agent_skills = (agent_stats - (weights * agent_deltas.T).T)
    return agent_skills