des_parallel_process.parallelProcessJoblib

des_parallel_process.parallelProcessJoblib(
    total_runs,
    sim_duration,
    warm_up_time,
    sim_start_date,
    amb_data,
    save_params_csv=True,
    demand_increase_percent=1.0,
    activity_duration_multiplier=1.0,
    print_debug_messages=False,
    master_seed=42,
    n_cores=-1,
)

Execute multiple simulation runs in parallel using joblib.

Parameters

Name Type Description Default
total_runs int The total number of simulation runs to execute. required
sim_duration int The duration of each simulation (excluding warm-up). required
warm_up_time int The warm-up period to discard before recording results. required
sim_start_date datetime The datetime representing the start of the simulation. required
amb_data bool Flag indicating whether ambulance-specific data should be generated in the simulation. required
save_params_csv bool If True, simulation parameters will be saved to CSV during the first run. Default is True. True
demand_increase_percent float Factor by which demand is increased (e.g., 1.10 for a 10% increase). Default is 1.0. 1.0
activity_duration_multiplier float Multiplier to adjust generated durations of activities (e.g., 1.10 for a 10% increase). Default is 1.0. 1.0
print_debug_messages bool If True, enables additional debug message output during each run. Default is False. False
master_seed int Master seed used to generate the uncorrelated random number streams for replication consistency 42
n_cores int Determines how many parallel simulations will be run at a time (which is equivalent to the number of cores). Default is -1, which means all available cores will be utilised. -1

Returns

Name Type Description
list of pandas.DataFrame A list of DataFrames, each containing the results of an individual simulation run.

Notes

  • This function distributes simulation runs across available CPU cores using joblib’s Parallel and delayed utilities. Each run is executed with the runSim function, with the given configuration parameters.
  • Runs are distributed across all available CPU cores (n_jobs=-1).
  • Only the first run will save parameter data if save_params_csv is True.
  • If a single output csv is required, use of this function must be followed by collateRunResults()