starling_sim.basemodel.output.kpi_output

Module Contents

Classes

KpiOutput

class starling_sim.basemodel.output.kpi_output.KpiOutput(population_names, kpi_list, kpi_name=None)
setup(filename, folder, simulation_model)

Setup method called during simulation setup.

Sets the values of out file and folder, and call setup for KPIs.

Parameters:
  • filename – .csv file

  • folder

  • simulation_model

Returns:

agent_kpi_dict(agent)

Computes the KPIs for the given agent by calling their update method for all its trace :param agent: :return:

write_kpi_table()

Write the KPI of the population in the csv file obtained from out file attributes The KPIs evaluated are defined by the kpi_list attribute

compute_population_kpi_table(population)

Compute a kpi table for the given population dict.

Parameters:

population – population dict {id: agent}

Returns:

DataFrame containing the KPI values