:py:mod:`starling_sim.basemodel.output.kpi_output` ================================================== .. py:module:: starling_sim.basemodel.output.kpi_output Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: starling_sim.basemodel.output.kpi_output.KpiOutput Attributes ~~~~~~~~~~ .. autoapisummary:: starling_sim.basemodel.output.kpi_output.KEY_TIME_RANGE .. py:data:: KEY_TIME_RANGE :value: 'timeRange' .. py:class:: KpiOutput(population_names, kpi_list, kpi_name=None) .. py:method:: setup(filename, folder, simulation_model) Setup method called during simulation setup. Sets the values of out file and folder, and call setup for KPIs. :param filename: .csv file :param folder: :param simulation_model: :return: .. py:method:: 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 .. py:method:: build_kpi_table() -> pandas.DataFrame Build the output KPI table. KPIs from self.kpis are evaluated on each agent of each population from self.populations. :return: KPI DataFrame .. py:method:: compute_agent_kpis(agent) Build a DataFrame containing indicator evaluated on the given agent. The DataFrame columns are defined by the KPIs `keys` attributes, with and additional column for the agent id, and an optional column for time profiling. The DataFrame can contain several rows, for instance when KPIs are profiled by time. :param agent: Agent on which KPIs are evaluated :return: DataFrame containing indicators evaluated on the given agent