input_output_functions.calculate_busy_fraction#

input_output_functions.calculate_busy_fraction(df_patient, SIMULATION_PARAMETERS: dict[str, Any]) float#

Calculates the busy fraction of a simulation run.

A warm-up period of AT_BOUNDARY and cool-down period of FT_BOUNDARY is used, which means that the calculation does not consider data before the warm-up period and after the cool-down period.

Parameters:
  • df_patient (pandas.DataFrame) – A dataframe with the patient data where each row represents a patient. At least columns “arrival_time”, “waiting_time_before_assigned” and “finish_time” are necessary. See the output data section on the ELASPY website for explanations.

  • SIMULATION_PARAMETERS (dict[str, Any]) – The simulation parameters. The parameters AT_BOUNDARY, FT_BOUNDARY and NUM_AMBULANCES are at least necessary. See main.py for parameter explanations.

Raises:

Exception – If the busy fraction calculation uses the same data more than once.

Returns:

float – The busy fraction.