:py:mod:`starling_sim.basemodel.output.output_factory` ====================================================== .. py:module:: starling_sim.basemodel.output.output_factory Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: starling_sim.basemodel.output.output_factory.OutputFactory Functions ~~~~~~~~~ .. autoapisummary:: starling_sim.basemodel.output.output_factory.output_file_generator .. py:function:: output_file_generator(compressed_mimetype: str = None, content: str = None, subject: str = None) .. py:class:: OutputFactory Describes an output generation method This class should be extended to give a concrete implementation of the output generator e.g. writing a json containing all the simulation data .. py:attribute:: GENERATION_ERROR_FORMAT :value: 'Error while generating {} output: {}' .. py:method:: setup(simulation_model) Setup method called during simulation setup. Set values of the output factory attributes. :param simulation_model: .. py:method:: setup_kpi_output() Set the kpi_outputs attribute as a list of KpiOutput objects. By default, no KPIs are set .. py:method:: setup_geojson_output() Set the geojson_output attribute as a GeojsonOutput object. .. py:method:: new_output_file(filepath: str, mimetype: str, compressed_mimetype: str = None, content: str = None, subject: str = None) Add a new file and its information to the output dict. This method should be called after generating an output file. :param filepath: output file path :param mimetype: file mimetype :param compressed_mimetype: compressed mimetype (defaults to file mimetype) :param content: content metadata (mandatory) :param subject: subject .. py:method:: extract_simulation(simulation_model) This method will be called for the output generation. It must be extended to generate the output using specific methods. .. py:method:: generate_event_file(simulation_model) Generate event file output. :param simulation_model: .. py:method:: generate_geojson_output(simulation_model) Call the generation method of the geojson output attribute :param simulation_model: .. py:method:: generate_kpi_output(simulation_model) Call the generation method of all the kpi outputs :param simulation_model: .. py:method:: generate_trace_output(simulation_model) Generate a text file containing the event traces of the agents. :param simulation_model: .. py:method:: generate_run_summary(simulation_scenario) Generate a summary file of the simulation run. :param simulation_scenario: SimulationScenario object